Debian Codegraph @

app/ui/PortraitKeyboard.qml

raw
1 /*
2 * Copyright (C) 2017-2019 UBports
3 * Copyright (C) 2015 Canonical Ltd
4 *
5 * This file is part of Lomiri Calculator App
6 *
7 * Lomiri Calculator App is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 3 as
9 * published by the Free Software Foundation.
10 *
11 * Lomiri Calculator App is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 import QtQuick 2.4
20 import Lomiri.Components 1.3
21
22 CalcKeyboard {
23 id: calcKeyboard
24
25 KeyboardPage {
26 buttonRatio: 0.6
27 buttonMaxHeight: scrollableView.height / 10.0
28
29 keyboardModel: new Array(
30 { text: "←", name: "delete", action: "delete", kbdKeys: [Qt.Key_Backspace, Qt.Key_Delete], secondaryAction: "clearFormula", role: "highlight" },
31 { text: "( )", name: "universalBracket", pushText: "()", pasteTexts: ["(", ")"], kbdKeys: [Qt.Key_ParenLeft, Qt.Key_ParenRight, Qt.Key_BracketLeft, Qt.Key_BracketRight] },
32 { text: "√", name: "sqrt", pushText: "sqrt("},
33 { text: "÷", name: "divide", pushText: "/", kbdKeys: [Qt.Key_Slash] },
34 { number: 7, name: "seven" },
35 { number: 8, name: "eight" },
36 { number: 9, name: "nine" },
37 { text: "×", name: "multiply", pushText: "*", kbdKeys: [Qt.Key_Asterisk] },
38 { number: 4, name: "four" },
39 { number: 5, name: "five" },
40 { number: 6, name: "six" },
41 { text: "−", name: "minus", pushText: "-", kbdKeys: [Qt.Key_Minus] },
42 { number: 1, name: "one" },
43 { number: 2, name: "two" },
44 { number: 3, name: "three" },
45 { text: "+", name: "plus" },
46 { text: decimalPoint, name: "point", pushText: "." },
47 { number: 0, name: "zero", forceNumber: true },
48 { text: "=", name: "equals", wFactor: 2, action: "calculate", kbdKeys: [Qt.Key_Enter, Qt.Key_Return], role: "button" }
49 )
50 }
51 }