mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Stop using SettingItemStyle
Since everything is now in Cura, using SettingItemStyle does not make a lot of sense anymore
This commit is contained in:
parent
4c9b9b68ef
commit
2abb9a47c1
3 changed files with 53 additions and 52 deletions
|
@ -46,19 +46,20 @@ SettingItem
|
||||||
{
|
{
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
{
|
{
|
||||||
return base.style.controlDisabledColor
|
return UM.Theme.getColor("setting_control_disabled")
|
||||||
}
|
}
|
||||||
if(base.containsMouse || base.activeFocus)
|
if(base.containsMouse || base.activeFocus)
|
||||||
{
|
{
|
||||||
return base.style.controlHighlightColor
|
return UM.Theme.getColor("setting_control_highlight")
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return base.style.controlColor
|
return UM.Theme.getColor("setting_control")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
border.width: base.style.controlBorderWidth;
|
|
||||||
border.color: !enabled ? base.style.controlDisabledBorderColor : control.containsMouse ? base.style.controlBorderHighlightColor : base.style.controlBorderColor;
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
|
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : control.containsMouse ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
||||||
|
|
||||||
UM.RecolorImage {
|
UM.RecolorImage {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
@ -67,9 +68,9 @@ SettingItem
|
||||||
height: parent.height/2.5
|
height: parent.height/2.5
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: width
|
sourceSize.height: width
|
||||||
color: !enabled ? base.style.controlDisabledTextColor : base.style.controlTextColor;
|
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");
|
||||||
source: UM.Theme.getIcon("check")
|
source: UM.Theme.getIcon("check")
|
||||||
opacity: control.checked
|
opacity: control.checked ? 1 : 0
|
||||||
Behavior on opacity { NumberAnimation { duration: 100; } }
|
Behavior on opacity { NumberAnimation { duration: 100; } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,33 +33,33 @@ SettingItem
|
||||||
{
|
{
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
{
|
{
|
||||||
return base.style.controlDisabledColor
|
return UM.Theme.getColor("setting_control_disabled")
|
||||||
}
|
}
|
||||||
if(control.hovered || base.activeFocus)
|
if(control.hovered || base.activeFocus)
|
||||||
{
|
{
|
||||||
return base.style.controlHighlightColor
|
return UM.Theme.getColor("setting_control_highlight")
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return base.style.controlColor
|
return UM.Theme.getColor("setting_control")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
border.width: base.style.controlBorderWidth;
|
border.width: UM.Theme.getSize("default_lining").width;
|
||||||
border.color: !enabled ? base.style.controlDisabledBorderColor : control.hovered ? base.style.controlBorderHighlightColor : base.style.controlBorderColor;
|
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : control.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border");
|
||||||
}
|
}
|
||||||
label: Item
|
label: Item
|
||||||
{
|
{
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: base.style.controlBorderWidth
|
anchors.leftMargin: UM.Theme.getSize("default_lining").width
|
||||||
anchors.right: downArrow.left;
|
anchors.right: downArrow.left;
|
||||||
anchors.rightMargin: base.style.controlBorderWidth;
|
anchors.rightMargin: UM.Theme.getSize("default_lining").width;
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
|
||||||
text: control.currentText;
|
text: control.currentText;
|
||||||
font: base.style.controlFont;
|
font: UM.Theme.getFont("default");
|
||||||
color: !enabled ? base.style.controlDisabledTextColor : base.style.controlTextColor;
|
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");
|
||||||
|
|
||||||
elide: Text.ElideRight;
|
elide: Text.ElideRight;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
@ -69,7 +69,7 @@ SettingItem
|
||||||
{
|
{
|
||||||
id: downArrow
|
id: downArrow
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.rightMargin: base.style.controlBorderWidth * 2;
|
anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2;
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
|
||||||
source: UM.Theme.getIcon("arrow_bottom")
|
source: UM.Theme.getIcon("arrow_bottom")
|
||||||
|
@ -78,7 +78,7 @@ SettingItem
|
||||||
sourceSize.width: width + 5
|
sourceSize.width: width + 5
|
||||||
sourceSize.height: width + 5
|
sourceSize.height: width + 5
|
||||||
|
|
||||||
color: base.style.controlTextColor;
|
color: UM.Theme.getColor("setting_control_text");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,44 +18,44 @@ SettingItem
|
||||||
|
|
||||||
property alias hovered: mouseArea.containsMouse;
|
property alias hovered: mouseArea.containsMouse;
|
||||||
|
|
||||||
border.width: base.style.controlBorderWidth;
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: !enabled ? base.style.controlDisabledBorderColor : hovered ? base.style.controlBorderHighlightColor : base.style.controlBorderColor
|
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
||||||
|
|
||||||
property variant parentValue: value //From parent loader
|
property variant parentValue: value //From parent loader
|
||||||
function notifyReset() {
|
function notifyReset() {
|
||||||
input.text = format(parentValue)
|
input.text = format(parentValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
// color: {
|
color: {
|
||||||
// if (!enabled)
|
if (!enabled)
|
||||||
// {
|
{
|
||||||
// return base.style.controlDisabledColor
|
return UM.Theme.getColor("setting_control_disabled")
|
||||||
// }
|
}
|
||||||
// switch(definition.validationState) //From parent loader
|
switch(definition.validationState)
|
||||||
// {
|
{
|
||||||
// case 0:
|
case 0:
|
||||||
// return base.style.validationErrorColor;
|
return UM.Theme.getColor("setting_validation_error")
|
||||||
// case 1:
|
case 1:
|
||||||
// return base.style.validationErrorColor;
|
return UM.Theme.getColor("setting_validation_error")
|
||||||
// case 2:
|
case 2:
|
||||||
// return base.style.validationErrorColor;
|
return UM.Theme.getColor("setting_validation_error")
|
||||||
// case 3:
|
case 3:
|
||||||
// return base.style.validationWarningColor;
|
return UM.Theme.getColor("setting_validation_warning")
|
||||||
// case 4:
|
case 4:
|
||||||
// return base.style.validationWarningColor;
|
return UM.Theme.getColor("setting_validation_warning")
|
||||||
// case 5:
|
case 5:
|
||||||
// return base.style.validationOkColor;
|
return UM.Theme.getColor("setting_validation_ok")
|
||||||
//
|
|
||||||
// default:
|
default:
|
||||||
// return base.style.controlTextColor;
|
return UM.Theme.getColor("setting_control")
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
anchors.margins: base.style.controlBorderWidth;
|
anchors.margins: UM.Theme.getSize("default_lining").width;
|
||||||
color: base.style.controlHighlightColor;
|
color: UM.Theme.getColor("setting_control_highlight")
|
||||||
opacity: 0.35
|
opacity: 0.35
|
||||||
// opacity: !control.hovered ? 0 : valid == 5 ? 1.0 : 0.35;
|
// opacity: !control.hovered ? 0 : valid == 5 ? 1.0 : 0.35;
|
||||||
}
|
}
|
||||||
|
@ -63,12 +63,12 @@ SettingItem
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.rightMargin: base.style.unitRightMargin;
|
anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
|
||||||
text: definition.unit;
|
text: definition.unit;
|
||||||
color: base.style.unitColor
|
color: UM.Theme.getColor("setting_unit")
|
||||||
font: base.style.unitFont;
|
font: UM.Theme.getFont("default")
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea
|
MouseArea
|
||||||
|
@ -86,7 +86,7 @@ SettingItem
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: base.style.unitRightMargin
|
leftMargin: UM.Theme.unitRightMargin
|
||||||
right: parent.right
|
right: parent.right
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
@ -108,8 +108,8 @@ SettingItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
color: !enabled ? base.style.controlDisabledTextColor : base.style.controlTextColor;
|
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
|
||||||
font: base.style.controlFont;
|
font: UM.Theme.getFont("default");
|
||||||
|
|
||||||
selectByMouse: true;
|
selectByMouse: true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue