mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Replace a bunch of Theme property accessors with getThing calls
This commit is contained in:
parent
d208885755
commit
e6ef4405c3
6 changed files with 42 additions and 42 deletions
|
@ -10,16 +10,16 @@ import UM 1.0 as UM
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
width: UM.Theme.sizes.button.width
|
width: UM.Theme.getSize("button").width
|
||||||
height: UM.Theme.sizes.slider_layerview_size.height
|
height: UM.Theme.getSize("slider_layerview_size").height
|
||||||
|
|
||||||
Slider
|
Slider
|
||||||
{
|
{
|
||||||
id: slider
|
id: slider
|
||||||
width: UM.Theme.sizes.slider_layerview_size.width
|
width: UM.Theme.getSize("slider_layerview_size").width
|
||||||
height: UM.Theme.sizes.slider_layerview_size.height
|
height: UM.Theme.getSize("slider_layerview_size").height
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.sizes.slider_layerview_margin.width/2
|
anchors.leftMargin: UM.Theme.getSize("slider_layerview_margin").width/2
|
||||||
orientation: Qt.Vertical
|
orientation: Qt.Vertical
|
||||||
minimumValue: 0;
|
minimumValue: 0;
|
||||||
maximumValue: UM.LayerView.numLayers;
|
maximumValue: UM.LayerView.numLayers;
|
||||||
|
@ -34,11 +34,11 @@ Item
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
z: slider.z - 1
|
z: slider.z - 1
|
||||||
width: UM.Theme.sizes.slider_layerview_background.width
|
width: UM.Theme.getSize("slider_layerview_background").width
|
||||||
height: slider.height + UM.Theme.sizes.default_margin.height * 2
|
height: slider.height + UM.Theme.getSize("default_margin").height * 2
|
||||||
color: UM.Theme.colors.tool_panel_background;
|
color: UM.Theme.getColor("tool_panel_background");
|
||||||
border.width: UM.Theme.sizes.default_lining.width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: UM.Theme.colors.lining
|
border.color: UM.Theme.getColor("lining")
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: sliderMouseArea
|
id: sliderMouseArea
|
||||||
|
|
|
@ -22,13 +22,13 @@ Item {
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
|
|
||||||
spacing: UM.Theme.sizes.default_margin.height;
|
spacing: UM.Theme.getSize("default_margin").height;
|
||||||
|
|
||||||
UM.SettingItem {
|
UM.SettingItem {
|
||||||
id: profileSelection
|
id: profileSelection
|
||||||
|
|
||||||
width: UM.Theme.sizes.setting.width;
|
width: UM.Theme.getSize("setting").width;
|
||||||
height: UM.Theme.sizes.setting.height;
|
height: UM.Theme.getSize("setting").height;
|
||||||
|
|
||||||
name: catalog.i18nc("@label", "Object profile")
|
name: catalog.i18nc("@label", "Object profile")
|
||||||
type: "enum"
|
type: "enum"
|
||||||
|
@ -48,8 +48,8 @@ Item {
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: customisedSettings
|
id: customisedSettings
|
||||||
spacing: UM.Theme.sizes.default_lining.height;
|
spacing: UM.Theme.getSize("default_lining").height;
|
||||||
width: UM.Theme.sizes.setting.width + UM.Theme.sizes.setting.height/2;
|
width: UM.Theme.getSize("setting").width + UM.Theme.getSize("setting").height/2;
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: settings;
|
id: settings;
|
||||||
|
@ -57,8 +57,8 @@ Item {
|
||||||
model: UM.ActiveTool.properties.getValue("Model").getItem(base.currentIndex).settings
|
model: UM.ActiveTool.properties.getValue("Model").getItem(base.currentIndex).settings
|
||||||
|
|
||||||
UM.SettingItem {
|
UM.SettingItem {
|
||||||
width: UM.Theme.sizes.setting.width;
|
width: UM.Theme.getSize("setting").width;
|
||||||
height: UM.Theme.sizes.setting.height;
|
height: UM.Theme.getSize("setting").height;
|
||||||
|
|
||||||
name: model.label;
|
name: model.label;
|
||||||
type: model.type;
|
type: model.type;
|
||||||
|
@ -80,8 +80,8 @@ Item {
|
||||||
{
|
{
|
||||||
anchors.left: parent.right;
|
anchors.left: parent.right;
|
||||||
|
|
||||||
width: UM.Theme.sizes.setting.height;
|
width: UM.Theme.getSize("setting").height;
|
||||||
height: UM.Theme.sizes.setting.height;
|
height: UM.Theme.getSize("setting").height;
|
||||||
|
|
||||||
onClicked: UM.ActiveTool.properties.getValue("Model").removeSettingOverride(UM.ActiveTool.properties.getValue("Model").getItem(base.currentIndex).id, model.key)
|
onClicked: UM.ActiveTool.properties.getValue("Model").removeSettingOverride(UM.ActiveTool.properties.getValue("Model").getItem(base.currentIndex).id, model.key)
|
||||||
|
|
||||||
|
@ -98,8 +98,8 @@ Item {
|
||||||
height: parent.height/2
|
height: parent.height/2
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: width
|
sourceSize.height: width
|
||||||
color: control.hovered ? UM.Theme.colors.setting_control_button_hover : UM.Theme.colors.setting_control_button
|
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
|
||||||
source: UM.Theme.icons.cross1
|
source: UM.Theme.getIcon("cross1")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ Item {
|
||||||
{
|
{
|
||||||
id: customise_settings_button;
|
id: customise_settings_button;
|
||||||
anchors.right: profileSelection.right;
|
anchors.right: profileSelection.right;
|
||||||
height: UM.Theme.sizes.setting.height;
|
height: UM.Theme.getSize("setting").height;
|
||||||
visible: parseInt(UM.Preferences.getValue("cura/active_mode")) == 1
|
visible: parseInt(UM.Preferences.getValue("cura/active_mode")) == 1
|
||||||
|
|
||||||
text: catalog.i18nc("@action:button", "Add Setting");
|
text: catalog.i18nc("@action:button", "Add Setting");
|
||||||
|
@ -123,16 +123,16 @@ Item {
|
||||||
{
|
{
|
||||||
width: control.width;
|
width: control.width;
|
||||||
height: control.height;
|
height: control.height;
|
||||||
border.width: UM.Theme.sizes.default_lining.width;
|
border.width: UM.Theme.getSize("default_lining").width;
|
||||||
border.color: control.pressed ? UM.Theme.colors.action_button_active_border :
|
border.color: control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
||||||
control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border
|
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||||
color: control.pressed ? UM.Theme.colors.action_button_active :
|
color: control.pressed ? UM.Theme.getColor("action_button_active") :
|
||||||
control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button
|
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||||
}
|
}
|
||||||
label: Label
|
label: Label
|
||||||
{
|
{
|
||||||
text: control.text;
|
text: control.text;
|
||||||
color: UM.Theme.colors.setting_control_text;
|
color: UM.Theme.getColor("setting_control_text");
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
width: view.width - UM.Theme.sizes.default_margin.width * 2;
|
width: view.width - UM.Theme.getSize("default_margin").width * 2;
|
||||||
height: childrenRect.height;
|
height: childrenRect.height;
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
|
@ -212,11 +212,11 @@ Item {
|
||||||
}
|
}
|
||||||
label: Row
|
label: Row
|
||||||
{
|
{
|
||||||
spacing: UM.Theme.sizes.default_margin.width;
|
spacing: UM.Theme.getSize("default_margin").width;
|
||||||
Image
|
Image
|
||||||
{
|
{
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
source: control.checked ? UM.Theme.icons.arrow_right : UM.Theme.icons.arrow_bottom;
|
source: control.checked ? UM.Theme.getIcon("arrow_right") : UM.Theme.getIcon("arrow_bottom");
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
|
@ -260,7 +260,7 @@ Item {
|
||||||
|
|
||||||
delegate: ToolButton {
|
delegate: ToolButton {
|
||||||
id: button;
|
id: button;
|
||||||
x: model.depth * UM.Theme.sizes.default_margin.width;
|
x: model.depth * UM.Theme.getSize("default_margin").width;
|
||||||
text: model.name;
|
text: model.name;
|
||||||
tooltip: model.description;
|
tooltip: model.description;
|
||||||
visible: !model.global_only
|
visible: !model.global_only
|
||||||
|
|
|
@ -21,7 +21,7 @@ UM.Dialog
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
spacing: UM.Theme.sizes.default_margin.width;
|
spacing: UM.Theme.getSize("default_margin").width;
|
||||||
Text
|
Text
|
||||||
{
|
{
|
||||||
//: USB Printing dialog label, %1 is head temperature
|
//: USB Printing dialog label, %1 is head temperature
|
||||||
|
|
|
@ -24,7 +24,7 @@ UM.Dialog
|
||||||
width: parent.width * 0.75
|
width: parent.width * 0.75
|
||||||
height: width * (1/4.25)
|
height: width * (1/4.25)
|
||||||
|
|
||||||
source: UM.Theme.images.logo
|
source: UM.Theme.getImage("logo")
|
||||||
|
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: height
|
sourceSize.height: height
|
||||||
|
|
|
@ -400,7 +400,7 @@ UM.MainWindow
|
||||||
bottomMargin: UM.Theme.getSize("default_margin").height;
|
bottomMargin: UM.Theme.getSize("default_margin").height;
|
||||||
}
|
}
|
||||||
|
|
||||||
source: UM.Theme.images.logo;
|
source: UM.Theme.getImage("logo");
|
||||||
width: UM.Theme.getSize("logo").width;
|
width: UM.Theme.getSize("logo").width;
|
||||||
height: UM.Theme.getSize("logo").height;
|
height: UM.Theme.getSize("logo").height;
|
||||||
z: -1;
|
z: -1;
|
||||||
|
|
|
@ -161,30 +161,30 @@ Item
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: materialSelectionRow
|
id: materialSelectionRow
|
||||||
anchors.top: variantRow.bottom
|
anchors.top: variantRow.bottom
|
||||||
anchors.topMargin: UM.MachineManager.hasMaterials ? UM.Theme.sizes.default_margin.height : 0
|
anchors.topMargin: UM.MachineManager.hasMaterials ? UM.Theme.getSize("default_margin").height : 0
|
||||||
width: base.width
|
width: base.width
|
||||||
height: UM.MachineManager.hasMaterials ? UM.Theme.sizes.sidebar_setup.height : 0
|
height: UM.MachineManager.hasMaterials ? UM.Theme.getSize("sidebar_setup").height : 0
|
||||||
visible: UM.MachineManager.hasMaterials
|
visible: UM.MachineManager.hasMaterials
|
||||||
|
|
||||||
Label{
|
Label{
|
||||||
id: materialSelectionLabel
|
id: materialSelectionLabel
|
||||||
text: catalog.i18nc("@label","Material:");
|
text: catalog.i18nc("@label","Material:");
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width;
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
width: parent.width/100*45
|
width: parent.width/100*45
|
||||||
font: UM.Theme.fonts.default;
|
font: UM.Theme.getFont("default");
|
||||||
color: UM.Theme.colors.text;
|
color: UM.Theme.getColor("text");
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolButton {
|
ToolButton {
|
||||||
id: materialSelection
|
id: materialSelection
|
||||||
text: UM.MachineManager.activeMaterial
|
text: UM.MachineManager.activeMaterial
|
||||||
width: parent.width/100*55
|
width: parent.width/100*55
|
||||||
height: UM.Theme.sizes.setting_control.height
|
height: UM.Theme.getSize("setting_control").height
|
||||||
tooltip: UM.MachineManager.activeMaterial;
|
tooltip: UM.MachineManager.activeMaterial;
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: UM.Theme.sizes.default_margin.width
|
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
style: UM.Theme.styles.sidebar_header_button
|
style: UM.Theme.styles.sidebar_header_button
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue