mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-22 10:21:39 -07:00
Merge branch 'replace_controls_1_for_controls_2' into CURA-8687_dialogs
# Conflicts: # resources/qml/Account/SyncState.qml # resources/qml/Preferences/ReadOnlySpinBox.qml
This commit is contained in:
commit
1c711129e2
9 changed files with 132 additions and 121 deletions
|
|
@ -1,53 +0,0 @@
|
|||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
|
||||
Item
|
||||
{
|
||||
id: base
|
||||
|
||||
property alias value: spinBox.value
|
||||
property alias minimumValue: spinBox.minimumValue
|
||||
property alias maximumValue: spinBox.maximumValue
|
||||
property alias stepSize: spinBox.stepSize
|
||||
property alias prefix: spinBox.prefix
|
||||
property alias suffix: spinBox.suffix
|
||||
property alias decimals: spinBox.decimals
|
||||
|
||||
signal editingFinished();
|
||||
|
||||
property bool readOnly: false
|
||||
|
||||
width: spinBox.width
|
||||
height: spinBox.height
|
||||
|
||||
SpinBox
|
||||
{
|
||||
id: spinBox
|
||||
|
||||
enabled: !base.readOnly
|
||||
opacity: base.readOnly ? 0.5 : 1.0
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
onEditingFinished: base.editingFinished()
|
||||
Keys.onEnterPressed: spinBox.focus = false
|
||||
Keys.onReturnPressed: spinBox.focus = false
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
visible: base.readOnly
|
||||
text: base.prefix + base.value.toFixed(spinBox.decimals) + base.suffix
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: spinBox.__style ? spinBox.__style.padding.left : 0
|
||||
|
||||
color: palette.buttonText
|
||||
}
|
||||
|
||||
SystemPalette { id: palette }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue