mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-05 00:21:29 +00:00
704b26ff1e
- move the spinbox closer to the senter - improve sizing and spacing of the spinbox - hide it when we aren't showing the calculated ceiling Also address an odd whitespace issue. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
68 lines
2.2 KiB
QML
68 lines
2.2 KiB
QML
// SPDX-License-Identifier: GPL-2.0
|
|
import QtQuick 2.11
|
|
import QtQuick.Controls 2.4
|
|
import QtQuick.Layouts 1.11
|
|
import org.subsurfacedivelog.mobile 1.0
|
|
import org.kde.kirigami 2.4 as Kirigami
|
|
|
|
SpinBox {
|
|
id: control
|
|
editable: true
|
|
font.pointSize: subsurfaceTheme.regularPointSize
|
|
|
|
contentItem: TextInput {
|
|
z: 2
|
|
width: Kirigami.Units.gridUnit * 3
|
|
text: control.textFromValue(control.value, control.locale)
|
|
font: control.font
|
|
color: control.enabled ? subsurfaceTheme.textColor : subsurfaceTheme.disabledTextColor
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
readOnly: !control.editable
|
|
validator: control.validator
|
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
|
}
|
|
|
|
up.indicator: Rectangle {
|
|
x: control.mirrored ? 0 : parent.width - width
|
|
height: Kirigami.Units.gridUnit * 1.5
|
|
implicitWidth: Kirigami.Units.gridUnit
|
|
implicitHeight: Kirigami.Units.gridUnit
|
|
color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
|
border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
|
Text {
|
|
text: "+"
|
|
font.pixelSize: control.font.pixelSize * 1.5
|
|
color: control.enabled ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.disabledTextColor
|
|
anchors.fill: parent
|
|
fontSizeMode: Text.Fit
|
|
horizontalAlignment: Text.AlignHCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
}
|
|
}
|
|
|
|
down.indicator: Rectangle {
|
|
x: control.mirrored ? parent.width - width : 0
|
|
height: Kirigami.Units.gridUnit * 1.5
|
|
implicitWidth: Kirigami.Units.gridUnit
|
|
implicitHeight: Kirigami.Units.gridUnit
|
|
color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
|
border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
|
|
Text {
|
|
text: "-"
|
|
font.pixelSize: control.font.pixelSize * 1.5
|
|
color: control.enabled ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.disabledTextColor
|
|
anchors.fill: parent
|
|
fontSizeMode: Text.Fit
|
|
horizontalAlignment: Text.AlignHCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
}
|
|
}
|
|
|
|
background: Rectangle {
|
|
implicitWidth: 5* Kirigami.Units.gridUnit
|
|
color: subsurfaceTheme.backgroundColor
|
|
border.color: subsurfaceTheme.backgroundColor
|
|
}
|
|
}
|