Skip to content

Latest commit

 

History

History
89 lines (77 loc) · 2.75 KB

LayoutWindow.qml

File metadata and controls

89 lines (77 loc) · 2.75 KB
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
Copyright 2011-2012 Heikki Holstila <heikki.holstila@gmail.com>
This file is part of FingerTerm.
FingerTerm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
FingerTerm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FingerTerm. If not, see <http://www.gnu.org/licenses/>.
*/
20
import QtQuick 2.0
26
27
28
29
Component {
id: listDelegate
Rectangle {
30
color: util.keyboardLayout === modelData ? "#909090" : "#404040"
32
height: selectButton.height+4*window.pixelRatio
33
34
border.width: 1
border.color: "#ffffff"
35
radius: window.radiusSmall
36
37
38
39
40
41
clip: true
Text {
text: modelData
color: "#ffffff"
anchors.verticalCenter: parent.verticalCenter
43
width: selectButton.x - x
44
font.pointSize: window.uiFontSize
45
46
47
48
49
50
51
elide: Text.ElideRight
}
Button {
id: selectButton
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: "Select"
52
53
width: 70*window.pixelRatio
anchors.rightMargin: window.paddingSmall
55
util.keyboardLayout = modelData
56
57
layoutWindow.show = false
util.notifyText(modelData)
58
59
60
61
62
63
64
65
66
67
68
}
}
}
}
Text {
id: titleText
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
color: "#ffffff"
text: "Keyboard layout"
69
font.pointSize: window.uiFontSize + 4*window.pixelRatio;
70
71
72
73
}
ListView {
anchors.fill: parent
74
anchors.topMargin: titleText.height + 4*window.pixelRatio
75
76
delegate: listDelegate
model: layoutWindow.layouts
77
78
spacing: window.paddingSmall
anchors.margins: window.paddingSmall
79
80
81
82
83
84
clip: true
}
Button {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
85
anchors.bottomMargin: window.paddingMedium
87
onClicked: layoutWindow.show = false