ConfigurePage: buttons ok

This commit is contained in:
Louis-Joseph Fournier 2016-01-11 11:15:11 +01:00
parent 16a8f49ff9
commit ec2e8ebd31

View file

@ -29,8 +29,11 @@ Dialog {
property QtObject tuner; property QtObject tuner;
property variant la_tab: [392, 400, 415, 430, 440, 442] property variant la_tab: [392, 400, 415, 430, 440, 442]
property int buttonHeight: Theme.fontSizeSmall * 1.2
Column { Column {
width: parent.width width: parent.width
spacing: Theme.paddingLarge
DialogHeader { DialogHeader {
id: header id: header
@ -40,36 +43,63 @@ Dialog {
title: qsTr("Configuration") title: qsTr("Configuration")
} }
TextField { Item {
id: la width: parent.width
text: Config.la height: Theme.fontSizeLarge * 3
label: qsTr("La") property int margin_x: buttonHeight / 2
width: Theme.fontSizeMedium * 5
TextField {
id: la
anchors.left: parent.left
anchors.leftMargin: parent.margin_x
text: Config.la
label: qsTr("La")
width: Theme.fontSizeMedium * 5
}
Button {
id: minus
width: buttonHeight * 2
height: buttonHeight
anchors.left: la.right
anchors.leftMargin: parent.margin_x
text: "-"
preferredWidth: Theme.buttonWidthSmall
onClicked: la.text = parseInt(la.text) - 1
}
Button {
width: buttonHeight * 2
height: buttonHeight
anchors.left: minus.right
anchors.leftMargin: parent.margin_x
text: "+"
preferredWidth: Theme.buttonWidthSmall
onClicked: la.text = parseInt(la.text) + 1
}
} }
/// predefined la(s) /// predefined la(s)
Row { Item {
id: pre_la_parent id: pre_la_parent
width: parent.width width: parent.width
height: Theme.fontSizeSmall * 3;
property double case_l: width / la_tab.length
property double case_margin: case_l / 8;
property double case_width: case_l - case_margin * 2
Repeater { Repeater {
model: la_tab.length model: la_tab.length
Rectangle { Button {
width: pre_la_parent.width / la_tab.length text: configurePage.la_tab[index]
border.color: Theme.primaryColor width: pre_la_parent.case_width
border.width: 1 height: buttonHeight
color: la.text == configurePage.la_tab[parent.index] ? Theme.highlightColor : "transparent" preferredWidth: Theme.buttonWidthSmall
x: index * pre_la_parent.case_l + pre_la_parent.case_margin
Text { y: 0
id: la_freq down: la.text == configurePage.la_tab[index]
font.pixelSize: Theme.fontSizeSmall onClicked: la.text = text
text: configurePage.la_tab[parent.parent.index]
}
MouseArea {
anchors.fill: parent
onClicked: la.text = la_freq.text
}
} }
} }
} }