~f-riccardo87/ubuntu-calculator-app/new-design

« back to all changes in this revision

Viewing changes to CalcKeyboard.qml

  • Committer: Riccardo Ferrazzo
  • Date: 2013-03-08 09:35:39 UTC
  • Revision ID: f.riccardo87@gmail.com-20130308093539-4x88cnd6qswxwobe
scientific calculator merged

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import QtQuick 2.0
2
 
import Ubuntu.Components 0.1
3
 
 
4
 
Item {
5
 
    width: parent.width
6
 
    height: grid.height+units.gu(4)
7
 
 
8
 
    Grid {
9
 
        id: grid
10
 
        columns: 4
11
 
        anchors{
12
 
            top: parent.top
13
 
            topMargin: units.gu(2)
14
 
            horizontalCenter: parent.horizontalCenter
15
 
        }
16
 
        spacing: units.gu(2)
17
 
 
18
 
        KeyboardButton {
19
 
            text: "7"
20
 
            onClicked: formulaPush('7', '7')
21
 
        }
22
 
 
23
 
        KeyboardButton {
24
 
            text: "8"
25
 
            onClicked: formulaPush('8', '8')
26
 
        }
27
 
 
28
 
        KeyboardButton {
29
 
            text: "9"
30
 
            onClicked: formulaPush('9', '9')
31
 
        }
32
 
 
33
 
        KeyboardButton {
34
 
            text: "÷"
35
 
            onClicked: formulaPush('÷', '/')
36
 
        }
37
 
 
38
 
        KeyboardButton {
39
 
            text: "4"
40
 
            onClicked: formulaPush('4', '4')
41
 
        }
42
 
 
43
 
        KeyboardButton {
44
 
            text: "5"
45
 
            onClicked: formulaPush('5', '5')
46
 
        }
47
 
 
48
 
        KeyboardButton {
49
 
            text: "6"
50
 
            onClicked: formulaPush('6', '6')
51
 
        }
52
 
 
53
 
        KeyboardButton {
54
 
            text: "×"
55
 
            onClicked: formulaPush('×', '*')
56
 
        }
57
 
 
58
 
        KeyboardButton {
59
 
            text: "1"
60
 
            onClicked: formulaPush('1', '1')
61
 
        }
62
 
 
63
 
        KeyboardButton {
64
 
            text: "2"
65
 
            onClicked: formulaPush('2', '2')
66
 
        }
67
 
 
68
 
        KeyboardButton {
69
 
            text: "3"
70
 
            onClicked: formulaPush('3', '3')
71
 
        }
72
 
 
73
 
        KeyboardButton {
74
 
            text: "+"
75
 
            onClicked: formulaPush('+', '+')
76
 
        }
77
 
 
78
 
        KeyboardButton {
79
 
            text: "0"
80
 
            onClicked: formulaPush('0', '0')
81
 
        }
82
 
 
83
 
        KeyboardButton {
84
 
            text: "."
85
 
            onClicked: formulaPush('.', '.')
86
 
        }
87
 
 
88
 
        KeyboardButton {
89
 
            text: "C"
90
 
            onClicked: {
91
 
                formulaView.addCurrentToMemory();
92
 
                clear();
93
 
            }
94
 
        }
95
 
 
96
 
        KeyboardButton {
97
 
            text: "−"
98
 
            onClicked: formulaPush('−', '-')
99
 
        }
100
 
 
101
 
    }
102
 
}