mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/UI: correctly theme template spin box
This was all hard coded and wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4798382e70
commit
58d97c571d
1 changed files with 16 additions and 17 deletions
|
@ -2,6 +2,8 @@
|
||||||
import QtQuick 2.11
|
import QtQuick 2.11
|
||||||
import QtQuick.Controls 2.4
|
import QtQuick.Controls 2.4
|
||||||
import QtQuick.Layouts 1.11
|
import QtQuick.Layouts 1.11
|
||||||
|
import org.subsurfacedivelog.mobile 1.0
|
||||||
|
import org.kde.kirigami 2.4 as Kirigami
|
||||||
|
|
||||||
SpinBox {
|
SpinBox {
|
||||||
id: control
|
id: control
|
||||||
|
@ -11,9 +13,8 @@ SpinBox {
|
||||||
contentItem: TextInput {
|
contentItem: TextInput {
|
||||||
z: 2
|
z: 2
|
||||||
text: control.textFromValue(control.value, control.locale)
|
text: control.textFromValue(control.value, control.locale)
|
||||||
|
|
||||||
font: control.font
|
font: control.font
|
||||||
color: control.enabled ? "black" : "lightgrey"
|
color: control.enabled ? subsurfaceTheme.textColor : subsurfaceTheme.disabledTextColor
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
|
||||||
|
@ -24,16 +25,15 @@ SpinBox {
|
||||||
|
|
||||||
up.indicator: Rectangle {
|
up.indicator: Rectangle {
|
||||||
x: control.mirrored ? 0 : parent.width - width
|
x: control.mirrored ? 0 : parent.width - width
|
||||||
height: control.height
|
height: Kirigami.Units.gridUnit * 2
|
||||||
implicitWidth: 30
|
implicitWidth: Kirigami.Units.gridUnit * 1.5
|
||||||
implicitHeight: 30
|
implicitHeight: Kirigami.Units.gridUnit * 1.5
|
||||||
color: control.enabled ? "grey" : "lightgrey"
|
color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
||||||
border.color: control.enabled ? "grey" : "lightgrey"
|
border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "+"
|
text: "+"
|
||||||
font.pixelSize: control.font.pixelSize * 2
|
font.pixelSize: control.font.pixelSize * 2
|
||||||
color: control.enabled ? "black" : "lightgrey"
|
color: control.enabled ? subsurfaceTheme.textColor : subsurfaceTheme.disabledTextColor
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
fontSizeMode: Text.Fit
|
fontSizeMode: Text.Fit
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
@ -43,16 +43,15 @@ SpinBox {
|
||||||
|
|
||||||
down.indicator: Rectangle {
|
down.indicator: Rectangle {
|
||||||
x: control.mirrored ? parent.width - width : 0
|
x: control.mirrored ? parent.width - width : 0
|
||||||
height: control.height
|
height: Kirigami.Units.gridUnit * 2
|
||||||
implicitWidth: 30
|
implicitWidth: Kirigami.Units.gridUnit * 1.5
|
||||||
implicitHeight: 30
|
implicitHeight: Kirigami.Units.gridUnit * 1.5
|
||||||
color: control.enabled ? "grey" : "lightgrey"
|
color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
||||||
border.color: control.enabled ? "grey" : "lightgrey"
|
border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "-"
|
text: "-"
|
||||||
font.pixelSize: control.font.pixelSize * 2
|
font.pixelSize: control.font.pixelSize * 2
|
||||||
color: control.enabled ? "black" : "lightgrey"
|
color: control.enabled ? subsurfaceTheme.textColor : subsurfaceTheme.disabledTextColor
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
fontSizeMode: Text.Fit
|
fontSizeMode: Text.Fit
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
@ -61,7 +60,7 @@ SpinBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: 140
|
implicitWidth: 5* Kirigami.Units.gridUnit
|
||||||
color: subsurfaceTheme.backgroundColor
|
color: subsurfaceTheme.backgroundColor
|
||||||
border.color: subsurfaceTheme.backgroundColor
|
border.color: subsurfaceTheme.backgroundColor
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue