Merge remote-tracking branch 'origin/CURA-8688_qt6_cleanup' into CURA-8688_qt6_cleanup

This commit is contained in:
casper 2022-02-28 11:50:08 +01:00
commit 7f859651dd
9 changed files with 63 additions and 78 deletions

View File

@ -28,8 +28,8 @@ Button {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
height: (label.height / 2) | 0 height: (label.height / 2) | 0
width: height width: height
source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight")
color: base.hovered ? palette.highlight : palette.buttonText color: base.hovered ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("primary_button_text")
} }
} }
UM.RecolorImage UM.RecolorImage
@ -38,22 +38,20 @@ Button {
height: label.height height: label.height
width: height width: height
source: UM.Theme.getIcon(definition.icon) source: UM.Theme.getIcon(definition.icon)
color: base.hovered ? palette.highlight : palette.buttonText color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button_text")
} }
UM.Label UM.Label
{ {
id: label id: label
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: base.text text: base.text
color: base.hovered ? palette.highlight : palette.buttonText color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button_text")
font.bold: true font.bold: true
} }
SystemPalette { id: palette }
} }
signal showTooltip(string text); signal showTooltip(string text)
signal hideTooltip(); signal hideTooltip()
signal contextMenuRequested() signal contextMenuRequested()
text: definition.label text: definition.label

View File

@ -71,7 +71,6 @@ Item
property alias configureSettingVisibility: configureSettingVisibilityAction property alias configureSettingVisibility: configureSettingVisibilityAction
property alias browsePackages: browsePackagesAction property alias browsePackages: browsePackagesAction
property alias openMarketplace: openMarketplaceAction
UM.I18nCatalog{id: catalog; name: "cura"} UM.I18nCatalog{id: catalog; name: "cura"}
@ -483,11 +482,4 @@ Item
text: "&Marketplace" text: "&Marketplace"
icon.name: "plugins_browse" icon.name: "plugins_browse"
} }
Action
{
id: openMarketplaceAction
text: catalog.i18nc("@action:menu", "&Marketplace")
icon.name: "plugins_browse"
}
} }

View File

@ -76,7 +76,7 @@ UM.Dialog
anchors.fill: parent anchors.fill: parent
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Label UM.Label
{ {
id: questionText id: questionText
width: parent.width width: parent.width

View File

@ -45,11 +45,7 @@ UM.Dialog
visibilityHandler: UM.SettingPreferenceVisibilityHandler { } visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
} }
SystemPalette UM.Label
{
id: palette
}
Label
{ {
id: mainHeading id: mainHeading
width: parent.width width: parent.width
@ -86,7 +82,7 @@ UM.Dialog
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Column Column
{ {
Label UM.Label
{ {
id: settingsHeading id: settingsHeading
text: catalog.i18nc("@action:label", "Printer settings") text: catalog.i18nc("@action:label", "Printer settings")
@ -96,14 +92,14 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Type") text: catalog.i18nc("@action:label", "Type")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name text: Cura.MachineManager.activeMachine == null ? "" : Cura.MachineManager.activeMachine.definition.name
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }
@ -111,12 +107,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name") text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: text:
{ {
@ -155,7 +151,7 @@ UM.Dialog
var material_name = extruder.material.name var material_name = extruder.material.name
return (material_name !== undefined) ? material_name : "" return (material_name !== undefined) ? material_name : ""
} }
Label UM.Label
{ {
text: { text: {
var extruder = Number(modelData.position) var extruder = Number(modelData.position)
@ -179,7 +175,7 @@ UM.Dialog
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: text:
{ {
@ -192,7 +188,7 @@ UM.Dialog
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
enabled: modelData.isEnabled enabled: modelData.isEnabled
} }
Label UM.Label
{ {
text: text:
{ {
@ -212,7 +208,7 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Profile settings") text: catalog.i18nc("@action:label", "Profile settings")
font.bold: true font.bold: true
@ -220,12 +216,12 @@ UM.Dialog
Row Row
{ {
width: parent.width width: parent.width
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Not in profile") text: catalog.i18nc("@action:label", "Not in profile")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings) text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
@ -236,12 +232,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Name") text: catalog.i18nc("@action:label", "Name")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: Cura.MachineManager.activeQualityOrQualityChangesName text: Cura.MachineManager.activeQualityOrQualityChangesName
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
@ -253,12 +249,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Intent") text: catalog.i18nc("@action:label", "Intent")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: Cura.MachineManager.activeIntentCategory text: Cura.MachineManager.activeIntentCategory
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
@ -273,7 +269,7 @@ UM.Dialog
leftButtons: leftButtons:
[ [
CheckBox UM.CheckBox
{ {
id: dontShowAgainCheckbox id: dontShowAgainCheckbox
anchors.left: parent.left anchors.left: parent.left

View File

@ -92,7 +92,8 @@ Item
target: Cura.Actions.browsePackages target: Cura.Actions.browsePackages
function onTriggered() function onTriggered()
{ {
extensionMenu.extensionModel.callExtensionMethod("Toolbox", "launch") print("beepboop")
extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show")
} }
} }
@ -102,8 +103,8 @@ Item
target: Cura.Actions.marketplaceMaterials target: Cura.Actions.marketplaceMaterials
function onTriggered() function onTriggered()
{ {
extensionMenu.extensionModel.callExtensionMethod("Toolbox", "launch") extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show")
extensionMenu.extensionModel.callExtensionMethod("Toolbox", "setViewCategoryToMaterials") extensionMenu.extensionModel.callExtensionMethod("Marketplace", "setVisibleTabToMaterials")
} }
} }
} }

View File

@ -26,7 +26,6 @@ ComboBox
{ {
name: "disabled" name: "disabled"
when: !control.enabled when: !control.enabled
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_disabled_border")}
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")} PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")}
PropertyChanges { target: contentLabel; color: UM.Theme.getColor("setting_control_disabled_text")} PropertyChanges { target: contentLabel; color: UM.Theme.getColor("setting_control_disabled_text")}
}, },
@ -34,20 +33,13 @@ ComboBox
{ {
name: "highlighted" name: "highlighted"
when: control.hovered || control.activeFocus when: control.hovered || control.activeFocus
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_border_highlight") }
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_highlight")} PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_highlight")}
} }
] ]
background: Rectangle background: UM.UnderlineBackground
{ {
id: backgroundRectangle id: backgroundRectangle
color: UM.Theme.getColor("setting_control")
radius: UM.Theme.getSize("setting_control_radius").width
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("setting_control_border")
} }
indicator: UM.RecolorImage indicator: UM.RecolorImage

View File

@ -48,7 +48,6 @@ UM.MenuItem
y: UM.Theme.getSize("default_lining").width y: UM.Theme.getSize("default_lining").width
width: menuItem.width - 2 * UM.Theme.getSize("default_lining").width width: menuItem.width - 2 * UM.Theme.getSize("default_lining").width
height: menuItem.height - 2 * UM.Theme.getSize("default_lining").height height: menuItem.height - 2 * UM.Theme.getSize("default_lining").height
color: menuItem.highlighted ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1")
color: menuItem.highlighted ? UM.Theme.getColor("secondary"): UM.Theme.getColor("setting_control_highlight")
} }
} }

View File

@ -17,6 +17,31 @@ RadioButton
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
states: [
State {
name: "checked"
when: radioButton.checked
PropertyChanges
{
target: indicator
color: UM.Theme.getColor("accent_1")
border.width: 0
}
},
State
{
name: "disabled"
when: !radioButton.enabled
PropertyChanges { target: indicator; color: UM.Theme.getColor("background_1")}
},
State
{
name: "highlighted"
when: radioButton.hovered || radioButton.activeFocus
PropertyChanges { target: indicator; border.color: UM.Theme.getColor("accent_1")}
}
]
background: Item background: Item
{ {
anchors.fill: parent anchors.fill: parent
@ -29,8 +54,9 @@ RadioButton
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.alignWhenCentered: false anchors.alignWhenCentered: false
radius: width / 2 radius: width / 2
color: UM.Theme.getColor("background_2")
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover") border.color: UM.Theme.getColor("text_disabled")
Rectangle Rectangle
{ {
@ -38,7 +64,7 @@ RadioButton
height: width height: width
anchors.centerIn: parent anchors.centerIn: parent
radius: width / 2 radius: width / 2
color: radioButton.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button") color: radioButton.enabled ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
visible: radioButton.checked visible: radioButton.checked
} }
} }

View File

@ -4,7 +4,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -17,6 +17,8 @@ TextField
property alias leftIcon: iconLeft.source property alias leftIcon: iconLeft.source
height: UM.Theme.getSize("setting_control").height
hoverEnabled: true hoverEnabled: true
selectByMouse: true selectByMouse: true
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
@ -29,45 +31,24 @@ TextField
{ {
name: "disabled" name: "disabled"
when: !textField.enabled when: !textField.enabled
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_disabled_border")}
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")} PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")}
}, },
State State
{ {
name: "invalid" name: "invalid"
when: !textField.acceptableInput when: !textField.acceptableInput
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_validation_error")}
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_validation_error_background")} PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_validation_error_background")}
}, },
State State
{ {
name: "hovered" name: "hovered"
when: textField.hovered || textField.activeFocus when: textField.hovered || textField.activeFocus
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_border_highlight") }
} }
] ]
background: Rectangle background: UM.UnderlineBackground
{ {
id: backgroundRectangle id: backgroundRectangle
color: UM.Theme.getColor("main_background")
radius: UM.Theme.getSize("setting_control_radius").width
border.color:
{
if (!textField.enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (textField.hovered || textField.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
//Optional icon added on the left hand side. //Optional icon added on the left hand side.
UM.RecolorImage UM.RecolorImage
{ {