Merge pull request #638 from Ultimaker/performance_fixes

Performance fixes
This commit is contained in:
Ghostkeeper 2016-02-23 12:31:16 +01:00
commit 3e4f728281
25 changed files with 479 additions and 488 deletions

View file

@ -24,7 +24,7 @@ class ProcessSlicedObjectListJob(Job):
self._message = message self._message = message
self._scene = Application.getInstance().getController().getScene() self._scene = Application.getInstance().getController().getScene()
self._progress = None self._progress = None
self._abortRequested = False self._abort_requested = False
## Aborts the processing of layers. ## Aborts the processing of layers.
# #
@ -33,14 +33,14 @@ class ProcessSlicedObjectListJob(Job):
# requested and then stop processing by itself. There is no guarantee # requested and then stop processing by itself. There is no guarantee
# that the abort will stop the job any time soon or even at all. # that the abort will stop the job any time soon or even at all.
def abort(self): def abort(self):
self._abortRequested = True self._abort_requested = True
def run(self): def run(self):
if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView": if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView":
self._progress = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, -1) self._progress = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, -1)
self._progress.show() self._progress.show()
Job.yieldThread() Job.yieldThread()
if self._abortRequested: if self._abort_requested:
if self._progress: if self._progress:
self._progress.hide() self._progress.hide()
return return
@ -57,7 +57,7 @@ class ProcessSlicedObjectListJob(Job):
else: else:
object_id_map[id(node)] = node object_id_map[id(node)] = node
Job.yieldThread() Job.yieldThread()
if self._abortRequested: if self._abort_requested:
if self._progress: if self._progress:
self._progress.hide() self._progress.hide()
return return
@ -113,7 +113,7 @@ class ProcessSlicedObjectListJob(Job):
# TODO: Rebuild the layer data mesh once the layer has been processed. # TODO: Rebuild the layer data mesh once the layer has been processed.
# This needs some work in LayerData so we can add the new layers instead of recreating the entire mesh. # This needs some work in LayerData so we can add the new layers instead of recreating the entire mesh.
if self._abortRequested: if self._abort_requested:
if self._progress: if self._progress:
self._progress.hide() self._progress.hide()
return return
@ -123,7 +123,7 @@ class ProcessSlicedObjectListJob(Job):
# We are done processing all the layers we got from the engine, now create a mesh out of the data # We are done processing all the layers we got from the engine, now create a mesh out of the data
layer_data.build() layer_data.build()
if self._abortRequested: if self._abort_requested:
if self._progress: if self._progress:
self._progress.hide() self._progress.hide()
return return

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1221,7 +1221,7 @@
"buildplate": "Touching Buildplate", "buildplate": "Touching Buildplate",
"everywhere": "Everywhere" "everywhere": "Everywhere"
}, },
"default": "everywhere", "default": "buildplate",
"enabled": "support_enable" "enabled": "support_enable"
}, },
"support_angle": { "support_angle": {
@ -1231,7 +1231,7 @@
"type": "float", "type": "float",
"min_value": "0", "min_value": "0",
"max_value": "90", "max_value": "90",
"default": 60, "default": 50,
"visible": false, "visible": false,
"enabled": "support_enable" "enabled": "support_enable"
}, },

View file

@ -13,16 +13,6 @@
"overrides": { "overrides": {
"machine_nozzle_size": { "default": 0.25 }, "machine_nozzle_size": { "default": 0.25 },
"layer_height": { "default": 0.06 },
"layer_height_0": { "default": 0.15 },
"infill_sparse_density": { "default": 12 },
"speed_print": { "default": 30 },
"speed_wall": { "inherit_function": "parent_value / 30 * 20" },
"speed_wall_x": { "inherit_function": "speed_print / 30 * 25" },
"speed_topbottom": { "inherit_function": "parent_value / 30 * 20" },
"coasting_volume": { "default": 0.1 }, "coasting_volume": { "default": 0.1 },
"coasting_min_volume": { "default": 0.17 } "coasting_min_volume": { "default": 0.17 }
} }

View file

@ -12,9 +12,6 @@
"variant": "0.4 mm", "variant": "0.4 mm",
"overrides": { "overrides": {
"machine_nozzle_size": { "default": 0.40 }, "machine_nozzle_size": { "default": 0.40 }
"wall_line_width_0": { "inherit_function": "parent_value * 0.875" },
"skin_line_width": { "inherit_function": "parent_value * 0.875" }
} }
} }

View file

@ -13,18 +13,6 @@
"overrides": { "overrides": {
"machine_nozzle_size": { "default": 0.60 }, "machine_nozzle_size": { "default": 0.60 },
"layer_height": { "default": 0.15 },
"layer_height_0": { "default": 0.4 },
"shell_thickness": { "default": 1.8 },
"infill_sparse_density": { "default": 15 },
"speed_print": { "default": 55 },
"speed_wall": { "inherit_function": "parent_value / 55 * 25" },
"speed_wall_x": { "inherit_function": "speed_print / 55 * 40" },
"speed_topbottom": { "inherit_function": "parent_value / 55 * 20" },
"coasting_volume": { "default": 1.36 } "coasting_volume": { "default": 1.36 }
} }
} }

View file

@ -13,19 +13,6 @@
"overrides": { "overrides": {
"machine_nozzle_size": { "default": 0.80 }, "machine_nozzle_size": { "default": 0.80 },
"layer_height": { "default": 0.2 },
"layer_height_0": { "default": 0.5 },
"shell_thickness": { "default": 2.4 },
"top_bottom_thickness": { "inherit_function": "parent_value / 2" },
"infill_sparse_density": { "default": 16 },
"speed_print": { "default": 40 },
"speed_wall": { "inherit_function": "parent_value / 40 * 20" },
"speed_wall_x": { "inherit_function": "speed_print / 40 * 30" },
"speed_topbottom": { "inherit_function": "parent_value / 40 * 20" },
"coasting_volume": { "default": 3.22 } "coasting_volume": { "default": 3.22 }
} }
} }

View file

@ -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
@ -38,7 +38,7 @@ UM.Dialog
id: version id: version
text: "Cura %1".arg(UM.Application.version) text: "Cura %1".arg(UM.Application.version)
font: UM.Theme.fonts.large font: UM.Theme.getFont("large")
anchors.horizontalCenter : logo.horizontalCenter anchors.horizontalCenter : logo.horizontalCenter
anchors.horizontalCenterOffset : (logo.width * 0.25) anchors.horizontalCenterOffset : (logo.width * 0.25)
anchors.top: logo.bottom anchors.top: logo.bottom

View file

@ -337,8 +337,8 @@ UM.MainWindow
{ {
bottom: parent.bottom; bottom: parent.bottom;
right: sidebar.left; right: sidebar.left;
bottomMargin: UM.Theme.sizes.default_margin.height; bottomMargin: UM.Theme.getSize("default_margin").height;
rightMargin: UM.Theme.sizes.default_margin.width; rightMargin: UM.Theme.getSize("default_margin").width;
} }
} }
@ -347,7 +347,7 @@ UM.MainWindow
anchors anchors
{ {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
horizontalCenterOffset: -(UM.Theme.sizes.sidebar.width/ 2) horizontalCenterOffset: -(UM.Theme.getSize("sidebar").width/ 2)
top: parent.verticalCenter; top: parent.verticalCenter;
bottom: parent.bottom; bottom: parent.bottom;
} }
@ -361,10 +361,10 @@ UM.MainWindow
//anchors.right: parent.right; //anchors.right: parent.right;
//anchors.bottom: parent.bottom //anchors.bottom: parent.bottom
anchors.top: viewModeButton.bottom anchors.top: viewModeButton.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height; anchors.topMargin: UM.Theme.getSize("default_margin").height;
anchors.left: viewModeButton.left; anchors.left: viewModeButton.left;
//anchors.bottom: buttons.top; //anchors.bottom: buttons.top;
//anchors.bottomMargin: UM.Theme.sizes.default_margin.height; //anchors.bottomMargin: UM.Theme.getSize("default_margin").height;
height: childrenRect.height; height: childrenRect.height;
@ -376,15 +376,15 @@ UM.MainWindow
id: openFileButton; id: openFileButton;
//style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button; //style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
text: catalog.i18nc("@action:button","Open File"); text: catalog.i18nc("@action:button","Open File");
iconSource: UM.Theme.icons.load iconSource: UM.Theme.getIcon("load")
style: UM.Theme.styles.tool_button style: UM.Theme.styles.tool_button
tooltip: ''; tooltip: '';
anchors anchors
{ {
top: parent.top; top: parent.top;
//topMargin: UM.Theme.sizes.loadfile_margin.height //topMargin: UM.Theme.getSize("loadfile_margin").height
left: parent.left; left: parent.left;
//leftMargin: UM.Theme.sizes.loadfile_margin.width //leftMargin: UM.Theme.getSize("loadfile_margin").width
} }
action: actions.open; action: actions.open;
} }
@ -395,14 +395,14 @@ UM.MainWindow
anchors anchors
{ {
left: parent.left left: parent.left
leftMargin: UM.Theme.sizes.default_margin.width; leftMargin: UM.Theme.getSize("default_margin").width;
bottom: parent.bottom bottom: parent.bottom
bottomMargin: UM.Theme.sizes.default_margin.height; bottomMargin: UM.Theme.getSize("default_margin").height;
} }
source: UM.Theme.images.logo; source: UM.Theme.getImage("logo");
width: UM.Theme.sizes.logo.width; width: UM.Theme.getSize("logo").width;
height: UM.Theme.sizes.logo.height; height: UM.Theme.getSize("logo").height;
z: -1; z: -1;
sourceSize.width: width; sourceSize.width: width;
@ -416,11 +416,11 @@ UM.MainWindow
anchors anchors
{ {
top: toolbar.bottom; top: toolbar.bottom;
topMargin: UM.Theme.sizes.window_margin.height; topMargin: UM.Theme.getSize("window_margin").height;
left: parent.left; left: parent.left;
} }
text: catalog.i18nc("@action:button","View Mode"); text: catalog.i18nc("@action:button","View Mode");
iconSource: UM.Theme.icons.viewmode; iconSource: UM.Theme.getIcon("viewmode");
style: UM.Theme.styles.tool_button; style: UM.Theme.styles.tool_button;
tooltip: ''; tooltip: '';
@ -453,7 +453,7 @@ UM.MainWindow
anchors { anchors {
top: openFileButton.bottom; top: openFileButton.bottom;
topMargin: UM.Theme.sizes.window_margin.height; topMargin: UM.Theme.getSize("window_margin").height;
left: parent.left; left: parent.left;
} }
} }
@ -469,18 +469,28 @@ UM.MainWindow
right: parent.right; right: parent.right;
} }
width: UM.Theme.sizes.sidebar.width; width: UM.Theme.getSize("sidebar").width;
addMachineAction: actions.addMachine; addMachineAction: actions.addMachine;
configureMachinesAction: actions.configureMachines; configureMachinesAction: actions.configureMachines;
addProfileAction: actions.addProfile; addProfileAction: actions.addProfile;
manageProfilesAction: actions.manageProfiles; manageProfilesAction: actions.manageProfiles;
configureSettingsAction: Action
{
onTriggered:
{
preferences.visible = true;
preferences.setPage(2);
preferences.getCurrentItem().scrollToSection(source.key);
}
}
} }
Rectangle Rectangle
{ {
x: base.mouseX + UM.Theme.sizes.default_margin.width; x: base.mouseX + UM.Theme.getSize("default_margin").width;
y: base.mouseY + UM.Theme.sizes.default_margin.height; y: base.mouseY + UM.Theme.getSize("default_margin").height;
width: childrenRect.width; width: childrenRect.width;
height: childrenRect.height; height: childrenRect.height;
@ -502,25 +512,22 @@ UM.MainWindow
{ {
//; Remove & re-add the general page as we want to use our own instead of uranium standard. //; Remove & re-add the general page as we want to use our own instead of uranium standard.
removePage(0); removePage(0);
insertPage(0, catalog.i18nc("@title:tab","General"), generalPage); insertPage(0, catalog.i18nc("@title:tab","General"), Qt.resolvedUrl("GeneralPage.qml"));
//: View preferences page title //: View preferences page title
insertPage(1, catalog.i18nc("@title:tab","View"), viewPage); insertPage(1, catalog.i18nc("@title:tab","View"), Qt.resolvedUrl("ViewPage.qml"));
//Force refresh //Force refresh
setPage(0) setPage(0)
} }
Item { onVisibleChanged:
visible: false {
GeneralPage if(!visible)
{ {
id: generalPage // When the dialog closes, switch to the General page.
} // This prevents us from having a heavy page like Setting Visiblity active in the background.
setPage(0);
ViewPage
{
id: viewPage
} }
} }
} }
@ -593,7 +600,7 @@ UM.MainWindow
addMachine.onTriggered: addMachineWizard.visible = true; addMachine.onTriggered: addMachineWizard.visible = true;
addProfile.onTriggered: { UM.MachineManager.createProfile(); preferences.visible = true; preferences.setPage(4); } addProfile.onTriggered: { UM.MachineManager.createProfile(); preferences.visible = true; preferences.setPage(4); }
preferences.onTriggered: { preferences.visible = true; preferences.setPage(0); } preferences.onTriggered: { preferences.visible = true; }
configureMachines.onTriggered: { preferences.visible = true; preferences.setPage(3); } configureMachines.onTriggered: { preferences.visible = true; preferences.setPage(3); }
manageProfiles.onTriggered: { preferences.visible = true; preferences.setPage(4); } manageProfiles.onTriggered: { preferences.visible = true; preferences.setPage(4); }
@ -699,11 +706,6 @@ UM.MainWindow
} }
} }
Component.onCompleted:
{
UM.Theme.load(UM.Resources.getPath(UM.Resources.Themes, "cura"))
}
Timer Timer
{ {
id: startupTimer; id: startupTimer;

View file

@ -25,7 +25,7 @@ Rectangle {
property variant printDuration: PrintInformation.currentPrintTime; property variant printDuration: PrintInformation.currentPrintTime;
property real printMaterialAmount: PrintInformation.materialAmount; property real printMaterialAmount: PrintInformation.materialAmount;
width: UM.Theme.sizes.jobspecs.width width: UM.Theme.getSize("jobspecs").width
height: childrenRect.height height: childrenRect.height
color: "transparent" color: "transparent"
@ -80,7 +80,7 @@ Rectangle {
id: jobNameRow id: jobNameRow
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
height: UM.Theme.sizes.jobspecs_line.height height: UM.Theme.getSize("jobspecs_line").height
visible: base.activity visible: base.activity
Item Item
@ -93,8 +93,8 @@ Rectangle {
id: printJobPencilIcon id: printJobPencilIcon
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.sizes.save_button_specs_icons.width width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.sizes.save_button_specs_icons.height height: UM.Theme.getSize("save_button_specs_icons").height
onClicked: onClicked:
{ {
@ -108,12 +108,12 @@ Rectangle {
color: "transparent" color: "transparent"
UM.RecolorImage UM.RecolorImage
{ {
width: UM.Theme.sizes.save_button_specs_icons.width width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.sizes.save_button_specs_icons.height height: UM.Theme.getSize("save_button_specs_icons").height
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.text color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("text");
source: UM.Theme.icons.pencil; source: UM.Theme.getIcon("pencil");
} }
} }
} }
@ -123,8 +123,8 @@ Rectangle {
{ {
id: printJobTextfield id: printJobTextfield
anchors.right: printJobPencilIcon.left anchors.right: printJobPencilIcon.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width/2 anchors.rightMargin: UM.Theme.getSize("default_margin").width/2
height: UM.Theme.sizes.jobspecs_line.height height: UM.Theme.getSize("jobspecs_line").height
width: base.width width: base.width
property int unremovableSpacing: 5 property int unremovableSpacing: 5
text: '' text: ''
@ -144,8 +144,8 @@ Rectangle {
regExp: /^[^\\ \/ \.]*$/ regExp: /^[^\\ \/ \.]*$/
} }
style: TextFieldStyle{ style: TextFieldStyle{
textColor: UM.Theme.colors.setting_control_text; textColor: UM.Theme.getColor("setting_control_text");
font: UM.Theme.fonts.default_bold; font: UM.Theme.getFont("default_bold");
background: Rectangle { background: Rectangle {
opacity: 0 opacity: 0
border.width: 0 border.width: 0
@ -159,10 +159,10 @@ Rectangle {
id: boundingSpec id: boundingSpec
anchors.top: jobNameRow.bottom anchors.top: jobNameRow.bottom
anchors.right: parent.right anchors.right: parent.right
height: UM.Theme.sizes.jobspecs_line.height height: UM.Theme.getSize("jobspecs_line").height
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font: UM.Theme.fonts.small font: UM.Theme.getFont("small")
color: UM.Theme.colors.text_subtext color: UM.Theme.getColor("text_subtext")
text: Printer.getSceneBoundingBoxString text: Printer.getSceneBoundingBoxString
} }
@ -170,7 +170,7 @@ Rectangle {
id: specsRow id: specsRow
anchors.top: boundingSpec.bottom anchors.top: boundingSpec.bottom
anchors.right: parent.right anchors.right: parent.right
height: UM.Theme.sizes.jobspecs_line.height height: UM.Theme.getSize("jobspecs_line").height
Item{ Item{
width: parent.width width: parent.width
@ -179,42 +179,42 @@ Rectangle {
UM.RecolorImage { UM.RecolorImage {
id: timeIcon id: timeIcon
anchors.right: timeSpec.left anchors.right: timeSpec.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width/2 anchors.rightMargin: UM.Theme.getSize("default_margin").width/2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.sizes.save_button_specs_icons.width width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.sizes.save_button_specs_icons.height height: UM.Theme.getSize("save_button_specs_icons").height
sourceSize.width: width sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: UM.Theme.colors.text_subtext color: UM.Theme.getColor("text_subtext")
source: UM.Theme.icons.print_time; source: UM.Theme.getIcon("print_time");
} }
Label{ Label{
id: timeSpec id: timeSpec
anchors.right: lengthIcon.left anchors.right: lengthIcon.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.small font: UM.Theme.getFont("small")
color: UM.Theme.colors.text_subtext color: UM.Theme.getColor("text_subtext")
text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short) text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
} }
UM.RecolorImage { UM.RecolorImage {
id: lengthIcon id: lengthIcon
anchors.right: lengthSpec.left anchors.right: lengthSpec.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width/2 anchors.rightMargin: UM.Theme.getSize("default_margin").width/2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.sizes.save_button_specs_icons.width width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.sizes.save_button_specs_icons.height height: UM.Theme.getSize("save_button_specs_icons").height
sourceSize.width: width sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: UM.Theme.colors.text_subtext color: UM.Theme.getColor("text_subtext")
source: UM.Theme.icons.category_material; source: UM.Theme.getIcon("category_material");
} }
Label{ Label{
id: lengthSpec id: lengthSpec
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.small font: UM.Theme.getFont("small")
color: UM.Theme.colors.text_subtext color: UM.Theme.getColor("text_subtext")
text: base.printMaterialAmount <= 0 ? catalog.i18nc("@label", "0.0 m") : catalog.i18nc("@label", "%1 m").arg(base.printMaterialAmount) text: base.printMaterialAmount <= 0 ? catalog.i18nc("@label", "0.0 m") : catalog.i18nc("@label", "%1 m").arg(base.printMaterialAmount)
} }
} }

View file

@ -18,18 +18,18 @@ Item{
Rectangle{ Rectangle{
id: globalProfileRow id: globalProfileRow
anchors.top: base.top anchors.top: base.top
height: UM.Theme.sizes.sidebar_setup.height height: UM.Theme.getSize("sidebar_setup").height
width: base.width width: base.width
Label{ Label{
id: globalProfileLabel id: globalProfileLabel
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
text: catalog.i18nc("@label","Profile:"); text: catalog.i18nc("@label","Profile:");
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");
} }
@ -37,9 +37,9 @@ Item{
id: globalProfileSelection id: globalProfileSelection
text: UM.MachineManager.activeProfile text: UM.MachineManager.activeProfile
width: parent.width/100*55 width: parent.width/100*55
height: UM.Theme.sizes.setting_control.height height: UM.Theme.getSize("setting_control").height
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
tooltip: UM.MachineManager.activeProfile tooltip: UM.MachineManager.activeProfile
style: UM.Theme.styles.sidebar_header_button style: UM.Theme.styles.sidebar_header_button

View file

@ -16,7 +16,7 @@ Rectangle {
property int backendState: UM.Backend.state; property int backendState: UM.Backend.state;
property bool activity: Printer.getPlatformActivity; property bool activity: Printer.getPlatformActivity;
//Behavior on progress { NumberAnimation { duration: 250; } } //Behavior on progress { NumberAnimation { duration: 250; } }
property int totalHeight: childrenRect.height + UM.Theme.sizes.default_margin.height property int totalHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
property string fileBaseName property string fileBaseName
property string statusText: { property string statusText: {
if(base.backendState == 0) { if(base.backendState == 0) {
@ -34,32 +34,32 @@ Rectangle {
Label { Label {
id: statusLabel id: statusLabel
width: parent.width - 2 * UM.Theme.sizes.default_margin.width width: parent.width - 2 * UM.Theme.getSize("default_margin").width
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.getSize("default_margin").width
color: UM.Theme.colors.text color: UM.Theme.getColor("text")
font: UM.Theme.fonts.large font: UM.Theme.getFont("large")
text: statusText; text: statusText;
} }
Rectangle{ Rectangle{
id: progressBar id: progressBar
width: parent.width - 2 * UM.Theme.sizes.default_margin.width width: parent.width - 2 * UM.Theme.getSize("default_margin").width
height: UM.Theme.sizes.progressbar.height height: UM.Theme.getSize("progressbar").height
anchors.top: statusLabel.bottom anchors.top: statusLabel.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height/4 anchors.topMargin: UM.Theme.getSize("default_margin").height/4
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.getSize("default_margin").width
radius: UM.Theme.sizes.progressbar_radius.width radius: UM.Theme.getSize("progressbar_radius").width
color: UM.Theme.colors.progressbar_background color: UM.Theme.getColor("progressbar_background")
Rectangle{ Rectangle{
width: Math.max(parent.width * base.progress) width: Math.max(parent.width * base.progress)
height: parent.height height: parent.height
color: UM.Theme.colors.progressbar_control color: UM.Theme.getColor("progressbar_control")
radius: UM.Theme.sizes.progressbar_radius.width radius: UM.Theme.getSize("progressbar_radius").width
visible: base.backendState == 1 ? true : false visible: base.backendState == 1 ? true : false
} }
} }
@ -69,18 +69,19 @@ Rectangle {
width: base.width width: base.width
height: saveToButton.height height: saveToButton.height
anchors.top: progressBar.bottom anchors.top: progressBar.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left anchors.left: parent.left
Button { Button {
id: saveToButton id: saveToButton
property int resizedWidth
x: base.width - saveToButton.resizedWidth - UM.Theme.sizes.default_margin.width - UM.Theme.sizes.save_button_save_to_button.height + UM.Theme.sizes.save_button_save_to_button.width
tooltip: UM.OutputDeviceManager.activeDeviceDescription; tooltip: UM.OutputDeviceManager.activeDeviceDescription;
enabled: base.backendState == 2 && base.activity == true enabled: base.backendState == 2 && base.activity == true
height: UM.Theme.sizes.save_button_save_to_button.height height: UM.Theme.getSize("save_button_save_to_button").height
width: 150
anchors.top:parent.top anchors.top:parent.top
anchors.right: deviceSelectionMenu.left;
text: UM.OutputDeviceManager.activeDeviceShortDescription text: UM.OutputDeviceManager.activeDeviceShortDescription
onClicked: onClicked:
{ {
@ -88,29 +89,27 @@ Rectangle {
} }
style: ButtonStyle { style: ButtonStyle {
background: Rectangle { background:
//opacity: control.enabled ? 1.0 : 0.5 Rectangle
//Behavior on opacity { NumberAnimation { duration: 50; } } {
border.width: UM.Theme.sizes.default_lining.width border.width: UM.Theme.getSize("default_lining").width
border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border : border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
control.pressed ? UM.Theme.colors.action_button_active_border : 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.enabled ? UM.Theme.colors.action_button_disabled : color: !control.enabled ? UM.Theme.getColor("action_button_disabled") :
control.pressed ? UM.Theme.colors.action_button_active : 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")
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
width: {
saveToButton.resizedWidth = actualLabel.width + (UM.Theme.sizes.default_margin.width * 2) implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
return saveToButton.resizedWidth
}
Label { Label {
id: actualLabel id: actualLabel
//Behavior on opacity { NumberAnimation { duration: 50; } }
anchors.centerIn: parent anchors.centerIn: parent
color: !control.enabled ? UM.Theme.colors.action_button_disabled_text : color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
control.pressed ? UM.Theme.colors.action_button_active_text : control.pressed ? UM.Theme.getColor("action_button_active_text") :
control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text")
font: UM.Theme.fonts.action_button font: UM.Theme.getFont("action_button")
text: control.text; text: control.text;
} }
} }
@ -123,39 +122,41 @@ Rectangle {
tooltip: catalog.i18nc("@info:tooltip","Select the active output device"); tooltip: catalog.i18nc("@info:tooltip","Select the active output device");
anchors.top:parent.top anchors.top:parent.top
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
width: UM.Theme.sizes.save_button_save_to_button.height anchors.rightMargin: UM.Theme.getSize("default_margin").width
height: UM.Theme.sizes.save_button_save_to_button.height width: UM.Theme.getSize("save_button_save_to_button").height
height: UM.Theme.getSize("save_button_save_to_button").height
enabled: base.backendState == 2 && base.activity == true enabled: base.backendState == 2 && base.activity == true
//iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName]; //iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName];
style: ButtonStyle { style: ButtonStyle {
background: Rectangle { background: Rectangle {
id: deviceSelectionIcon id: deviceSelectionIcon
border.width: UM.Theme.sizes.default_lining.width border.width: UM.Theme.getSize("default_lining").width
border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border : border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
control.pressed ? UM.Theme.colors.action_button_active_border : 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.enabled ? UM.Theme.colors.action_button_disabled : color: !control.enabled ? UM.Theme.getColor("action_button_disabled") :
control.pressed ? UM.Theme.colors.action_button_active : 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")
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.save_button_text_margin.width / 2; anchors.leftMargin: UM.Theme.getSize("save_button_text_margin").width / 2;
width: parent.height width: parent.height
height: parent.height height: parent.height
UM.RecolorImage { UM.RecolorImage {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: UM.Theme.sizes.standard_arrow.width width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.sizes.standard_arrow.height height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
color: !control.enabled ? UM.Theme.colors.action_button_disabled_text : color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
control.pressed ? UM.Theme.colors.action_button_active_text : control.pressed ? UM.Theme.getColor("action_button_active_text") :
control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text; control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text");
source: UM.Theme.icons.arrow_bottom; source: UM.Theme.getIcon("arrow_bottom");
} }
} }
label: Label{ } label: Label{ }

View file

@ -16,9 +16,10 @@ Rectangle
property Action configureMachinesAction; property Action configureMachinesAction;
property Action addProfileAction; property Action addProfileAction;
property Action manageProfilesAction; property Action manageProfilesAction;
property Action configureSettingsAction;
property int currentModeIndex; property int currentModeIndex;
color: UM.Theme.colors.sidebar; color: UM.Theme.getColor("sidebar");
UM.I18nCatalog { id: catalog; name:"cura"} UM.I18nCatalog { id: catalog; name:"cura"}
function showTooltip(item, position, text) function showTooltip(item, position, text)
@ -56,10 +57,10 @@ Rectangle
Rectangle { Rectangle {
id: headerSeparator id: headerSeparator
width: parent.width width: parent.width
height: UM.Theme.sizes.sidebar_lining.height height: UM.Theme.getSize("sidebar_lining").height
color: UM.Theme.colors.sidebar_lining color: UM.Theme.getColor("sidebar_lining")
anchors.top: header.bottom anchors.top: header.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
} }
ProfileSetup { ProfileSetup {
@ -67,7 +68,7 @@ Rectangle
addProfileAction: base.addProfileAction addProfileAction: base.addProfileAction
manageProfilesAction: base.manageProfilesAction manageProfilesAction: base.manageProfilesAction
anchors.top: settingsModeSelection.bottom anchors.top: settingsModeSelection.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width width: parent.width
height: totalHeightProfileSetup height: totalHeightProfileSetup
} }
@ -94,22 +95,22 @@ Rectangle
id: settingsModeLabel id: settingsModeLabel
text: catalog.i18nc("@label:listbox","Setup"); text: catalog.i18nc("@label:listbox","Setup");
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.top: headerSeparator.bottom anchors.top: headerSeparator.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width/100*45 width: parent.width/100*45
font: UM.Theme.fonts.large; font: UM.Theme.getFont("large");
color: UM.Theme.colors.text color: UM.Theme.getColor("text")
} }
Rectangle { Rectangle {
id: settingsModeSelection id: settingsModeSelection
width: parent.width/100*55 width: parent.width/100*55
height: UM.Theme.sizes.sidebar_header_mode_toggle.height height: UM.Theme.getSize("sidebar_header_mode_toggle").height
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.top: headerSeparator.bottom anchors.top: headerSeparator.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
Component{ Component{
id: wizardDelegate id: wizardDelegate
Button { Button {
@ -126,20 +127,20 @@ Rectangle
style: ButtonStyle { style: ButtonStyle {
background: Rectangle { background: Rectangle {
border.width: UM.Theme.sizes.default_lining.width border.width: UM.Theme.getSize("default_lining").width
border.color: control.checked ? UM.Theme.colors.toggle_checked_border : border.color: control.checked ? UM.Theme.getColor("toggle_checked_border") :
control.pressed ? UM.Theme.colors.toggle_active_border : control.pressed ? UM.Theme.getColor("toggle_active_border") :
control.hovered ? UM.Theme.colors.toggle_hovered_border : UM.Theme.colors.toggle_unchecked_border control.hovered ? UM.Theme.getColor("toggle_hovered_border") : UM.Theme.getColor("toggle_unchecked_border")
color: control.checked ? UM.Theme.colors.toggle_checked : color: control.checked ? UM.Theme.getColor("toggle_checked") :
control.pressed ? UM.Theme.colors.toggle_active : control.pressed ? UM.Theme.getColor("toggle_active") :
control.hovered ? UM.Theme.colors.toggle_hovered : UM.Theme.colors.toggle_unchecked control.hovered ? UM.Theme.getColor("toggle_hovered") : UM.Theme.getColor("toggle_unchecked")
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
Label { Label {
anchors.centerIn: parent anchors.centerIn: parent
color: control.checked ? UM.Theme.colors.toggle_checked_text : color: control.checked ? UM.Theme.getColor("toggle_checked_text") :
control.pressed ? UM.Theme.colors.toggle_active_text : control.pressed ? UM.Theme.getColor("toggle_active_text") :
control.hovered ? UM.Theme.colors.toggle_hovered_text : UM.Theme.colors.toggle_unchecked_text control.hovered ? UM.Theme.getColor("toggle_hovered_text") : UM.Theme.getColor("toggle_unchecked_text")
font: UM.Theme.fonts.default font: UM.Theme.getFont("default")
text: control.text; text: control.text;
} }
} }
@ -165,7 +166,7 @@ Rectangle
anchors.bottom: footerSeparator.top anchors.bottom: footerSeparator.top
anchors.top: profileItem.bottom anchors.top: profileItem.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: base.left anchors.left: base.left
anchors.right: base.right anchors.right: base.right
@ -201,10 +202,10 @@ Rectangle
Rectangle { Rectangle {
id: footerSeparator id: footerSeparator
width: parent.width width: parent.width
height: UM.Theme.sizes.sidebar_lining.height height: UM.Theme.getSize("sidebar_lining").height
color: UM.Theme.colors.sidebar_lining color: UM.Theme.getColor("sidebar_lining")
anchors.bottom: saveButton.top anchors.bottom: saveButton.top
anchors.bottomMargin: UM.Theme.sizes.default_margin.height anchors.bottomMargin: UM.Theme.getSize("default_margin").height
} }
SaveButton SaveButton
@ -239,7 +240,7 @@ Rectangle
id: sidebarAdvanced; id: sidebarAdvanced;
visible: false; visible: false;
configureSettings: base.configureMachinesAction; configureSettings: base.configureSettingsAction;
onShowTooltip: base.showTooltip(item, location, text) onShowTooltip: base.showTooltip(item, location, text)
onHideTooltip: base.hideTooltip() onHideTooltip: base.hideTooltip()
} }

View file

@ -21,27 +21,27 @@ Item
width: base.width width: base.width
height: 0 height: 0
anchors.top: parent.top anchors.top: parent.top
color: UM.Theme.colors.sidebar_header_bar color: UM.Theme.getColor("sidebar_header_bar")
} }
Label{ Label{
id: printjobTabLabel id: printjobTabLabel
text: catalog.i18nc("@label:listbox","Print Job"); text: catalog.i18nc("@label:listbox","Print Job");
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.top: sidebarTabRow.bottom anchors.top: sidebarTabRow.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width/100*45 width: parent.width/100*45
font: UM.Theme.fonts.large; font: UM.Theme.getFont("large");
color: UM.Theme.colors.text color: UM.Theme.getColor("text")
} }
Rectangle { Rectangle {
id: machineSelectionRow id: machineSelectionRow
width: base.width width: base.width
height: UM.Theme.sizes.sidebar_setup.height height: UM.Theme.getSize("sidebar_setup").height
anchors.top: printjobTabLabel.bottom anchors.top: printjobTabLabel.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Label{ Label{
@ -49,20 +49,20 @@ Item
//: Machine selection label //: Machine selection label
text: catalog.i18nc("@label:listbox","Printer:"); text: catalog.i18nc("@label:listbox","Printer:");
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
font: UM.Theme.fonts.default; font: UM.Theme.getFont("default");
color: UM.Theme.colors.text; color: UM.Theme.getColor("text");
} }
ToolButton { ToolButton {
id: machineSelection id: machineSelection
text: UM.MachineManager.activeMachineInstance; text: UM.MachineManager.activeMachineInstance;
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.activeMachineInstance; tooltip: UM.MachineManager.activeMachineInstance;
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
@ -97,30 +97,30 @@ Item
Rectangle { Rectangle {
id: variantRow id: variantRow
anchors.top: machineSelectionRow.bottom anchors.top: machineSelectionRow.bottom
anchors.topMargin: UM.MachineManager.hasVariants ? UM.Theme.sizes.default_margin.height : 0 anchors.topMargin: UM.MachineManager.hasVariants ? UM.Theme.getSize("default_margin").height : 0
width: base.width width: base.width
height: UM.MachineManager.hasVariants ? UM.Theme.sizes.sidebar_setup.height : 0 height: UM.MachineManager.hasVariants ? UM.Theme.getSize("sidebar_setup").height : 0
visible: UM.MachineManager.hasVariants visible: UM.MachineManager.hasVariants
Label{ Label{
id: variantLabel id: variantLabel
text: catalog.i18nc("@label","Nozzle:"); text: catalog.i18nc("@label","Nozzle:");
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: variantSelection id: variantSelection
text: UM.MachineManager.activeMachineVariant text: UM.MachineManager.activeMachineVariant
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.activeMachineVariant; tooltip: UM.MachineManager.activeMachineVariant;
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
@ -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

View file

@ -27,19 +27,19 @@ Item
id: infillCellLeft id: infillCellLeft
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
width: base.width/100* 35 - UM.Theme.sizes.default_margin.width width: base.width/100* 35 - UM.Theme.getSize("default_margin").width
height: childrenRect.height height: childrenRect.height
Label{ Label{
id: infillLabel id: infillLabel
//: Infill selection label //: Infill selection label
text: catalog.i18nc("@label","Infill:"); text: catalog.i18nc("@label","Infill:");
font: UM.Theme.fonts.default; font: UM.Theme.getFont("default");
color: UM.Theme.colors.text; color: UM.Theme.getColor("text");
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.getSize("default_margin").width
} }
} }
@ -48,7 +48,7 @@ Item
height: childrenRect.height; height: childrenRect.height;
width: base.width / 100 * 65 width: base.width / 100 * 65
spacing: UM.Theme.sizes.default_margin.width spacing: UM.Theme.getSize("default_margin").width
anchors.left: infillCellLeft.right anchors.left: infillCellLeft.right
anchors.top: infillCellLeft.top anchors.top: infillCellLeft.top
@ -81,23 +81,32 @@ Item
Rectangle{ Rectangle{
id: infillIconLining id: infillIconLining
width: (infillCellRight.width - 3 * UM.Theme.sizes.default_margin.width) / 4; width: (infillCellRight.width - 3 * UM.Theme.getSize("default_margin").width) / 4;
height: width height: width
border.color: (infillListView.activeIndex == index) ? UM.Theme.colors.setting_control_selected : border.color: {
(mousearea.containsMouse ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border) if(infillListView.activeIndex == index)
border.width: UM.Theme.sizes.default_lining.width {
color: infillListView.activeIndex == index ? UM.Theme.colors.setting_control_selected : "transparent" return UM.Theme.getColor("setting_control_selected")
}
else if(mousearea.containsMouse)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
border.width: UM.Theme.getSize("default_lining").width
color: infillListView.activeIndex == index ? UM.Theme.getColor("setting_control_selected") : "transparent"
UM.RecolorImage { UM.RecolorImage {
id: infillIcon id: infillIcon
anchors.fill: parent; anchors.fill: parent;
anchors.margins: UM.Theme.sizes.infill_button_margin.width anchors.margins: UM.Theme.getSize("infill_button_margin").width
sourceSize.width: width sourceSize.width: width
sourceSize.height: width sourceSize.height: width
source: UM.Theme.icons[model.icon]; source: UM.Theme.getIcon(model.icon);
color: (infillListView.activeIndex == index) ? UM.Theme.colors.text_white : UM.Theme.colors.text color: (infillListView.activeIndex == index) ? UM.Theme.getColor("text_white") : UM.Theme.getColor("text")
} }
MouseArea { MouseArea {
@ -122,7 +131,7 @@ Item
id: infillLabel id: infillLabel
anchors.top: infillIconLining.bottom anchors.top: infillIconLining.bottom
anchors.horizontalCenter: infillIconLining.horizontalCenter anchors.horizontalCenter: infillIconLining.horizontalCenter
color: infillListView.activeIndex == index ? UM.Theme.colors.setting_control_text : UM.Theme.colors.setting_control_border color: infillListView.activeIndex == index ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_border")
text: name text: name
} }
} }
@ -172,25 +181,25 @@ Item
Rectangle { Rectangle {
id: helpersCellLeft id: helpersCellLeft
anchors.top: infillCellRight.bottom anchors.top: infillCellRight.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left anchors.left: parent.left
width: parent.width/100*35 - UM.Theme.sizes.default_margin.width width: parent.width/100*35 - UM.Theme.getSize("default_margin").width
height: childrenRect.height height: childrenRect.height
Label{ Label{
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.getSize("default_margin").width
//: Helpers selection label //: Helpers selection label
text: catalog.i18nc("@label:listbox","Helpers:"); text: catalog.i18nc("@label:listbox","Helpers:");
font: UM.Theme.fonts.default; font: UM.Theme.getFont("default");
color: UM.Theme.colors.text; color: UM.Theme.getColor("text");
} }
} }
Rectangle { Rectangle {
id: helpersCellRight id: helpersCellRight
anchors.top: helpersCellLeft.top anchors.top: helpersCellLeft.top
anchors.left: helpersCellLeft.right anchors.left: helpersCellLeft.right
width: parent.width/100*65 - UM.Theme.sizes.default_margin.width width: parent.width/100*65 - UM.Theme.getSize("default_margin").width
height: childrenRect.height height: childrenRect.height
CheckBox{ CheckBox{
@ -230,7 +239,7 @@ Item
property bool hovered_ex: false property bool hovered_ex: false
anchors.top: brimCheckBox.bottom anchors.top: brimCheckBox.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left anchors.left: parent.left
//: Setting enable support checkbox //: Setting enable support checkbox

View file

@ -11,11 +11,11 @@ import UM 1.0 as UM
UM.PointingRectangle { UM.PointingRectangle {
id: base; id: base;
width: UM.Theme.sizes.tooltip.width; width: UM.Theme.getSize("tooltip").width;
height: label.height + UM.Theme.sizes.tooltip_margins.height * 2; height: label.height + UM.Theme.getSize("tooltip_margins").height * 2;
color: UM.Theme.colors.tooltip; color: UM.Theme.getColor("tooltip");
arrowSize: UM.Theme.sizes.default_arrow.width arrowSize: UM.Theme.getSize("default_arrow").width
opacity: 0; opacity: 0;
Behavior on opacity { NumberAnimation { duration: 100; } } Behavior on opacity { NumberAnimation { duration: 100; } }
@ -28,7 +28,7 @@ UM.PointingRectangle {
y = parent.height - base.height; y = parent.height - base.height;
} else { } else {
x = position.x - base.width; x = position.x - base.width;
y = position.y - UM.Theme.sizes.tooltip_arrow_margins.height; y = position.y - UM.Theme.getSize("tooltip_arrow_margins").height;
} }
base.opacity = 1; base.opacity = 1;
target = Qt.point(40 , position.y) target = Qt.point(40 , position.y)
@ -42,14 +42,14 @@ UM.PointingRectangle {
id: label; id: label;
anchors { anchors {
top: parent.top; top: parent.top;
topMargin: UM.Theme.sizes.tooltip_margins.height; topMargin: UM.Theme.getSize("tooltip_margins").height;
left: parent.left; left: parent.left;
leftMargin: UM.Theme.sizes.tooltip_margins.width; leftMargin: UM.Theme.getSize("tooltip_margins").width;
right: parent.right; right: parent.right;
rightMargin: UM.Theme.sizes.tooltip_margins.width; rightMargin: UM.Theme.getSize("tooltip_margins").width;
} }
wrapMode: Text.Wrap; wrapMode: Text.Wrap;
font: UM.Theme.fonts.default; font: UM.Theme.getFont("default");
color: UM.Theme.colors.tooltip_text; color: UM.Theme.getColor("tooltip_text");
} }
} }

View file

@ -20,7 +20,7 @@ Item {
anchors.bottom: parent.bottom; anchors.bottom: parent.bottom;
anchors.left: parent.left; anchors.left: parent.left;
spacing: UM.Theme.sizes.button_lining.width spacing: UM.Theme.getSize("button_lining").width
Repeater { Repeater {
id: repeat id: repeat
@ -29,7 +29,7 @@ Item {
Button { Button {
text: model.name text: model.name
iconSource: UM.Theme.icons[model.icon]; iconSource: UM.Theme.getIcon(model.icon);
checkable: true; checkable: true;
checked: model.active; checked: model.active;
@ -54,47 +54,47 @@ Item {
id: panelBorder; id: panelBorder;
anchors.left: parent.right; anchors.left: parent.right;
anchors.leftMargin: UM.Theme.sizes.default_margin.width; anchors.leftMargin: UM.Theme.getSize("default_margin").width;
anchors.top: base.top; anchors.top: base.top;
anchors.topMargin: base.activeY anchors.topMargin: base.activeY
z: buttons.z -1 z: buttons.z -1
target: Qt.point(parent.right, base.activeY + UM.Theme.sizes.button.height/2) target: Qt.point(parent.right, base.activeY + UM.Theme.getSize("button").height/2)
arrowSize: UM.Theme.sizes.default_arrow.width arrowSize: UM.Theme.getSize("default_arrow").width
width: { width: {
if (panel.item && panel.width > 0){ if (panel.item && panel.width > 0){
return Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width) return Math.max(panel.width + 2 * UM.Theme.getSize("default_margin").width)
} }
else { else {
return 0 return 0
} }
} }
height: panel.item ? panel.height + 2 * UM.Theme.sizes.default_margin.height : 0; height: panel.item ? panel.height + 2 * UM.Theme.getSize("default_margin").height : 0;
opacity: panel.item ? 1 : 0 opacity: panel.item ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } } Behavior on opacity { NumberAnimation { duration: 100 } }
color: UM.Theme.colors.lining; color: UM.Theme.getColor("lining");
//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")
UM.PointingRectangle { UM.PointingRectangle {
id: panelBackground; id: panelBackground;
color: UM.Theme.colors.tool_panel_background; color: UM.Theme.getColor("tool_panel_background");
anchors.fill: parent anchors.fill: parent
anchors.margins: UM.Theme.sizes.default_lining.width anchors.margins: UM.Theme.getSize("default_lining").width
target: Qt.point(-UM.Theme.sizes.default_margin.width, UM.Theme.sizes.button.height/2) target: Qt.point(-UM.Theme.getSize("default_margin").width, UM.Theme.getSize("button").height/2)
arrowSize: parent.arrowSize arrowSize: parent.arrowSize
} }
Loader { Loader {
id: panel id: panel
x: UM.Theme.sizes.default_margin.width; x: UM.Theme.getSize("default_margin").width;
y: UM.Theme.sizes.default_margin.height; y: UM.Theme.getSize("default_margin").height;
source: UM.ActiveTool.valid ? UM.ActiveTool.activeToolPanel : ""; source: UM.ActiveTool.valid ? UM.ActiveTool.activeToolPanel : "";
enabled: UM.Controller.toolsEnabled; enabled: UM.Controller.toolsEnabled;

View file

@ -98,12 +98,12 @@ Item
background: Rectangle { background: Rectangle {
border.width: 0 border.width: 0
color: "transparent"; color: "transparent";
height: UM.Theme.sizes.standard_list_lineheight.height height: UM.Theme.getSize("standard_list_lineheight").height
width: machineList.width width: machineList.width
} }
label: Text { label: Text {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.standard_arrow.width + UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.getSize("standard_arrow").width + UM.Theme.getSize("default_margin").width
text: control.text text: control.text
color: palette.windowText color: palette.windowText
font.bold: true font.bold: true
@ -111,13 +111,13 @@ Item
id: downArrow id: downArrow
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.left anchors.right: parent.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width anchors.rightMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.sizes.standard_arrow.width width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.sizes.standard_arrow.height height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: palette.windowText color: palette.windowText
source: base.activeManufacturer == section ? UM.Theme.icons.arrow_bottom : UM.Theme.icons.arrow_right source: base.activeManufacturer == section ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_right")
} }
} }
} }
@ -133,10 +133,10 @@ Item
id: machineButton id: machineButton
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.width anchors.leftMargin: UM.Theme.getSize("standard_list_lineheight").width
opacity: 1; opacity: 1;
height: UM.Theme.sizes.standard_list_lineheight.height; height: UM.Theme.getSize("standard_list_lineheight").height;
checked: ListView.isCurrentItem; checked: ListView.isCurrentItem;
@ -183,6 +183,25 @@ Item
id: machineNameHolder id: machineNameHolder
anchors.bottom: parent.bottom; anchors.bottom: parent.bottom;
Item
{
height: errorMessage.lineHeight
anchors.bottom: insertNameLabel.top
anchors.bottomMargin: insertNameLabel.height * errorMessage.lineCount
Label
{
id: errorMessage
property bool show: false
width: base.width
height: errorMessage.show ? errorMessage.lineHeight : 0
visible: errorMessage.show
text: catalog.i18nc("@label", "This printer name has already been used. Please choose a different printer name.");
wrapMode: Text.WordWrap
Behavior on height {NumberAnimation {duration: 75; }}
color: UM.Theme.getColor("error")
}
}
Label Label
{ {
id: insertNameLabel id: insertNameLabel
@ -192,7 +211,7 @@ Item
{ {
id: machineName; id: machineName;
text: getMachineName() text: getMachineName()
implicitWidth: UM.Theme.sizes.standard_list_input.width implicitWidth: UM.Theme.getSize("standard_list_input").width
} }
} }

View file

@ -47,7 +47,7 @@ Item
{ {
id: pageDescription id: pageDescription
anchors.top: pageTitle.bottom anchors.top: pageTitle.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","To make sure your prints will come out great, you can now adjust your buildplate. When you click 'Move to Next Position' the nozzle will move to the different positions that can be adjusted.") text: catalog.i18nc("@label","To make sure your prints will come out great, you can now adjust your buildplate. When you click 'Move to Next Position' the nozzle will move to the different positions that can be adjusted.")
@ -56,7 +56,7 @@ Item
{ {
id: bedlevelingText id: bedlevelingText
anchors.top: pageDescription.bottom anchors.top: pageDescription.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label", "For every postition; insert a piece of paper under the nozzle and adjust the print bed height. The print bed height is right when the paper is slightly gripped by the tip of the nozzle.") text: catalog.i18nc("@label", "For every postition; insert a piece of paper under the nozzle and adjust the print bed height. The print bed height is right when the paper is slightly gripped by the tip of the nozzle.")
@ -65,10 +65,10 @@ Item
Item{ Item{
id: bedlevelingWrapper id: bedlevelingWrapper
anchors.top: bedlevelingText.bottom anchors.top: bedlevelingText.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: skipBedlevelingButton.height height: skipBedlevelingButton.height
width: bedlevelingButton.width + skipBedlevelingButton.width + UM.Theme.sizes.default_margin.height < wizardPage.width ? bedlevelingButton.width + skipBedlevelingButton.width + UM.Theme.sizes.default_margin.height : wizardPage.width width: bedlevelingButton.width + skipBedlevelingButton.width + UM.Theme.getSize("default_margin").height < wizardPage.width ? bedlevelingButton.width + skipBedlevelingButton.width + UM.Theme.getSize("default_margin").height : wizardPage.width
Button Button
{ {
id: bedlevelingButton id: bedlevelingButton
@ -103,9 +103,9 @@ Item
{ {
id: skipBedlevelingButton id: skipBedlevelingButton
anchors.top: parent.width < wizardPage.width ? parent.top : bedlevelingButton.bottom anchors.top: parent.width < wizardPage.width ? parent.top : bedlevelingButton.bottom
anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.sizes.default_margin.height/2 anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.getSize("default_margin").height/2
anchors.left: parent.width < wizardPage.width ? bedlevelingButton.right : parent.left anchors.left: parent.width < wizardPage.width ? bedlevelingButton.right : parent.left
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.sizes.default_margin.width : 0 anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
text: catalog.i18nc("@action:button","Skip Bedleveling"); text: catalog.i18nc("@action:button","Skip Bedleveling");
onClicked: base.visible = false; onClicked: base.visible = false;
} }
@ -116,7 +116,7 @@ Item
id: resultText id: resultText
visible: false visible: false
anchors.top: bedlevelingWrapper.bottom anchors.top: bedlevelingWrapper.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left anchors.left: parent.left
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap

View file

@ -36,7 +36,7 @@ Item
{ {
id: pageDescription id: pageDescription
anchors.top: pageTitle.bottom anchors.top: pageTitle.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","To assist you in having better default settings for your Ultimaker. Cura would like to know which upgrades you have in your machine:") text: catalog.i18nc("@label","To assist you in having better default settings for your Ultimaker. Cura would like to know which upgrades you have in your machine:")
@ -47,10 +47,10 @@ Item
id: pageCheckboxes id: pageCheckboxes
height: childrenRect.height height: childrenRect.height
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.top: pageDescription.bottom anchors.top: pageDescription.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width - UM.Theme.sizes.default_margin.width width: parent.width - UM.Theme.getSize("default_margin").width
CheckBox CheckBox
{ {
id: extruderCheckBox id: extruderCheckBox
@ -85,7 +85,7 @@ Item
{ {
width: parent.width width: parent.width
anchors.top: pageCheckboxes.bottom anchors.top: pageCheckboxes.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","If you bought your Ultimaker after october 2012 you will have the Extruder drive upgrade. If you do not have this upgrade, it is highly recommended to improve reliability. This upgrade can be bought from the Ultimaker webshop or found on thingiverse as thing:26094"); text: catalog.i18nc("@label","If you bought your Ultimaker after october 2012 you will have the Extruder drive upgrade. If you do not have this upgrade, it is highly recommended to improve reliability. This upgrade can be bought from the Ultimaker webshop or found on thingiverse as thing:26094");
} }

View file

@ -78,7 +78,7 @@ Item
{ {
id: pageDescription id: pageDescription
anchors.top: pageTitle.bottom anchors.top: pageTitle.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional"); text: catalog.i18nc("@label","It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional");
@ -87,10 +87,10 @@ Item
Item{ Item{
id: startStopButtons id: startStopButtons
anchors.top: pageDescription.bottom anchors.top: pageDescription.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: childrenRect.height height: childrenRect.height
width: startCheckButton.width + skipCheckButton.width + UM.Theme.sizes.default_margin.height < wizardPage.width ? startCheckButton.width + skipCheckButton.width + UM.Theme.sizes.default_margin.height : wizardPage.width width: startCheckButton.width + skipCheckButton.width + UM.Theme.getSize("default_margin").height < wizardPage.width ? startCheckButton.width + skipCheckButton.width + UM.Theme.getSize("default_margin").height : wizardPage.width
Button Button
{ {
id: startCheckButton id: startCheckButton
@ -109,9 +109,9 @@ Item
{ {
id: skipCheckButton id: skipCheckButton
anchors.top: parent.width < wizardPage.width ? parent.top : startCheckButton.bottom anchors.top: parent.width < wizardPage.width ? parent.top : startCheckButton.bottom
anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.sizes.default_margin.height/2 anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.getSize("default_margin").height/2
anchors.left: parent.width < wizardPage.width ? startCheckButton.right : parent.left anchors.left: parent.width < wizardPage.width ? startCheckButton.right : parent.left
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.sizes.default_margin.width : 0 anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
//enabled: !alreadyTested //enabled: !alreadyTested
text: catalog.i18nc("@action:button","Skip Printer Check"); text: catalog.i18nc("@action:button","Skip Printer Check");
onClicked: { onClicked: {
@ -123,7 +123,7 @@ Item
Item{ Item{
id: checkupContent id: checkupContent
anchors.top: startStopButtons.bottom anchors.top: startStopButtons.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
visible: false visible: false
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
Label Label
@ -227,7 +227,7 @@ Item
height: nozzleTemp.height height: nozzleTemp.height
anchors.top: nozzleTempLabel.top anchors.top: nozzleTempLabel.top
anchors.left: bedTempStatus.right anchors.left: bedTempStatus.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width/2 anchors.leftMargin: UM.Theme.getSize("default_margin").width/2
Button Button
{ {
height: nozzleTemp.height - 2 height: nozzleTemp.height - 2
@ -250,7 +250,7 @@ Item
id: nozzleTemp id: nozzleTemp
anchors.top: nozzleTempLabel.top anchors.top: nozzleTempLabel.top
anchors.left: nozzleTempButton.right anchors.left: nozzleTempButton.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.getSize("default_margin").width
width: wizardPage.rightRow * 0.2 width: wizardPage.rightRow * 0.2
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: printer_connection != null ? printer_connection.extruderTemperature + "°C" : "0°C" text: printer_connection != null ? printer_connection.extruderTemperature + "°C" : "0°C"
@ -283,7 +283,7 @@ Item
height: bedTemp.height height: bedTemp.height
anchors.top: bedTempLabel.top anchors.top: bedTempLabel.top
anchors.left: bedTempStatus.right anchors.left: bedTempStatus.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width/2 anchors.leftMargin: UM.Theme.getSize("default_margin").width/2
Button Button
{ {
height: bedTemp.height - 2 height: bedTemp.height - 2
@ -307,7 +307,7 @@ Item
width: wizardPage.rightRow * 0.2 width: wizardPage.rightRow * 0.2
anchors.top: bedTempLabel.top anchors.top: bedTempLabel.top
anchors.left: bedTempButton.right anchors.left: bedTempButton.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: UM.Theme.getSize("default_margin").width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: printer_connection != null ? printer_connection.bedTemperature + "°C": "0°C" text: printer_connection != null ? printer_connection.bedTemperature + "°C": "0°C"
font.bold: true font.bold: true
@ -317,7 +317,7 @@ Item
id: resultText id: resultText
visible: false visible: false
anchors.top: bedTemp.bottom anchors.top: bedTemp.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left anchors.left: parent.left
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap

View file

@ -27,7 +27,7 @@ Item
{ {
id: pageDescription id: pageDescription
anchors.top: pageTitle.bottom anchors.top: pageTitle.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","Firmware is the piece of software running directly on your 3D printer. This firmware controls the step motors, regulates the temperature and ultimately makes your printer work.") text: catalog.i18nc("@label","Firmware is the piece of software running directly on your 3D printer. This firmware controls the step motors, regulates the temperature and ultimately makes your printer work.")
@ -37,7 +37,7 @@ Item
{ {
id: upgradeText1 id: upgradeText1
anchors.top: pageDescription.bottom anchors.top: pageDescription.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","The firmware shipping with new Ultimakers works, but upgrades have been made to make better prints, and make calibration easier."); text: catalog.i18nc("@label","The firmware shipping with new Ultimakers works, but upgrades have been made to make better prints, and make calibration easier.");
@ -47,16 +47,16 @@ Item
{ {
id: upgradeText2 id: upgradeText2
anchors.top: upgradeText1.bottom anchors.top: upgradeText1.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","Cura requires these new features and thus your firmware will most likely need to be upgraded. You can do so now."); text: catalog.i18nc("@label","Cura requires these new features and thus your firmware will most likely need to be upgraded. You can do so now.");
} }
Item{ Item{
anchors.top: upgradeText2.bottom anchors.top: upgradeText2.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: upgradeButton.width + skipUpgradeButton.width + UM.Theme.sizes.default_margin.height < wizardPage.width ? upgradeButton.width + skipUpgradeButton.width + UM.Theme.sizes.default_margin.height : wizardPage.width width: upgradeButton.width + skipUpgradeButton.width + UM.Theme.getSize("default_margin").height < wizardPage.width ? upgradeButton.width + skipUpgradeButton.width + UM.Theme.getSize("default_margin").height : wizardPage.width
Button { Button {
id: upgradeButton id: upgradeButton
anchors.top: parent.top anchors.top: parent.top
@ -67,9 +67,9 @@ Item
Button { Button {
id: skipUpgradeButton id: skipUpgradeButton
anchors.top: parent.width < wizardPage.width ? parent.top : upgradeButton.bottom anchors.top: parent.width < wizardPage.width ? parent.top : upgradeButton.bottom
anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.sizes.default_margin.height/2 anchors.topMargin: parent.width < wizardPage.width ? 0 : UM.Theme.getSize("default_margin").height/2
anchors.left: parent.width < wizardPage.width ? upgradeButton.right : parent.left anchors.left: parent.width < wizardPage.width ? upgradeButton.right : parent.left
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.sizes.default_margin.width : 0 anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
text: catalog.i18nc("@action:button","Skip Upgrade"); text: catalog.i18nc("@action:button","Skip Upgrade");
onClicked: { onClicked: {
base.currentPage += 1 base.currentPage += 1

View file

@ -5,37 +5,37 @@ import QtQuick 2.1
import QtQuick.Controls 1.1 import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM import UM 1.1 as UM
QtObject { QtObject {
property Component sidebar_header_button: Component { property Component sidebar_header_button: Component {
ButtonStyle { ButtonStyle {
background: Rectangle { background: Rectangle {
color: UM.Theme.colors.setting_control color: Theme.getColor("setting_control")
border.width: UM.Theme.sizes.default_lining.width border.width: Theme.getSize("default_lining").width
border.color: control.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border border.color: control.hovered ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border")
UM.RecolorImage { UM.RecolorImage {
id: downArrow id: downArrow
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width anchors.rightMargin: Theme.getSize("default_margin").width
width: UM.Theme.sizes.standard_arrow.width width: Theme.getSize("standard_arrow").width
height: UM.Theme.sizes.standard_arrow.height height: Theme.getSize("standard_arrow").height
sourceSize.width: width sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: UM.Theme.colors.setting_category_text color: Theme.getColor("setting_category_text")
source: UM.Theme.icons.arrow_bottom source: Theme.getIcon("arrow_bottom")
} }
Label { Label {
id: sidebarComboBoxLabel id: sidebarComboBoxLabel
color: UM.Theme.colors.setting_control_text color: Theme.getColor("setting_control_text")
text: control.text; text: control.text;
elide: Text.ElideRight; elide: Text.ElideRight;
anchors.left: parent.left; anchors.left: parent.left;
anchors.leftMargin: UM.Theme.sizes.setting_unit_margin.width anchors.leftMargin: Theme.getSize("setting_unit_margin").width
anchors.right: downArrow.left; anchors.right: downArrow.left;
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.fonts.default font: Theme.getFont("default")
} }
} }
label: Label{} label: Label{}
@ -45,23 +45,23 @@ QtObject {
property Component tool_button: Component { property Component tool_button: Component {
ButtonStyle { ButtonStyle {
background: Item { background: Item {
implicitWidth: UM.Theme.sizes.button.width; implicitWidth: Theme.getSize("button").width;
implicitHeight: UM.Theme.sizes.button.height; implicitHeight: Theme.getSize("button").height;
UM.PointingRectangle { UM.PointingRectangle {
id: button_tooltip id: button_tooltip
anchors.left: parent.right anchors.left: parent.right
anchors.leftMargin: UM.Theme.sizes.button_tooltip_arrow.width * 2 anchors.leftMargin: Theme.getSize("button_tooltip_arrow").width * 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
target: Qt.point(parent.x, y + height/2) target: Qt.point(parent.x, y + height/2)
arrowSize: UM.Theme.sizes.button_tooltip_arrow.width arrowSize: Theme.getSize("button_tooltip_arrow").width
color: UM.Theme.colors.tooltip color: Theme.getColor("tooltip")
opacity: control.hovered ? 1.0 : 0.0; opacity: control.hovered ? 1.0 : 0.0;
width: control.hovered ? button_tip.width + UM.Theme.sizes.button_tooltip.width : 0 width: control.hovered ? button_tip.width + Theme.getSize("button_tooltip").width : 0
height: UM.Theme.sizes.button_tooltip.height height: Theme.getSize("button_tooltip").height
Behavior on width { NumberAnimation { duration: 100; } } Behavior on width { NumberAnimation { duration: 100; } }
Behavior on opacity { NumberAnimation { duration: 100; } } Behavior on opacity { NumberAnimation { duration: 100; } }
@ -73,8 +73,8 @@ QtObject {
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
text: control.text; text: control.text;
font: UM.Theme.fonts.button_tooltip; font: Theme.getFont("button_tooltip");
color: UM.Theme.colors.tooltip_text; color: Theme.getColor("tooltip_text");
} }
} }
@ -86,13 +86,13 @@ QtObject {
color: { color: {
if(control.checkable && control.checked && control.hovered) { if(control.checkable && control.checked && control.hovered) {
return UM.Theme.colors.button_active_hover; return Theme.getColor("button_active_hover");
} else if(control.pressed || (control.checkable && control.checked)) { } else if(control.pressed || (control.checkable && control.checked)) {
return UM.Theme.colors.button_active; return Theme.getColor("button_active");
} else if(control.hovered) { } else if(control.hovered) {
return UM.Theme.colors.button_hover; return Theme.getColor("button_hover");
} else { } else {
return UM.Theme.colors.button; return Theme.getColor("button");
} }
} }
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
@ -102,16 +102,16 @@ QtObject {
id: tool_button_arrow id: tool_button_arrow
opacity: !control.enabled ? 0.2 : 1.0 opacity: !control.enabled ? 0.2 : 1.0
anchors.right: parent.right; anchors.right: parent.right;
anchors.rightMargin: (UM.Theme.sizes.button.width - UM.Theme.sizes.button_icon.width) / 4 anchors.rightMargin: (Theme.getSize("button").width - Theme.getSize("button_icon").width) / 4
anchors.bottom: parent.bottom; anchors.bottom: parent.bottom;
anchors.bottomMargin: (UM.Theme.sizes.button.height - UM.Theme.sizes.button_icon.height) / 4 anchors.bottomMargin: (Theme.getSize("button").height - Theme.getSize("button_icon").height) / 4
width: UM.Theme.sizes.standard_arrow.width width: Theme.getSize("standard_arrow").width
height: UM.Theme.sizes.standard_arrow.height height: Theme.getSize("standard_arrow").height
sourceSize.width: width sourceSize.width: width
sourceSize.height: width sourceSize.height: width
visible: control.menu != null; visible: control.menu != null;
color: UM.Theme.colors.button_text color: Theme.getColor("button_text")
source: UM.Theme.icons.arrow_bottom source: Theme.getIcon("arrow_bottom")
} }
} }
} }
@ -121,37 +121,36 @@ QtObject {
anchors.centerIn: parent; anchors.centerIn: parent;
opacity: !control.enabled ? 0.2 : 1.0 opacity: !control.enabled ? 0.2 : 1.0
source: control.iconSource; source: control.iconSource;
width: UM.Theme.sizes.button_icon.width; width: Theme.getSize("button_icon").width;
height: UM.Theme.sizes.button_icon.height; height: Theme.getSize("button_icon").height;
sourceSize: UM.Theme.sizes.button_icon sourceSize: Theme.getSize("button_icon")
} }
} }
} }
} }
property Component progressbar: Component{ property Component progressbar: Component{
ProgressBarStyle { ProgressBarStyle {
background:Rectangle { background:Rectangle {
implicitWidth: UM.Theme.sizes.message.width - (UM.Theme.sizes.default_margin.width * 2) implicitWidth: Theme.getSize("message").width - (Theme.getSize("default_margin").width * 2)
implicitHeight: UM.Theme.sizes.progressbar.height implicitHeight: Theme.getSize("progressbar").height
radius: UM.Theme.sizes.progressbar_radius.width radius: Theme.getSize("progressbar_radius").width
color: UM.Theme.colors.progressbar_background color: Theme.getColor("progressbar_background")
} }
progress: Rectangle { progress: Rectangle {
color: control.indeterminate ? "transparent" : UM.Theme.colors.progressbar_control color: control.indeterminate ? "transparent" : Theme.getColor("progressbar_control")
radius: UM.Theme.sizes.progressbar_radius.width radius: Theme.getSize("progressbar_radius").width
Rectangle{ Rectangle{
radius: UM.Theme.sizes.progressbar_radius.width radius: Theme.getSize("progressbar_radius").width
color: UM.Theme.colors.progressbar_control color: Theme.getColor("progressbar_control")
width: UM.Theme.sizes.progressbar_control.width width: Theme.getSize("progressbar_control").width
height: UM.Theme.sizes.progressbar_control.height height: Theme.getSize("progressbar_control").height
visible: control.indeterminate visible: control.indeterminate
SequentialAnimation on x { SequentialAnimation on x {
id: xAnim id: xAnim
property int animEndPoint: UM.Theme.sizes.message.width - (UM.Theme.sizes.default_margin.width * 2) - UM.Theme.sizes.progressbar_control.width property int animEndPoint: Theme.getSize("message").width - (Theme.getSize("default_margin").width * 2) - Theme.getSize("progressbar_control").width
running: control.indeterminate running: control.indeterminate
loops: Animation.Infinite loops: Animation.Infinite
NumberAnimation { from: 0; to: xAnim.animEndPoint; duration: 2000;} NumberAnimation { from: 0; to: xAnim.animEndPoint; duration: 2000;}
@ -162,48 +161,46 @@ QtObject {
} }
} }
property Component sidebar_category: Component { property Component sidebar_category: Component {
ButtonStyle { ButtonStyle {
background: Rectangle { background: Rectangle {
anchors.fill: parent; anchors.fill: parent;
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: Theme.getSize("default_margin").width
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width anchors.rightMargin: Theme.getSize("default_margin").width
implicitHeight: UM.Theme.sizes.section.height; implicitHeight: Theme.getSize("section").height;
color: { color: {
if(control.color) { if(control.color) {
return control.color; return control.color;
} else if(!control.enabled) { } else if(!control.enabled) {
return UM.Theme.colors.setting_category_disabled; return Theme.getColor("setting_category_disabled");
} else if(control.hovered && control.checkable && control.checked) { } else if(control.hovered && control.checkable && control.checked) {
return UM.Theme.colors.setting_category_active_hover; return Theme.getColor("setting_category_active_hover");
} else if(control.pressed || (control.checkable && control.checked)) { } else if(control.pressed || (control.checkable && control.checked)) {
return UM.Theme.colors.setting_category_active; return Theme.getColor("setting_category_active");
} else if(control.hovered) { } else if(control.hovered) {
return UM.Theme.colors.setting_category_hover; return Theme.getColor("setting_category_hover");
} else { } else {
return UM.Theme.colors.setting_category; return Theme.getColor("setting_category");
} }
} }
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
Rectangle { Rectangle {
height: UM.Theme.sizes.default_lining.height height: Theme.getSize("default_lining").height
width: parent.width width: parent.width
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
color: { color: {
if(!control.enabled) { if(!control.enabled) {
return UM.Theme.colors.setting_category_disabled_border; return Theme.getColor("setting_category_disabled_border");
} else if(control.hovered && control.checkable && control.checked) { } else if(control.hovered && control.checkable && control.checked) {
return UM.Theme.colors.setting_category_active_hover_border; return Theme.getColor("setting_category_active_hover_border");
} else if(control.pressed || (control.checkable && control.checked)) { } else if(control.pressed || (control.checkable && control.checked)) {
return UM.Theme.colors.setting_category_active_border; return Theme.getColor("setting_category_active_border");
} else if(control.hovered) { } else if(control.hovered) {
return UM.Theme.colors.setting_category_hover_border; return Theme.getColor("setting_category_hover_border");
} else { } else {
return UM.Theme.colors.setting_category_border; return Theme.getColor("setting_category_border");
} }
} }
} }
@ -215,15 +212,15 @@ QtObject {
id: icon; id: icon;
anchors.left: parent.left anchors.left: parent.left
height: parent.height height: parent.height
width: UM.Theme.sizes.section_icon_column.width width: Theme.getSize("section_icon_column").width
UM.RecolorImage { UM.RecolorImage {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width anchors.leftMargin: Theme.getSize("default_margin").width
color: UM.Theme.colors.setting_category_text color: Theme.getColor("setting_category_text")
source: control.iconSource; source: control.iconSource;
width: UM.Theme.sizes.section_icon.width; width: Theme.getSize("section_icon").width;
height: UM.Theme.sizes.section_icon.height; height: Theme.getSize("section_icon").height;
sourceSize.width: width + 15 sourceSize.width: width + 15
sourceSize.height: width + 15 sourceSize.height: width + 15
} }
@ -232,13 +229,13 @@ QtObject {
Label { Label {
anchors { anchors {
left: icon.right; left: icon.right;
leftMargin: UM.Theme.sizes.default_lining.width; leftMargin: Theme.getSize("default_lining").width;
right: parent.right; right: parent.right;
verticalCenter: parent.verticalCenter; verticalCenter: parent.verticalCenter;
} }
text: control.text; text: control.text;
font: UM.Theme.fonts.setting_category; font: Theme.getFont("setting_category");
color: UM.Theme.colors.setting_category_text; color: Theme.getColor("setting_category_text");
fontSizeMode: Text.HorizontalFit; fontSizeMode: Text.HorizontalFit;
minimumPointSize: 8 minimumPointSize: 8
} }
@ -246,13 +243,13 @@ QtObject {
id: category_arrow id: category_arrow
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width * 2 - width / 2 anchors.rightMargin: Theme.getSize("default_margin").width * 2 - width / 2
width: UM.Theme.sizes.standard_arrow.width width: Theme.getSize("standard_arrow").width
height: UM.Theme.sizes.standard_arrow.height height: Theme.getSize("standard_arrow").height
sourceSize.width: width sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: UM.Theme.colors.setting_category_text color: Theme.getColor("setting_category_text")
source: control.checked ? UM.Theme.icons.arrow_bottom : UM.Theme.icons.arrow_left source: control.checked ? Theme.getIcon("arrow_bottom") : Theme.getIcon("arrow_left")
} }
} }
} }
@ -266,62 +263,62 @@ QtObject {
transientScrollBars: false transientScrollBars: false
scrollBarBackground: Rectangle { scrollBarBackground: Rectangle {
implicitWidth: UM.Theme.sizes.scrollbar.width implicitWidth: Theme.getSize("scrollbar").width
radius: implicitWidth / 2 radius: implicitWidth / 2
color: UM.Theme.colors.scrollbar_background; color: Theme.getColor("scrollbar_background");
} }
handle: Rectangle { handle: Rectangle {
id: scrollViewHandle id: scrollViewHandle
implicitWidth: UM.Theme.sizes.scrollbar.width; implicitWidth: Theme.getSize("scrollbar").width;
radius: implicitWidth / 2 radius: implicitWidth / 2
color: styleData.pressed ? UM.Theme.colors.scrollbar_handle_down : styleData.hovered ? UM.Theme.colors.scrollbar_handle_hover : UM.Theme.colors.scrollbar_handle; color: styleData.pressed ? Theme.getColor("scrollbar_handle_down") : styleData.hovered ? Theme.getColor("scrollbar_handle_hover") : Theme.getColor("scrollbar_handle");
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
} }
} }
} }
property variant setting_item: UM.SettingItemStyle { property variant setting_item: UM.SettingItemStyle {
labelFont: UM.Theme.fonts.default; labelFont: Theme.getFont("default");
labelColor: UM.Theme.colors.setting_control_text; labelColor: Theme.getColor("setting_control_text");
spacing: UM.Theme.sizes.default_lining.height; spacing: Theme.getSize("default_lining").height;
fixedHeight: UM.Theme.sizes.setting.height; fixedHeight: Theme.getSize("setting").height;
controlWidth: UM.Theme.sizes.setting_control.width; controlWidth: Theme.getSize("setting_control").width;
controlRightMargin: UM.Theme.sizes.setting_control_margin.width; controlRightMargin: Theme.getSize("setting_control_margin").width;
controlColor: UM.Theme.colors.setting_control; controlColor: Theme.getColor("setting_control");
controlHighlightColor: UM.Theme.colors.setting_control_highlight; controlHighlightColor: Theme.getColor("setting_control_highlight");
controlBorderColor: UM.Theme.colors.setting_control_border; controlBorderColor: Theme.getColor("setting_control_border");
controlBorderHighlightColor: UM.Theme.colors.setting_control_border_highlight; controlBorderHighlightColor: Theme.getColor("setting_control_border_highlight");
controlTextColor: UM.Theme.colors.setting_control_text; controlTextColor: Theme.getColor("setting_control_text");
controlBorderWidth: UM.Theme.sizes.default_lining.width; controlBorderWidth: Theme.getSize("default_lining").width;
controlFont: UM.Theme.fonts.default; controlFont: Theme.getFont("default");
validationErrorColor: UM.Theme.colors.setting_validation_error; validationErrorColor: Theme.getColor("setting_validation_error");
validationWarningColor: UM.Theme.colors.setting_validation_warning; validationWarningColor: Theme.getColor("setting_validation_warning");
validationOkColor: UM.Theme.colors.setting_validation_ok; validationOkColor: Theme.getColor("setting_validation_ok");
unitRightMargin: UM.Theme.sizes.setting_unit_margin.width; unitRightMargin: Theme.getSize("setting_unit_margin").width;
unitColor: UM.Theme.colors.setting_unit; unitColor: Theme.getColor("setting_unit");
unitFont: UM.Theme.fonts.default; unitFont: Theme.getFont("default");
} }
property Component checkbox: Component { property Component checkbox: Component {
CheckBoxStyle { CheckBoxStyle {
background: Item { } background: Item { }
indicator: Rectangle { indicator: Rectangle {
implicitWidth: UM.Theme.sizes.checkbox.width; implicitWidth: Theme.getSize("checkbox").width;
implicitHeight: UM.Theme.sizes.checkbox.height; implicitHeight: Theme.getSize("checkbox").height;
color: (control.hovered || control.hovered_ex) ? UM.Theme.colors.checkbox_hover : UM.Theme.colors.checkbox; color: (control.hovered || control.hovered_ex) ? Theme.getColor("checkbox_hover") : Theme.getColor("checkbox");
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
radius: control.exclusiveGroup ? UM.Theme.sizes.checkbox.width / 2 : 0 radius: control.exclusiveGroup ? Theme.getSize("checkbox").width / 2 : 0
border.width: UM.Theme.sizes.default_lining.width; border.width: Theme.getSize("default_lining").width;
border.color: (control.hovered || control.hovered_ex) ? UM.Theme.colors.checkbox_border_hover : UM.Theme.colors.checkbox_border; border.color: (control.hovered || control.hovered_ex) ? Theme.getColor("checkbox_border_hover") : Theme.getColor("checkbox_border");
UM.RecolorImage { UM.RecolorImage {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -330,16 +327,16 @@ QtObject {
height: parent.height/2.5 height: parent.height/2.5
sourceSize.width: width sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: UM.Theme.colors.checkbox_mark color: Theme.getColor("checkbox_mark")
source: control.exclusiveGroup ? UM.Theme.icons.dot : UM.Theme.icons.check source: control.exclusiveGroup ? Theme.getIcon("dot") : Theme.getIcon("check")
opacity: control.checked opacity: control.checked
Behavior on opacity { NumberAnimation { duration: 100; } } Behavior on opacity { NumberAnimation { duration: 100; } }
} }
} }
label: Label { label: Label {
text: control.text; text: control.text;
color: UM.Theme.colors.checkbox_text; color: Theme.getColor("checkbox_text");
font: UM.Theme.fonts.default; font: Theme.getFont("default");
} }
} }
} }
@ -348,11 +345,11 @@ QtObject {
SliderStyle { SliderStyle {
groove: Rectangle { groove: Rectangle {
implicitWidth: control.width; implicitWidth: control.width;
implicitHeight: UM.Theme.sizes.slider_groove.height; implicitHeight: Theme.getSize("slider_groove").height;
color: UM.Theme.colors.slider_groove; color: Theme.getColor("slider_groove");
border.width: UM.Theme.sizes.default_lining.width; border.width: Theme.getSize("default_lining").width;
border.color: UM.Theme.colors.slider_groove_border; border.color: Theme.getColor("slider_groove_border");
Rectangle { Rectangle {
anchors { anchors {
@ -360,14 +357,14 @@ QtObject {
top: parent.top; top: parent.top;
bottom: parent.bottom; bottom: parent.bottom;
} }
color: UM.Theme.colors.slider_groove_fill; color: Theme.getColor("slider_groove_fill");
width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width; width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width;
} }
} }
handle: Rectangle { handle: Rectangle {
width: UM.Theme.sizes.slider_handle.width; width: Theme.getSize("slider_handle").width;
height: UM.Theme.sizes.slider_handle.height; height: Theme.getSize("slider_handle").height;
color: control.hovered ? UM.Theme.colors.slider_handle_hover : UM.Theme.colors.slider_handle; color: control.hovered ? Theme.getColor("slider_handle_hover") : Theme.getColor("slider_handle");
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
} }
} }
@ -378,28 +375,28 @@ QtObject {
groove: Rectangle { groove: Rectangle {
id: layerSliderGroove id: layerSliderGroove
implicitWidth: control.width; implicitWidth: control.width;
implicitHeight: UM.Theme.sizes.slider_groove.height; implicitHeight: Theme.getSize("slider_groove").height;
radius: width/2; radius: width/2;
color: UM.Theme.colors.slider_groove; color: Theme.getColor("slider_groove");
border.width: UM.Theme.sizes.default_lining.width; border.width: Theme.getSize("default_lining").width;
border.color: UM.Theme.colors.slider_groove_border; border.color: Theme.getColor("slider_groove_border");
Rectangle { Rectangle {
anchors { anchors {
left: parent.left; left: parent.left;
top: parent.top; top: parent.top;
bottom: parent.bottom; bottom: parent.bottom;
} }
color: UM.Theme.colors.slider_groove_fill; color: Theme.getColor("slider_groove_fill");
width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width; width: (control.value / (control.maximumValue - control.minimumValue)) * parent.width;
radius: width/2 radius: width/2
} }
} }
handle: Rectangle { handle: Rectangle {
id: layerSliderControl id: layerSliderControl
width: UM.Theme.sizes.slider_handle.width; width: Theme.getSize("slider_handle").width;
height: UM.Theme.sizes.slider_handle.height; height: Theme.getSize("slider_handle").height;
color: control.hovered ? UM.Theme.colors.slider_handle_hover : UM.Theme.colors.slider_handle; color: control.hovered ? Theme.getColor("slider_handle_hover") : Theme.getColor("slider_handle");
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
TextField { TextField {
id: valueLabel id: valueLabel
@ -414,17 +411,17 @@ QtObject {
validator: IntValidator {bottom: 1; top: control.maximumValue + 1;} validator: IntValidator {bottom: 1; top: control.maximumValue + 1;}
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
anchors.top: layerSliderControl.bottom anchors.top: layerSliderControl.bottom
anchors.topMargin: width/2 - UM.Theme.sizes.default_margin.width/2 anchors.topMargin: width/2 - Theme.getSize("default_margin").width/2
anchors.horizontalCenter: layerSliderControl.horizontalCenter anchors.horizontalCenter: layerSliderControl.horizontalCenter
rotation: 90 rotation: 90
style: TextFieldStyle{ style: TextFieldStyle{
textColor: UM.Theme.colors.setting_control_text; textColor: Theme.getColor("setting_control_text");
font: UM.Theme.fonts.default; font: Theme.getFont("default");
background: Rectangle { background: Rectangle {
implicitWidth: control.maxValue.length * valueLabel.font.pixelSize + UM.Theme.sizes.default_margin.width implicitWidth: control.maxValue.length * valueLabel.font.pixelSize + Theme.getSize("default_margin").width
implicitHeight: UM.Theme.sizes.slider_handle.height + UM.Theme.sizes.default_margin.width implicitHeight: Theme.getSize("slider_handle").height + Theme.getSize("default_margin").width
border.width: UM.Theme.sizes.default_lining.width; border.width: Theme.getSize("default_lining").width;
border.color: UM.Theme.colors.slider_groove_border; border.color: Theme.getColor("slider_groove_border");
} }
} }
} }
@ -434,27 +431,27 @@ QtObject {
property Component text_field: Component { property Component text_field: Component {
TextFieldStyle { TextFieldStyle {
textColor: UM.Theme.colors.setting_control_text; textColor: Theme.getColor("setting_control_text");
font: UM.Theme.fonts.default; font: Theme.getFont("default");
background: Rectangle background: Rectangle
{ {
implicitHeight: control.height; implicitHeight: control.height;
implicitWidth: control.width; implicitWidth: control.width;
border.width: UM.Theme.sizes.default_lining.width; border.width: Theme.getSize("default_lining").width;
border.color: control.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border; border.color: control.hovered ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border");
color: UM.Theme.colors.setting_validation_ok; color: Theme.getColor("setting_validation_ok");
Label { Label {
anchors.right: parent.right; anchors.right: parent.right;
anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width; anchors.rightMargin: Theme.getSize("setting_unit_margin").width;
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
text: control.unit ? control.unit : "" text: control.unit ? control.unit : ""
color: UM.Theme.colors.setting_unit; color: Theme.getColor("setting_unit");
font: UM.Theme.fonts.default; font: Theme.getFont("default");
} }
} }
} }