mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Use Cura.TextField in the spinbox component
CURA-8688
This commit is contained in:
parent
8dde0f4fd2
commit
7ebc5eaac4
1 changed files with 3 additions and 7 deletions
|
|
@ -5,6 +5,7 @@ import QtQuick 2.2
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
|
|
||||||
import UM 1.5 as UM
|
import UM 1.5 as UM
|
||||||
|
import Cura 1.5 as Cura
|
||||||
|
|
||||||
// This component extends the funtionality of QtControls 2.x Spinboxes to
|
// This component extends the funtionality of QtControls 2.x Spinboxes to
|
||||||
// - be able to contain fractional values
|
// - be able to contain fractional values
|
||||||
|
|
@ -73,19 +74,14 @@ Item
|
||||||
|
|
||||||
background: Item {}
|
background: Item {}
|
||||||
|
|
||||||
//TextField should be swapped with UM.TextField when it is restyled
|
contentItem: Cura.TextField
|
||||||
contentItem: TextField
|
|
||||||
{
|
{
|
||||||
text: spinBox.textFromValue(spinBox.value, spinBox.locale)
|
text: spinBox.textFromValue(spinBox.value, spinBox.locale)
|
||||||
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
|
|
||||||
background: UM.UnderlineBackground {}
|
|
||||||
|
|
||||||
selectByMouse: base.editable
|
|
||||||
validator: base.validator
|
validator: base.validator
|
||||||
|
|
||||||
onActiveFocusChanged:
|
onActiveFocusChanged:
|
||||||
{
|
{
|
||||||
if(!activeFocus)
|
if (!activeFocus)
|
||||||
{
|
{
|
||||||
base.editingFinished();
|
base.editingFinished();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue