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
|
||||
{
|
||||
width: UM.Theme.sizes.button.width
|
||||
height: UM.Theme.sizes.slider_layerview_size.height
|
||||
width: UM.Theme.getSize("button").width
|
||||
height: UM.Theme.getSize("slider_layerview_size").height
|
||||
|
||||
Slider
|
||||
{
|
||||
id: slider
|
||||
width: UM.Theme.sizes.slider_layerview_size.width
|
||||
height: UM.Theme.sizes.slider_layerview_size.height
|
||||
width: UM.Theme.getSize("slider_layerview_size").width
|
||||
height: UM.Theme.getSize("slider_layerview_size").height
|
||||
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
|
||||
minimumValue: 0;
|
||||
maximumValue: UM.LayerView.numLayers;
|
||||
|
@ -34,11 +34,11 @@ Item
|
|||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
z: slider.z - 1
|
||||
width: UM.Theme.sizes.slider_layerview_background.width
|
||||
height: slider.height + UM.Theme.sizes.default_margin.height * 2
|
||||
color: UM.Theme.colors.tool_panel_background;
|
||||
border.width: UM.Theme.sizes.default_lining.width
|
||||
border.color: UM.Theme.colors.lining
|
||||
width: UM.Theme.getSize("slider_layerview_background").width
|
||||
height: slider.height + UM.Theme.getSize("default_margin").height * 2
|
||||
color: UM.Theme.getColor("tool_panel_background");
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
|
||||
MouseArea {
|
||||
id: sliderMouseArea
|
||||
|
|
|
@ -22,13 +22,13 @@ Item {
|
|||
anchors.top: parent.top;
|
||||
anchors.left: parent.left;
|
||||
|
||||
spacing: UM.Theme.sizes.default_margin.height;
|
||||
spacing: UM.Theme.getSize("default_margin").height;
|
||||
|
||||
UM.SettingItem {
|
||||
id: profileSelection
|
||||
|
||||
width: UM.Theme.sizes.setting.width;
|
||||
height: UM.Theme.sizes.setting.height;
|
||||
width: UM.Theme.getSize("setting").width;
|
||||
height: UM.Theme.getSize("setting").height;
|
||||
|
||||
name: catalog.i18nc("@label", "Object profile")
|
||||
type: "enum"
|
||||
|
@ -48,8 +48,8 @@ Item {
|
|||
|
||||
Column {
|
||||
id: customisedSettings
|
||||
spacing: UM.Theme.sizes.default_lining.height;
|
||||
width: UM.Theme.sizes.setting.width + UM.Theme.sizes.setting.height/2;
|
||||
spacing: UM.Theme.getSize("default_lining").height;
|
||||
width: UM.Theme.getSize("setting").width + UM.Theme.getSize("setting").height/2;
|
||||
|
||||
Repeater {
|
||||
id: settings;
|
||||
|
@ -57,8 +57,8 @@ Item {
|
|||
model: UM.ActiveTool.properties.getValue("Model").getItem(base.currentIndex).settings
|
||||
|
||||
UM.SettingItem {
|
||||
width: UM.Theme.sizes.setting.width;
|
||||
height: UM.Theme.sizes.setting.height;
|
||||
width: UM.Theme.getSize("setting").width;
|
||||
height: UM.Theme.getSize("setting").height;
|
||||
|
||||
name: model.label;
|
||||
type: model.type;
|
||||
|
@ -80,8 +80,8 @@ Item {
|
|||
{
|
||||
anchors.left: parent.right;
|
||||
|
||||
width: UM.Theme.sizes.setting.height;
|
||||
height: UM.Theme.sizes.setting.height;
|
||||
width: UM.Theme.getSize("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)
|
||||
|
||||
|
@ -98,8 +98,8 @@ Item {
|
|||
height: parent.height/2
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.hovered ? UM.Theme.colors.setting_control_button_hover : UM.Theme.colors.setting_control_button
|
||||
source: UM.Theme.icons.cross1
|
||||
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
|
||||
source: UM.Theme.getIcon("cross1")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ Item {
|
|||
{
|
||||
id: customise_settings_button;
|
||||
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
|
||||
|
||||
text: catalog.i18nc("@action:button", "Add Setting");
|
||||
|
@ -123,16 +123,16 @@ Item {
|
|||
{
|
||||
width: control.width;
|
||||
height: control.height;
|
||||
border.width: UM.Theme.sizes.default_lining.width;
|
||||
border.color: control.pressed ? UM.Theme.colors.action_button_active_border :
|
||||
control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border
|
||||
color: control.pressed ? UM.Theme.colors.action_button_active :
|
||||
control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button
|
||||
border.width: UM.Theme.getSize("default_lining").width;
|
||||
border.color: control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||
color: control.pressed ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
}
|
||||
label: Label
|
||||
{
|
||||
text: control.text;
|
||||
color: UM.Theme.colors.setting_control_text;
|
||||
color: UM.Theme.getColor("setting_control_text");
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ Item {
|
|||
}
|
||||
|
||||
Column {
|
||||
width: view.width - UM.Theme.sizes.default_margin.width * 2;
|
||||
width: view.width - UM.Theme.getSize("default_margin").width * 2;
|
||||
height: childrenRect.height;
|
||||
|
||||
Repeater {
|
||||
|
@ -212,11 +212,11 @@ Item {
|
|||
}
|
||||
label: Row
|
||||
{
|
||||
spacing: UM.Theme.sizes.default_margin.width;
|
||||
spacing: UM.Theme.getSize("default_margin").width;
|
||||
Image
|
||||
{
|
||||
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
|
||||
{
|
||||
|
@ -260,7 +260,7 @@ Item {
|
|||
|
||||
delegate: ToolButton {
|
||||
id: button;
|
||||
x: model.depth * UM.Theme.sizes.default_margin.width;
|
||||
x: model.depth * UM.Theme.getSize("default_margin").width;
|
||||
text: model.name;
|
||||
tooltip: model.description;
|
||||
visible: !model.global_only
|
||||
|
|
|
@ -21,7 +21,7 @@ UM.Dialog
|
|||
anchors.fill: parent;
|
||||
Row
|
||||
{
|
||||
spacing: UM.Theme.sizes.default_margin.width;
|
||||
spacing: UM.Theme.getSize("default_margin").width;
|
||||
Text
|
||||
{
|
||||
//: USB Printing dialog label, %1 is head temperature
|
||||
|
|
|
@ -24,7 +24,7 @@ UM.Dialog
|
|||
width: parent.width * 0.75
|
||||
height: width * (1/4.25)
|
||||
|
||||
source: UM.Theme.images.logo
|
||||
source: UM.Theme.getImage("logo")
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
|
|
|
@ -400,7 +400,7 @@ UM.MainWindow
|
|||
bottomMargin: UM.Theme.getSize("default_margin").height;
|
||||
}
|
||||
|
||||
source: UM.Theme.images.logo;
|
||||
source: UM.Theme.getImage("logo");
|
||||
width: UM.Theme.getSize("logo").width;
|
||||
height: UM.Theme.getSize("logo").height;
|
||||
z: -1;
|
||||
|
|
|
@ -161,30 +161,30 @@ Item
|
|||
Rectangle {
|
||||
id: materialSelectionRow
|
||||
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
|
||||
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
|
||||
|
||||
Label{
|
||||
id: materialSelectionLabel
|
||||
text: catalog.i18nc("@label","Material:");
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width;
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width/100*45
|
||||
font: UM.Theme.fonts.default;
|
||||
color: UM.Theme.colors.text;
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("text");
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: materialSelection
|
||||
text: UM.MachineManager.activeMaterial
|
||||
width: parent.width/100*55
|
||||
height: UM.Theme.sizes.setting_control.height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
tooltip: UM.MachineManager.activeMaterial;
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.sizes.default_margin.width
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
style: UM.Theme.styles.sidebar_header_button
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue