diff --git a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py index 1aec739f92..6b74426cf4 100644 --- a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py +++ b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py @@ -24,7 +24,7 @@ class ProcessSlicedObjectListJob(Job): self._message = message self._scene = Application.getInstance().getController().getScene() self._progress = None - self._abortRequested = False + self._abort_requested = False ## Aborts the processing of layers. # @@ -33,14 +33,14 @@ class ProcessSlicedObjectListJob(Job): # 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. def abort(self): - self._abortRequested = True + self._abort_requested = True def run(self): if Application.getInstance().getController().getActiveView().getPluginId() == "LayerView": self._progress = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, -1) self._progress.show() Job.yieldThread() - if self._abortRequested: + if self._abort_requested: if self._progress: self._progress.hide() return @@ -57,7 +57,7 @@ class ProcessSlicedObjectListJob(Job): else: object_id_map[id(node)] = node Job.yieldThread() - if self._abortRequested: + if self._abort_requested: if self._progress: self._progress.hide() return @@ -113,7 +113,7 @@ class ProcessSlicedObjectListJob(Job): # 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. - if self._abortRequested: + if self._abort_requested: if self._progress: self._progress.hide() 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 layer_data.build() - if self._abortRequested: + if self._abort_requested: if self._progress: self._progress.hide() return diff --git a/plugins/LayerView/LayerView.qml b/plugins/LayerView/LayerView.qml index ad363af4aa..b26d301648 100644 --- a/plugins/LayerView/LayerView.qml +++ b/plugins/LayerView/LayerView.qml @@ -10,16 +10,16 @@ import UM 1.0 as UM Item { - width: UM.Theme.sizes.button.width - height: UM.Theme.sizes.slider_layerview_size.height + width: UM.Theme.getSize("button").width + height: UM.Theme.getSize("slider_layerview_size").height Slider { id: slider - width: UM.Theme.sizes.slider_layerview_size.width - height: UM.Theme.sizes.slider_layerview_size.height + width: UM.Theme.getSize("slider_layerview_size").width + height: UM.Theme.getSize("slider_layerview_size").height anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.slider_layerview_margin.width/2 + anchors.leftMargin: UM.Theme.getSize("slider_layerview_margin").width/2 orientation: Qt.Vertical minimumValue: 0; maximumValue: UM.LayerView.numLayers; @@ -34,11 +34,11 @@ Item anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter z: slider.z - 1 - width: UM.Theme.sizes.slider_layerview_background.width - height: slider.height + UM.Theme.sizes.default_margin.height * 2 - color: UM.Theme.colors.tool_panel_background; - border.width: UM.Theme.sizes.default_lining.width - border.color: UM.Theme.colors.lining + width: UM.Theme.getSize("slider_layerview_background").width + height: slider.height + UM.Theme.getSize("default_margin").height * 2 + color: UM.Theme.getColor("tool_panel_background"); + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("lining") MouseArea { id: sliderMouseArea diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index f64e3d4935..087c100f2c 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -22,13 +22,13 @@ Item { anchors.top: parent.top; anchors.left: parent.left; - spacing: UM.Theme.sizes.default_margin.height; + spacing: UM.Theme.getSize("default_margin").height; UM.SettingItem { id: profileSelection - width: UM.Theme.sizes.setting.width; - height: UM.Theme.sizes.setting.height; + width: UM.Theme.getSize("setting").width; + height: UM.Theme.getSize("setting").height; name: catalog.i18nc("@label", "Object profile") type: "enum" @@ -48,8 +48,8 @@ Item { Column { id: customisedSettings - spacing: UM.Theme.sizes.default_lining.height; - width: UM.Theme.sizes.setting.width + UM.Theme.sizes.setting.height/2; + spacing: UM.Theme.getSize("default_lining").height; + width: UM.Theme.getSize("setting").width + UM.Theme.getSize("setting").height/2; Repeater { id: settings; @@ -57,8 +57,8 @@ Item { model: UM.ActiveTool.properties.getValue("Model").getItem(base.currentIndex).settings UM.SettingItem { - width: UM.Theme.sizes.setting.width; - height: UM.Theme.sizes.setting.height; + width: UM.Theme.getSize("setting").width; + height: UM.Theme.getSize("setting").height; name: model.label; type: model.type; @@ -80,8 +80,8 @@ Item { { anchors.left: parent.right; - width: UM.Theme.sizes.setting.height; - height: UM.Theme.sizes.setting.height; + width: UM.Theme.getSize("setting").height; + height: UM.Theme.getSize("setting").height; onClicked: UM.ActiveTool.properties.getValue("Model").removeSettingOverride(UM.ActiveTool.properties.getValue("Model").getItem(base.currentIndex).id, model.key) @@ -98,8 +98,8 @@ Item { height: parent.height/2 sourceSize.width: width sourceSize.height: width - color: control.hovered ? UM.Theme.colors.setting_control_button_hover : UM.Theme.colors.setting_control_button - source: UM.Theme.icons.cross1 + color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button") + source: UM.Theme.getIcon("cross1") } } } @@ -112,7 +112,7 @@ Item { { id: customise_settings_button; anchors.right: profileSelection.right; - height: UM.Theme.sizes.setting.height; + height: UM.Theme.getSize("setting").height; visible: parseInt(UM.Preferences.getValue("cura/active_mode")) == 1 text: catalog.i18nc("@action:button", "Add Setting"); @@ -123,16 +123,16 @@ Item { { width: control.width; height: control.height; - border.width: UM.Theme.sizes.default_lining.width; - border.color: control.pressed ? UM.Theme.colors.action_button_active_border : - control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border - color: control.pressed ? UM.Theme.colors.action_button_active : - control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button + border.width: UM.Theme.getSize("default_lining").width; + border.color: control.pressed ? UM.Theme.getColor("action_button_active_border") : + control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border") + color: control.pressed ? UM.Theme.getColor("action_button_active") : + control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") } label: Label { text: control.text; - color: UM.Theme.colors.setting_control_text; + color: UM.Theme.getColor("setting_control_text"); anchors.centerIn: parent } } @@ -181,7 +181,7 @@ Item { } Column { - width: view.width - UM.Theme.sizes.default_margin.width * 2; + width: view.width - UM.Theme.getSize("default_margin").width * 2; height: childrenRect.height; Repeater { @@ -212,11 +212,11 @@ Item { } label: Row { - spacing: UM.Theme.sizes.default_margin.width; + spacing: UM.Theme.getSize("default_margin").width; Image { anchors.verticalCenter: parent.verticalCenter; - source: control.checked ? UM.Theme.icons.arrow_right : UM.Theme.icons.arrow_bottom; + source: control.checked ? UM.Theme.getIcon("arrow_right") : UM.Theme.getIcon("arrow_bottom"); } Label { @@ -260,7 +260,7 @@ Item { delegate: ToolButton { id: button; - x: model.depth * UM.Theme.sizes.default_margin.width; + x: model.depth * UM.Theme.getSize("default_margin").width; text: model.name; tooltip: model.description; visible: !model.global_only diff --git a/plugins/USBPrinting/ControlWindow.qml b/plugins/USBPrinting/ControlWindow.qml index efe1e21b25..553da23fed 100644 --- a/plugins/USBPrinting/ControlWindow.qml +++ b/plugins/USBPrinting/ControlWindow.qml @@ -21,7 +21,7 @@ UM.Dialog anchors.fill: parent; Row { - spacing: UM.Theme.sizes.default_margin.width; + spacing: UM.Theme.getSize("default_margin").width; Text { //: USB Printing dialog label, %1 is head temperature diff --git a/resources/machines/fdmprinter.json b/resources/machines/fdmprinter.json index a346374b71..2786ca27fa 100644 --- a/resources/machines/fdmprinter.json +++ b/resources/machines/fdmprinter.json @@ -1221,7 +1221,7 @@ "buildplate": "Touching Buildplate", "everywhere": "Everywhere" }, - "default": "everywhere", + "default": "buildplate", "enabled": "support_enable" }, "support_angle": { @@ -1231,7 +1231,7 @@ "type": "float", "min_value": "0", "max_value": "90", - "default": 60, + "default": 50, "visible": false, "enabled": "support_enable" }, diff --git a/resources/machines/ultimaker2plus_025.json b/resources/machines/ultimaker2plus_025.json index b51af3cafc..d4ce8c9b4f 100644 --- a/resources/machines/ultimaker2plus_025.json +++ b/resources/machines/ultimaker2plus_025.json @@ -13,16 +13,6 @@ "overrides": { "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_min_volume": { "default": 0.17 } } diff --git a/resources/machines/ultimaker2plus_040.json b/resources/machines/ultimaker2plus_040.json index 1cb7383b18..33afefed12 100644 --- a/resources/machines/ultimaker2plus_040.json +++ b/resources/machines/ultimaker2plus_040.json @@ -12,9 +12,6 @@ "variant": "0.4 mm", "overrides": { - "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" } + "machine_nozzle_size": { "default": 0.40 } } } diff --git a/resources/machines/ultimaker2plus_060.json b/resources/machines/ultimaker2plus_060.json index 132fcfff45..4a4c8c8dd1 100644 --- a/resources/machines/ultimaker2plus_060.json +++ b/resources/machines/ultimaker2plus_060.json @@ -13,18 +13,6 @@ "overrides": { "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 } } } diff --git a/resources/machines/ultimaker2plus_080.json b/resources/machines/ultimaker2plus_080.json index 02d5607552..48a0f75d02 100644 --- a/resources/machines/ultimaker2plus_080.json +++ b/resources/machines/ultimaker2plus_080.json @@ -13,19 +13,6 @@ "overrides": { "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 } } } diff --git a/resources/qml/AboutDialog.qml b/resources/qml/AboutDialog.qml index 48ecdf0563..eb8795c5a6 100644 --- a/resources/qml/AboutDialog.qml +++ b/resources/qml/AboutDialog.qml @@ -24,7 +24,7 @@ UM.Dialog width: parent.width * 0.75 height: width * (1/4.25) - source: UM.Theme.images.logo + source: UM.Theme.getImage("logo") sourceSize.width: width sourceSize.height: height @@ -38,7 +38,7 @@ UM.Dialog id: version text: "Cura %1".arg(UM.Application.version) - font: UM.Theme.fonts.large + font: UM.Theme.getFont("large") anchors.horizontalCenter : logo.horizontalCenter anchors.horizontalCenterOffset : (logo.width * 0.25) anchors.top: logo.bottom diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index f4ed262e1e..cdd97b84cb 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -337,8 +337,8 @@ UM.MainWindow { bottom: parent.bottom; right: sidebar.left; - bottomMargin: UM.Theme.sizes.default_margin.height; - rightMargin: UM.Theme.sizes.default_margin.width; + bottomMargin: UM.Theme.getSize("default_margin").height; + rightMargin: UM.Theme.getSize("default_margin").width; } } @@ -347,7 +347,7 @@ UM.MainWindow anchors { horizontalCenter: parent.horizontalCenter - horizontalCenterOffset: -(UM.Theme.sizes.sidebar.width/ 2) + horizontalCenterOffset: -(UM.Theme.getSize("sidebar").width/ 2) top: parent.verticalCenter; bottom: parent.bottom; } @@ -361,10 +361,10 @@ UM.MainWindow //anchors.right: parent.right; //anchors.bottom: parent.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.bottom: buttons.top; - //anchors.bottomMargin: UM.Theme.sizes.default_margin.height; + //anchors.bottomMargin: UM.Theme.getSize("default_margin").height; height: childrenRect.height; @@ -376,15 +376,15 @@ UM.MainWindow id: openFileButton; //style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button; text: catalog.i18nc("@action:button","Open File"); - iconSource: UM.Theme.icons.load + iconSource: UM.Theme.getIcon("load") style: UM.Theme.styles.tool_button tooltip: ''; anchors { top: parent.top; - //topMargin: UM.Theme.sizes.loadfile_margin.height + //topMargin: UM.Theme.getSize("loadfile_margin").height left: parent.left; - //leftMargin: UM.Theme.sizes.loadfile_margin.width + //leftMargin: UM.Theme.getSize("loadfile_margin").width } action: actions.open; } @@ -395,14 +395,14 @@ UM.MainWindow anchors { left: parent.left - leftMargin: UM.Theme.sizes.default_margin.width; + leftMargin: UM.Theme.getSize("default_margin").width; bottom: parent.bottom - bottomMargin: UM.Theme.sizes.default_margin.height; + bottomMargin: UM.Theme.getSize("default_margin").height; } - source: UM.Theme.images.logo; - width: UM.Theme.sizes.logo.width; - height: UM.Theme.sizes.logo.height; + source: UM.Theme.getImage("logo"); + width: UM.Theme.getSize("logo").width; + height: UM.Theme.getSize("logo").height; z: -1; sourceSize.width: width; @@ -416,11 +416,11 @@ UM.MainWindow anchors { top: toolbar.bottom; - topMargin: UM.Theme.sizes.window_margin.height; + topMargin: UM.Theme.getSize("window_margin").height; left: parent.left; } text: catalog.i18nc("@action:button","View Mode"); - iconSource: UM.Theme.icons.viewmode; + iconSource: UM.Theme.getIcon("viewmode"); style: UM.Theme.styles.tool_button; tooltip: ''; @@ -453,7 +453,7 @@ UM.MainWindow anchors { top: openFileButton.bottom; - topMargin: UM.Theme.sizes.window_margin.height; + topMargin: UM.Theme.getSize("window_margin").height; left: parent.left; } } @@ -469,18 +469,28 @@ UM.MainWindow right: parent.right; } - width: UM.Theme.sizes.sidebar.width; + width: UM.Theme.getSize("sidebar").width; addMachineAction: actions.addMachine; configureMachinesAction: actions.configureMachines; addProfileAction: actions.addProfile; manageProfilesAction: actions.manageProfiles; + + configureSettingsAction: Action + { + onTriggered: + { + preferences.visible = true; + preferences.setPage(2); + preferences.getCurrentItem().scrollToSection(source.key); + } + } } Rectangle { - x: base.mouseX + UM.Theme.sizes.default_margin.width; - y: base.mouseY + UM.Theme.sizes.default_margin.height; + x: base.mouseX + UM.Theme.getSize("default_margin").width; + y: base.mouseY + UM.Theme.getSize("default_margin").height; width: childrenRect.width; 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. 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 - insertPage(1, catalog.i18nc("@title:tab","View"), viewPage); + insertPage(1, catalog.i18nc("@title:tab","View"), Qt.resolvedUrl("ViewPage.qml")); //Force refresh setPage(0) } - Item { - visible: false - GeneralPage + onVisibleChanged: + { + if(!visible) { - id: generalPage - } - - ViewPage - { - id: viewPage + // 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); } } } @@ -593,7 +600,7 @@ UM.MainWindow addMachine.onTriggered: addMachineWizard.visible = true; 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); } 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 { id: startupTimer; diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 81df2bb08a..bf3968329c 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -25,7 +25,7 @@ Rectangle { property variant printDuration: PrintInformation.currentPrintTime; property real printMaterialAmount: PrintInformation.materialAmount; - width: UM.Theme.sizes.jobspecs.width + width: UM.Theme.getSize("jobspecs").width height: childrenRect.height color: "transparent" @@ -80,7 +80,7 @@ Rectangle { id: jobNameRow anchors.top: parent.top anchors.right: parent.right - height: UM.Theme.sizes.jobspecs_line.height + height: UM.Theme.getSize("jobspecs_line").height visible: base.activity Item @@ -93,8 +93,8 @@ Rectangle { id: printJobPencilIcon anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - width: UM.Theme.sizes.save_button_specs_icons.width - height: UM.Theme.sizes.save_button_specs_icons.height + width: UM.Theme.getSize("save_button_specs_icons").width + height: UM.Theme.getSize("save_button_specs_icons").height onClicked: { @@ -108,12 +108,12 @@ Rectangle { color: "transparent" UM.RecolorImage { - width: UM.Theme.sizes.save_button_specs_icons.width - height: UM.Theme.sizes.save_button_specs_icons.height + width: UM.Theme.getSize("save_button_specs_icons").width + height: UM.Theme.getSize("save_button_specs_icons").height sourceSize.width: width sourceSize.height: width - color: control.hovered ? UM.Theme.colors.setting_control_button_hover : UM.Theme.colors.text - source: UM.Theme.icons.pencil; + color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("text"); + source: UM.Theme.getIcon("pencil"); } } } @@ -123,8 +123,8 @@ Rectangle { { id: printJobTextfield anchors.right: printJobPencilIcon.left - anchors.rightMargin: UM.Theme.sizes.default_margin.width/2 - height: UM.Theme.sizes.jobspecs_line.height + anchors.rightMargin: UM.Theme.getSize("default_margin").width/2 + height: UM.Theme.getSize("jobspecs_line").height width: base.width property int unremovableSpacing: 5 text: '' @@ -144,8 +144,8 @@ Rectangle { regExp: /^[^\\ \/ \.]*$/ } style: TextFieldStyle{ - textColor: UM.Theme.colors.setting_control_text; - font: UM.Theme.fonts.default_bold; + textColor: UM.Theme.getColor("setting_control_text"); + font: UM.Theme.getFont("default_bold"); background: Rectangle { opacity: 0 border.width: 0 @@ -159,10 +159,10 @@ Rectangle { id: boundingSpec anchors.top: jobNameRow.bottom anchors.right: parent.right - height: UM.Theme.sizes.jobspecs_line.height + height: UM.Theme.getSize("jobspecs_line").height verticalAlignment: Text.AlignVCenter - font: UM.Theme.fonts.small - color: UM.Theme.colors.text_subtext + font: UM.Theme.getFont("small") + color: UM.Theme.getColor("text_subtext") text: Printer.getSceneBoundingBoxString } @@ -170,7 +170,7 @@ Rectangle { id: specsRow anchors.top: boundingSpec.bottom anchors.right: parent.right - height: UM.Theme.sizes.jobspecs_line.height + height: UM.Theme.getSize("jobspecs_line").height Item{ width: parent.width @@ -179,42 +179,42 @@ Rectangle { UM.RecolorImage { id: timeIcon 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 - width: UM.Theme.sizes.save_button_specs_icons.width - height: UM.Theme.sizes.save_button_specs_icons.height + width: UM.Theme.getSize("save_button_specs_icons").width + height: UM.Theme.getSize("save_button_specs_icons").height sourceSize.width: width sourceSize.height: width - color: UM.Theme.colors.text_subtext - source: UM.Theme.icons.print_time; + color: UM.Theme.getColor("text_subtext") + source: UM.Theme.getIcon("print_time"); } Label{ id: timeSpec anchors.right: lengthIcon.left - anchors.rightMargin: UM.Theme.sizes.default_margin.width + anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter - font: UM.Theme.fonts.small - color: UM.Theme.colors.text_subtext + font: UM.Theme.getFont("small") + color: UM.Theme.getColor("text_subtext") text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short) } UM.RecolorImage { id: lengthIcon 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 - width: UM.Theme.sizes.save_button_specs_icons.width - height: UM.Theme.sizes.save_button_specs_icons.height + width: UM.Theme.getSize("save_button_specs_icons").width + height: UM.Theme.getSize("save_button_specs_icons").height sourceSize.width: width sourceSize.height: width - color: UM.Theme.colors.text_subtext - source: UM.Theme.icons.category_material; + color: UM.Theme.getColor("text_subtext") + source: UM.Theme.getIcon("category_material"); } Label{ id: lengthSpec anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - font: UM.Theme.fonts.small - color: UM.Theme.colors.text_subtext + font: UM.Theme.getFont("small") + color: UM.Theme.getColor("text_subtext") text: base.printMaterialAmount <= 0 ? catalog.i18nc("@label", "0.0 m") : catalog.i18nc("@label", "%1 m").arg(base.printMaterialAmount) } } diff --git a/resources/qml/ProfileSetup.qml b/resources/qml/ProfileSetup.qml index cf67a88108..e8d966ae40 100644 --- a/resources/qml/ProfileSetup.qml +++ b/resources/qml/ProfileSetup.qml @@ -18,18 +18,18 @@ Item{ Rectangle{ id: globalProfileRow anchors.top: base.top - height: UM.Theme.sizes.sidebar_setup.height + height: UM.Theme.getSize("sidebar_setup").height width: base.width Label{ id: globalProfileLabel anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.default_margin.width; + anchors.leftMargin: UM.Theme.getSize("default_margin").width; anchors.verticalCenter: parent.verticalCenter text: catalog.i18nc("@label","Profile:"); width: parent.width/100*45 - font: UM.Theme.fonts.default; - color: UM.Theme.colors.text; + font: UM.Theme.getFont("default"); + color: UM.Theme.getColor("text"); } @@ -37,9 +37,9 @@ Item{ id: globalProfileSelection text: UM.MachineManager.activeProfile width: parent.width/100*55 - height: UM.Theme.sizes.setting_control.height + height: UM.Theme.getSize("setting_control").height anchors.right: parent.right - anchors.rightMargin: UM.Theme.sizes.default_margin.width + anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter tooltip: UM.MachineManager.activeProfile style: UM.Theme.styles.sidebar_header_button diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index 1ec031aac8..f08fe6bab6 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -16,7 +16,7 @@ Rectangle { property int backendState: UM.Backend.state; property bool activity: Printer.getPlatformActivity; //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 statusText: { if(base.backendState == 0) { @@ -34,32 +34,32 @@ Rectangle { Label { 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.left: parent.left - anchors.leftMargin: UM.Theme.sizes.default_margin.width + anchors.leftMargin: UM.Theme.getSize("default_margin").width - color: UM.Theme.colors.text - font: UM.Theme.fonts.large + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("large") text: statusText; } Rectangle{ id: progressBar - width: parent.width - 2 * UM.Theme.sizes.default_margin.width - height: UM.Theme.sizes.progressbar.height + width: parent.width - 2 * UM.Theme.getSize("default_margin").width + height: UM.Theme.getSize("progressbar").height 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.leftMargin: UM.Theme.sizes.default_margin.width - radius: UM.Theme.sizes.progressbar_radius.width - color: UM.Theme.colors.progressbar_background + anchors.leftMargin: UM.Theme.getSize("default_margin").width + radius: UM.Theme.getSize("progressbar_radius").width + color: UM.Theme.getColor("progressbar_background") Rectangle{ width: Math.max(parent.width * base.progress) height: parent.height - color: UM.Theme.colors.progressbar_control - radius: UM.Theme.sizes.progressbar_radius.width + color: UM.Theme.getColor("progressbar_control") + radius: UM.Theme.getSize("progressbar_radius").width visible: base.backendState == 1 ? true : false } } @@ -69,18 +69,19 @@ Rectangle { width: base.width height: saveToButton.height anchors.top: progressBar.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.left: parent.left Button { 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; enabled: base.backendState == 2 && base.activity == true - height: UM.Theme.sizes.save_button_save_to_button.height - width: 150 + height: UM.Theme.getSize("save_button_save_to_button").height + anchors.top:parent.top + anchors.right: deviceSelectionMenu.left; + text: UM.OutputDeviceManager.activeDeviceShortDescription onClicked: { @@ -88,29 +89,27 @@ Rectangle { } style: ButtonStyle { - background: Rectangle { - //opacity: control.enabled ? 1.0 : 0.5 - //Behavior on opacity { NumberAnimation { duration: 50; } } - border.width: UM.Theme.sizes.default_lining.width - border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border : - control.pressed ? UM.Theme.colors.action_button_active_border : - control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border - color: !control.enabled ? UM.Theme.colors.action_button_disabled : - control.pressed ? UM.Theme.colors.action_button_active : - control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button + background: + Rectangle + { + border.width: UM.Theme.getSize("default_lining").width + border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") : + control.pressed ? UM.Theme.getColor("action_button_active_border") : + control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border") + color: !control.enabled ? UM.Theme.getColor("action_button_disabled") : + control.pressed ? UM.Theme.getColor("action_button_active") : + control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") Behavior on color { ColorAnimation { duration: 50; } } - width: { - saveToButton.resizedWidth = actualLabel.width + (UM.Theme.sizes.default_margin.width * 2) - return saveToButton.resizedWidth - } + + implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2) + Label { id: actualLabel - //Behavior on opacity { NumberAnimation { duration: 50; } } anchors.centerIn: parent - color: !control.enabled ? UM.Theme.colors.action_button_disabled_text : - control.pressed ? UM.Theme.colors.action_button_active_text : - control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text - font: UM.Theme.fonts.action_button + color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") : + control.pressed ? UM.Theme.getColor("action_button_active_text") : + control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text") + font: UM.Theme.getFont("action_button") text: control.text; } } @@ -123,39 +122,41 @@ Rectangle { tooltip: catalog.i18nc("@info:tooltip","Select the active output device"); anchors.top:parent.top anchors.right: parent.right - anchors.rightMargin: UM.Theme.sizes.default_margin.width - width: UM.Theme.sizes.save_button_save_to_button.height - height: UM.Theme.sizes.save_button_save_to_button.height + + anchors.rightMargin: UM.Theme.getSize("default_margin").width + 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 + //iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName]; style: ButtonStyle { background: Rectangle { id: deviceSelectionIcon - border.width: UM.Theme.sizes.default_lining.width - border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border : - control.pressed ? UM.Theme.colors.action_button_active_border : - control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border - color: !control.enabled ? UM.Theme.colors.action_button_disabled : - control.pressed ? UM.Theme.colors.action_button_active : - control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button + border.width: UM.Theme.getSize("default_lining").width + border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") : + control.pressed ? UM.Theme.getColor("action_button_active_border") : + control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border") + color: !control.enabled ? UM.Theme.getColor("action_button_disabled") : + control.pressed ? UM.Theme.getColor("action_button_active") : + control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") Behavior on color { ColorAnimation { duration: 50; } } 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 height: parent.height UM.RecolorImage { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: UM.Theme.sizes.standard_arrow.width - height: UM.Theme.sizes.standard_arrow.height + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height sourceSize.width: width sourceSize.height: height - color: !control.enabled ? UM.Theme.colors.action_button_disabled_text : - control.pressed ? UM.Theme.colors.action_button_active_text : - control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text; - source: UM.Theme.icons.arrow_bottom; + color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") : + control.pressed ? UM.Theme.getColor("action_button_active_text") : + control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text"); + source: UM.Theme.getIcon("arrow_bottom"); } } label: Label{ } diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 2778e9d779..742fadb34e 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -16,9 +16,10 @@ Rectangle property Action configureMachinesAction; property Action addProfileAction; property Action manageProfilesAction; + property Action configureSettingsAction; property int currentModeIndex; - color: UM.Theme.colors.sidebar; + color: UM.Theme.getColor("sidebar"); UM.I18nCatalog { id: catalog; name:"cura"} function showTooltip(item, position, text) @@ -56,10 +57,10 @@ Rectangle Rectangle { id: headerSeparator width: parent.width - height: UM.Theme.sizes.sidebar_lining.height - color: UM.Theme.colors.sidebar_lining + height: UM.Theme.getSize("sidebar_lining").height + color: UM.Theme.getColor("sidebar_lining") anchors.top: header.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height } ProfileSetup { @@ -67,7 +68,7 @@ Rectangle addProfileAction: base.addProfileAction manageProfilesAction: base.manageProfilesAction anchors.top: settingsModeSelection.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width height: totalHeightProfileSetup } @@ -94,22 +95,22 @@ Rectangle id: settingsModeLabel text: catalog.i18nc("@label:listbox","Setup"); 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.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width/100*45 - font: UM.Theme.fonts.large; - color: UM.Theme.colors.text + font: UM.Theme.getFont("large"); + color: UM.Theme.getColor("text") } Rectangle { id: settingsModeSelection 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.rightMargin: UM.Theme.sizes.default_margin.width + anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.top: headerSeparator.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height Component{ id: wizardDelegate Button { @@ -126,20 +127,20 @@ Rectangle style: ButtonStyle { background: Rectangle { - border.width: UM.Theme.sizes.default_lining.width - border.color: control.checked ? UM.Theme.colors.toggle_checked_border : - control.pressed ? UM.Theme.colors.toggle_active_border : - control.hovered ? UM.Theme.colors.toggle_hovered_border : UM.Theme.colors.toggle_unchecked_border - color: control.checked ? UM.Theme.colors.toggle_checked : - control.pressed ? UM.Theme.colors.toggle_active : - control.hovered ? UM.Theme.colors.toggle_hovered : UM.Theme.colors.toggle_unchecked + border.width: UM.Theme.getSize("default_lining").width + border.color: control.checked ? UM.Theme.getColor("toggle_checked_border") : + control.pressed ? UM.Theme.getColor("toggle_active_border") : + control.hovered ? UM.Theme.getColor("toggle_hovered_border") : UM.Theme.getColor("toggle_unchecked_border") + color: control.checked ? UM.Theme.getColor("toggle_checked") : + control.pressed ? UM.Theme.getColor("toggle_active") : + control.hovered ? UM.Theme.getColor("toggle_hovered") : UM.Theme.getColor("toggle_unchecked") Behavior on color { ColorAnimation { duration: 50; } } Label { anchors.centerIn: parent - color: control.checked ? UM.Theme.colors.toggle_checked_text : - control.pressed ? UM.Theme.colors.toggle_active_text : - control.hovered ? UM.Theme.colors.toggle_hovered_text : UM.Theme.colors.toggle_unchecked_text - font: UM.Theme.fonts.default + color: control.checked ? UM.Theme.getColor("toggle_checked_text") : + control.pressed ? UM.Theme.getColor("toggle_active_text") : + control.hovered ? UM.Theme.getColor("toggle_hovered_text") : UM.Theme.getColor("toggle_unchecked_text") + font: UM.Theme.getFont("default") text: control.text; } } @@ -165,7 +166,7 @@ Rectangle anchors.bottom: footerSeparator.top 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.right: base.right @@ -201,10 +202,10 @@ Rectangle Rectangle { id: footerSeparator width: parent.width - height: UM.Theme.sizes.sidebar_lining.height - color: UM.Theme.colors.sidebar_lining + height: UM.Theme.getSize("sidebar_lining").height + color: UM.Theme.getColor("sidebar_lining") anchors.bottom: saveButton.top - anchors.bottomMargin: UM.Theme.sizes.default_margin.height + anchors.bottomMargin: UM.Theme.getSize("default_margin").height } SaveButton @@ -239,7 +240,7 @@ Rectangle id: sidebarAdvanced; visible: false; - configureSettings: base.configureMachinesAction; + configureSettings: base.configureSettingsAction; onShowTooltip: base.showTooltip(item, location, text) onHideTooltip: base.hideTooltip() } diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index b1d54112bb..adc29a3daf 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -21,27 +21,27 @@ Item width: base.width height: 0 anchors.top: parent.top - color: UM.Theme.colors.sidebar_header_bar + color: UM.Theme.getColor("sidebar_header_bar") } Label{ id: printjobTabLabel text: catalog.i18nc("@label:listbox","Print Job"); 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.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width/100*45 - font: UM.Theme.fonts.large; - color: UM.Theme.colors.text + font: UM.Theme.getFont("large"); + color: UM.Theme.getColor("text") } Rectangle { id: machineSelectionRow width: base.width - height: UM.Theme.sizes.sidebar_setup.height + height: UM.Theme.getSize("sidebar_setup").height anchors.top: printjobTabLabel.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.horizontalCenter: parent.horizontalCenter Label{ @@ -49,20 +49,20 @@ Item //: Machine selection label text: catalog.i18nc("@label:listbox","Printer:"); anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.default_margin.width + anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter - font: UM.Theme.fonts.default; - color: UM.Theme.colors.text; + font: UM.Theme.getFont("default"); + color: UM.Theme.getColor("text"); } ToolButton { id: machineSelection text: UM.MachineManager.activeMachineInstance; width: parent.width/100*55 - height: UM.Theme.sizes.setting_control.height + height: UM.Theme.getSize("setting_control").height tooltip: UM.MachineManager.activeMachineInstance; anchors.right: parent.right - anchors.rightMargin: UM.Theme.sizes.default_margin.width + anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter style: UM.Theme.styles.sidebar_header_button @@ -97,30 +97,30 @@ Item Rectangle { id: variantRow 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 - 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 Label{ id: variantLabel text: catalog.i18nc("@label","Nozzle:"); anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.default_margin.width; + anchors.leftMargin: UM.Theme.getSize("default_margin").width; anchors.verticalCenter: parent.verticalCenter width: parent.width/100*45 - font: UM.Theme.fonts.default; - color: UM.Theme.colors.text; + font: UM.Theme.getFont("default"); + color: UM.Theme.getColor("text"); } ToolButton { id: variantSelection text: UM.MachineManager.activeMachineVariant width: parent.width/100*55 - height: UM.Theme.sizes.setting_control.height + height: UM.Theme.getSize("setting_control").height tooltip: UM.MachineManager.activeMachineVariant; anchors.right: parent.right - anchors.rightMargin: UM.Theme.sizes.default_margin.width + anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter style: UM.Theme.styles.sidebar_header_button @@ -161,30 +161,30 @@ Item Rectangle { id: materialSelectionRow anchors.top: variantRow.bottom - anchors.topMargin: UM.MachineManager.hasMaterials ? UM.Theme.sizes.default_margin.height : 0 + anchors.topMargin: UM.MachineManager.hasMaterials ? UM.Theme.getSize("default_margin").height : 0 width: base.width - height: UM.MachineManager.hasMaterials ? UM.Theme.sizes.sidebar_setup.height : 0 + height: UM.MachineManager.hasMaterials ? UM.Theme.getSize("sidebar_setup").height : 0 visible: UM.MachineManager.hasMaterials Label{ id: materialSelectionLabel text: catalog.i18nc("@label","Material:"); anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.default_margin.width; + anchors.leftMargin: UM.Theme.getSize("default_margin").width; anchors.verticalCenter: parent.verticalCenter width: parent.width/100*45 - font: UM.Theme.fonts.default; - color: UM.Theme.colors.text; + font: UM.Theme.getFont("default"); + color: UM.Theme.getColor("text"); } ToolButton { id: materialSelection text: UM.MachineManager.activeMaterial width: parent.width/100*55 - height: UM.Theme.sizes.setting_control.height + height: UM.Theme.getSize("setting_control").height tooltip: UM.MachineManager.activeMaterial; anchors.right: parent.right - anchors.rightMargin: UM.Theme.sizes.default_margin.width + anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter style: UM.Theme.styles.sidebar_header_button diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index c51b07b1f4..c877b67f5b 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -27,19 +27,19 @@ Item id: infillCellLeft anchors.top: parent.top 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 Label{ id: infillLabel //: Infill selection label text: catalog.i18nc("@label","Infill:"); - font: UM.Theme.fonts.default; - color: UM.Theme.colors.text; + font: UM.Theme.getFont("default"); + color: UM.Theme.getColor("text"); 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.leftMargin: UM.Theme.sizes.default_margin.width + anchors.leftMargin: UM.Theme.getSize("default_margin").width } } @@ -48,7 +48,7 @@ Item height: childrenRect.height; width: base.width / 100 * 65 - spacing: UM.Theme.sizes.default_margin.width + spacing: UM.Theme.getSize("default_margin").width anchors.left: infillCellLeft.right anchors.top: infillCellLeft.top @@ -81,23 +81,32 @@ Item Rectangle{ 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 - border.color: (infillListView.activeIndex == index) ? UM.Theme.colors.setting_control_selected : - (mousearea.containsMouse ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border) - border.width: UM.Theme.sizes.default_lining.width - color: infillListView.activeIndex == index ? UM.Theme.colors.setting_control_selected : "transparent" + border.color: { + if(infillListView.activeIndex == index) + { + 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 { id: infillIcon 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.height: width - source: UM.Theme.icons[model.icon]; - color: (infillListView.activeIndex == index) ? UM.Theme.colors.text_white : UM.Theme.colors.text + source: UM.Theme.getIcon(model.icon); + color: (infillListView.activeIndex == index) ? UM.Theme.getColor("text_white") : UM.Theme.getColor("text") } MouseArea { @@ -122,7 +131,7 @@ Item id: infillLabel anchors.top: infillIconLining.bottom 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 } } @@ -172,25 +181,25 @@ Item Rectangle { id: helpersCellLeft anchors.top: infillCellRight.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height 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 Label{ anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.default_margin.width + anchors.leftMargin: UM.Theme.getSize("default_margin").width //: Helpers selection label text: catalog.i18nc("@label:listbox","Helpers:"); - font: UM.Theme.fonts.default; - color: UM.Theme.colors.text; + font: UM.Theme.getFont("default"); + color: UM.Theme.getColor("text"); } } Rectangle { id: helpersCellRight anchors.top: helpersCellLeft.top 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 CheckBox{ @@ -230,7 +239,7 @@ Item property bool hovered_ex: false anchors.top: brimCheckBox.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.left: parent.left //: Setting enable support checkbox diff --git a/resources/qml/SidebarTooltip.qml b/resources/qml/SidebarTooltip.qml index c51a33c611..1c7f4bcb76 100644 --- a/resources/qml/SidebarTooltip.qml +++ b/resources/qml/SidebarTooltip.qml @@ -11,11 +11,11 @@ import UM 1.0 as UM UM.PointingRectangle { id: base; - width: UM.Theme.sizes.tooltip.width; - height: label.height + UM.Theme.sizes.tooltip_margins.height * 2; - color: UM.Theme.colors.tooltip; + width: UM.Theme.getSize("tooltip").width; + height: label.height + UM.Theme.getSize("tooltip_margins").height * 2; + color: UM.Theme.getColor("tooltip"); - arrowSize: UM.Theme.sizes.default_arrow.width + arrowSize: UM.Theme.getSize("default_arrow").width opacity: 0; Behavior on opacity { NumberAnimation { duration: 100; } } @@ -28,7 +28,7 @@ UM.PointingRectangle { y = parent.height - base.height; } else { 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; target = Qt.point(40 , position.y) @@ -42,14 +42,14 @@ UM.PointingRectangle { id: label; anchors { top: parent.top; - topMargin: UM.Theme.sizes.tooltip_margins.height; + topMargin: UM.Theme.getSize("tooltip_margins").height; left: parent.left; - leftMargin: UM.Theme.sizes.tooltip_margins.width; + leftMargin: UM.Theme.getSize("tooltip_margins").width; right: parent.right; - rightMargin: UM.Theme.sizes.tooltip_margins.width; + rightMargin: UM.Theme.getSize("tooltip_margins").width; } wrapMode: Text.Wrap; - font: UM.Theme.fonts.default; - color: UM.Theme.colors.tooltip_text; + font: UM.Theme.getFont("default"); + color: UM.Theme.getColor("tooltip_text"); } } diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 46bafb9296..ff223cb38f 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -20,7 +20,7 @@ Item { anchors.bottom: parent.bottom; anchors.left: parent.left; - spacing: UM.Theme.sizes.button_lining.width + spacing: UM.Theme.getSize("button_lining").width Repeater { id: repeat @@ -29,7 +29,7 @@ Item { Button { text: model.name - iconSource: UM.Theme.icons[model.icon]; + iconSource: UM.Theme.getIcon(model.icon); checkable: true; checked: model.active; @@ -54,47 +54,47 @@ Item { id: panelBorder; 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.topMargin: base.activeY z: buttons.z -1 - target: Qt.point(parent.right, base.activeY + UM.Theme.sizes.button.height/2) - arrowSize: UM.Theme.sizes.default_arrow.width + target: Qt.point(parent.right, base.activeY + UM.Theme.getSize("button").height/2) + arrowSize: UM.Theme.getSize("default_arrow").width width: { 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 { 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 Behavior on opacity { NumberAnimation { duration: 100 } } - color: UM.Theme.colors.lining; - //border.width: UM.Theme.sizes.default_lining.width - //border.color: UM.Theme.colors.lining + color: UM.Theme.getColor("lining"); + //border.width: UM.Theme.getSize("default_lining").width + //border.color: UM.Theme.getColor("lining") UM.PointingRectangle { id: panelBackground; - color: UM.Theme.colors.tool_panel_background; + color: UM.Theme.getColor("tool_panel_background"); 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 } Loader { id: panel - x: UM.Theme.sizes.default_margin.width; - y: UM.Theme.sizes.default_margin.height; + x: UM.Theme.getSize("default_margin").width; + y: UM.Theme.getSize("default_margin").height; source: UM.ActiveTool.valid ? UM.ActiveTool.activeToolPanel : ""; enabled: UM.Controller.toolsEnabled; diff --git a/resources/qml/WizardPages/AddMachine.qml b/resources/qml/WizardPages/AddMachine.qml index 9bce4f3210..1a85ddd861 100644 --- a/resources/qml/WizardPages/AddMachine.qml +++ b/resources/qml/WizardPages/AddMachine.qml @@ -98,12 +98,12 @@ Item background: Rectangle { border.width: 0 color: "transparent"; - height: UM.Theme.sizes.standard_list_lineheight.height + height: UM.Theme.getSize("standard_list_lineheight").height width: machineList.width } label: Text { 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 color: palette.windowText font.bold: true @@ -111,13 +111,13 @@ Item id: downArrow anchors.verticalCenter: parent.verticalCenter anchors.right: parent.left - anchors.rightMargin: UM.Theme.sizes.default_margin.width - width: UM.Theme.sizes.standard_arrow.width - height: UM.Theme.sizes.standard_arrow.height + anchors.rightMargin: UM.Theme.getSize("default_margin").width + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height sourceSize.width: width sourceSize.height: width 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 anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.width + anchors.leftMargin: UM.Theme.getSize("standard_list_lineheight").width opacity: 1; - height: UM.Theme.sizes.standard_list_lineheight.height; + height: UM.Theme.getSize("standard_list_lineheight").height; checked: ListView.isCurrentItem; @@ -183,6 +183,25 @@ Item id: machineNameHolder 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 { id: insertNameLabel @@ -192,7 +211,7 @@ Item { id: machineName; text: getMachineName() - implicitWidth: UM.Theme.sizes.standard_list_input.width + implicitWidth: UM.Theme.getSize("standard_list_input").width } } diff --git a/resources/qml/WizardPages/Bedleveling.qml b/resources/qml/WizardPages/Bedleveling.qml index a6c471341c..18b58497b2 100644 --- a/resources/qml/WizardPages/Bedleveling.qml +++ b/resources/qml/WizardPages/Bedleveling.qml @@ -47,7 +47,7 @@ Item { id: pageDescription anchors.top: pageTitle.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width 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.") @@ -56,7 +56,7 @@ Item { id: bedlevelingText anchors.top: pageDescription.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width 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.") @@ -65,10 +65,10 @@ Item Item{ id: bedlevelingWrapper anchors.top: bedlevelingText.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.horizontalCenter: parent.horizontalCenter 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 { id: bedlevelingButton @@ -103,9 +103,9 @@ Item { id: skipBedlevelingButton 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.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"); onClicked: base.visible = false; } @@ -116,7 +116,7 @@ Item id: resultText visible: false anchors.top: bedlevelingWrapper.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.left: parent.left width: parent.width wrapMode: Text.WordWrap diff --git a/resources/qml/WizardPages/SelectUpgradedParts.qml b/resources/qml/WizardPages/SelectUpgradedParts.qml index c8ccc4fe8d..4a327a6ed4 100644 --- a/resources/qml/WizardPages/SelectUpgradedParts.qml +++ b/resources/qml/WizardPages/SelectUpgradedParts.qml @@ -36,7 +36,7 @@ Item { id: pageDescription anchors.top: pageTitle.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width 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:") @@ -47,10 +47,10 @@ Item id: pageCheckboxes height: childrenRect.height 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.topMargin: UM.Theme.sizes.default_margin.height - width: parent.width - UM.Theme.sizes.default_margin.width + anchors.topMargin: UM.Theme.getSize("default_margin").height + width: parent.width - UM.Theme.getSize("default_margin").width CheckBox { id: extruderCheckBox @@ -85,7 +85,7 @@ Item { width: parent.width anchors.top: pageCheckboxes.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height 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"); } diff --git a/resources/qml/WizardPages/UltimakerCheckup.qml b/resources/qml/WizardPages/UltimakerCheckup.qml index db538ed7d6..b8c8aebe12 100644 --- a/resources/qml/WizardPages/UltimakerCheckup.qml +++ b/resources/qml/WizardPages/UltimakerCheckup.qml @@ -78,7 +78,7 @@ Item { id: pageDescription anchors.top: pageTitle.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width 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"); @@ -87,10 +87,10 @@ Item Item{ id: startStopButtons anchors.top: pageDescription.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.horizontalCenter: parent.horizontalCenter 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 { id: startCheckButton @@ -109,9 +109,9 @@ Item { id: skipCheckButton 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.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 text: catalog.i18nc("@action:button","Skip Printer Check"); onClicked: { @@ -123,7 +123,7 @@ Item Item{ id: checkupContent anchors.top: startStopButtons.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height visible: false ////////////////////////////////////////////////////////// Label @@ -227,7 +227,7 @@ Item height: nozzleTemp.height anchors.top: nozzleTempLabel.top anchors.left: bedTempStatus.right - anchors.leftMargin: UM.Theme.sizes.default_margin.width/2 + anchors.leftMargin: UM.Theme.getSize("default_margin").width/2 Button { height: nozzleTemp.height - 2 @@ -250,7 +250,7 @@ Item id: nozzleTemp anchors.top: nozzleTempLabel.top 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 wrapMode: Text.WordWrap text: printer_connection != null ? printer_connection.extruderTemperature + "°C" : "0°C" @@ -283,7 +283,7 @@ Item height: bedTemp.height anchors.top: bedTempLabel.top anchors.left: bedTempStatus.right - anchors.leftMargin: UM.Theme.sizes.default_margin.width/2 + anchors.leftMargin: UM.Theme.getSize("default_margin").width/2 Button { height: bedTemp.height - 2 @@ -307,7 +307,7 @@ Item width: wizardPage.rightRow * 0.2 anchors.top: bedTempLabel.top anchors.left: bedTempButton.right - anchors.leftMargin: UM.Theme.sizes.default_margin.width + anchors.leftMargin: UM.Theme.getSize("default_margin").width wrapMode: Text.WordWrap text: printer_connection != null ? printer_connection.bedTemperature + "°C": "0°C" font.bold: true @@ -317,7 +317,7 @@ Item id: resultText visible: false anchors.top: bedTemp.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.left: parent.left width: parent.width wrapMode: Text.WordWrap diff --git a/resources/qml/WizardPages/UpgradeFirmware.qml b/resources/qml/WizardPages/UpgradeFirmware.qml index f7031febe3..4bbb049f20 100644 --- a/resources/qml/WizardPages/UpgradeFirmware.qml +++ b/resources/qml/WizardPages/UpgradeFirmware.qml @@ -27,7 +27,7 @@ Item { id: pageDescription anchors.top: pageTitle.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width 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.") @@ -37,7 +37,7 @@ Item { id: upgradeText1 anchors.top: pageDescription.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width 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."); @@ -47,16 +47,16 @@ Item { id: upgradeText2 anchors.top: upgradeText1.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width 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."); } Item{ anchors.top: upgradeText2.bottom - anchors.topMargin: UM.Theme.sizes.default_margin.height + anchors.topMargin: UM.Theme.getSize("default_margin").height 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 { id: upgradeButton anchors.top: parent.top @@ -67,9 +67,9 @@ Item Button { id: skipUpgradeButton 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.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"); onClicked: { base.currentPage += 1 diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 0f39bea005..d1cd8d1872 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -5,37 +5,37 @@ import QtQuick 2.1 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 -import UM 1.0 as UM +import UM 1.1 as UM QtObject { property Component sidebar_header_button: Component { ButtonStyle { background: Rectangle { - color: UM.Theme.colors.setting_control - border.width: UM.Theme.sizes.default_lining.width - border.color: control.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border + color: Theme.getColor("setting_control") + border.width: Theme.getSize("default_lining").width + border.color: control.hovered ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border") UM.RecolorImage { id: downArrow anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: UM.Theme.sizes.default_margin.width - width: UM.Theme.sizes.standard_arrow.width - height: UM.Theme.sizes.standard_arrow.height + anchors.rightMargin: Theme.getSize("default_margin").width + width: Theme.getSize("standard_arrow").width + height: Theme.getSize("standard_arrow").height sourceSize.width: width sourceSize.height: width - color: UM.Theme.colors.setting_category_text - source: UM.Theme.icons.arrow_bottom + color: Theme.getColor("setting_category_text") + source: Theme.getIcon("arrow_bottom") } Label { id: sidebarComboBoxLabel - color: UM.Theme.colors.setting_control_text + color: Theme.getColor("setting_control_text") text: control.text; elide: Text.ElideRight; 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.verticalCenter: parent.verticalCenter; - font: UM.Theme.fonts.default + font: Theme.getFont("default") } } label: Label{} @@ -45,23 +45,23 @@ QtObject { property Component tool_button: Component { ButtonStyle { background: Item { - implicitWidth: UM.Theme.sizes.button.width; - implicitHeight: UM.Theme.sizes.button.height; + implicitWidth: Theme.getSize("button").width; + implicitHeight: Theme.getSize("button").height; UM.PointingRectangle { id: button_tooltip 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 target: Qt.point(parent.x, y + height/2) - arrowSize: UM.Theme.sizes.button_tooltip_arrow.width - color: UM.Theme.colors.tooltip + arrowSize: Theme.getSize("button_tooltip_arrow").width + color: Theme.getColor("tooltip") opacity: control.hovered ? 1.0 : 0.0; - width: control.hovered ? button_tip.width + UM.Theme.sizes.button_tooltip.width : 0 - height: UM.Theme.sizes.button_tooltip.height + width: control.hovered ? button_tip.width + Theme.getSize("button_tooltip").width : 0 + height: Theme.getSize("button_tooltip").height Behavior on width { NumberAnimation { duration: 100; } } Behavior on opacity { NumberAnimation { duration: 100; } } @@ -73,8 +73,8 @@ QtObject { anchors.verticalCenter: parent.verticalCenter; text: control.text; - font: UM.Theme.fonts.button_tooltip; - color: UM.Theme.colors.tooltip_text; + font: Theme.getFont("button_tooltip"); + color: Theme.getColor("tooltip_text"); } } @@ -86,13 +86,13 @@ QtObject { color: { 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)) { - return UM.Theme.colors.button_active; + return Theme.getColor("button_active"); } else if(control.hovered) { - return UM.Theme.colors.button_hover; + return Theme.getColor("button_hover"); } else { - return UM.Theme.colors.button; + return Theme.getColor("button"); } } Behavior on color { ColorAnimation { duration: 50; } } @@ -102,16 +102,16 @@ QtObject { id: tool_button_arrow opacity: !control.enabled ? 0.2 : 1.0 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.bottomMargin: (UM.Theme.sizes.button.height - UM.Theme.sizes.button_icon.height) / 4 - width: UM.Theme.sizes.standard_arrow.width - height: UM.Theme.sizes.standard_arrow.height + anchors.bottomMargin: (Theme.getSize("button").height - Theme.getSize("button_icon").height) / 4 + width: Theme.getSize("standard_arrow").width + height: Theme.getSize("standard_arrow").height sourceSize.width: width sourceSize.height: width visible: control.menu != null; - color: UM.Theme.colors.button_text - source: UM.Theme.icons.arrow_bottom + color: Theme.getColor("button_text") + source: Theme.getIcon("arrow_bottom") } } } @@ -121,37 +121,36 @@ QtObject { anchors.centerIn: parent; opacity: !control.enabled ? 0.2 : 1.0 source: control.iconSource; - width: UM.Theme.sizes.button_icon.width; - height: UM.Theme.sizes.button_icon.height; + width: Theme.getSize("button_icon").width; + height: Theme.getSize("button_icon").height; - sourceSize: UM.Theme.sizes.button_icon + sourceSize: Theme.getSize("button_icon") } } } } - property Component progressbar: Component{ ProgressBarStyle { background:Rectangle { - implicitWidth: UM.Theme.sizes.message.width - (UM.Theme.sizes.default_margin.width * 2) - implicitHeight: UM.Theme.sizes.progressbar.height - radius: UM.Theme.sizes.progressbar_radius.width - color: UM.Theme.colors.progressbar_background + implicitWidth: Theme.getSize("message").width - (Theme.getSize("default_margin").width * 2) + implicitHeight: Theme.getSize("progressbar").height + radius: Theme.getSize("progressbar_radius").width + color: Theme.getColor("progressbar_background") } progress: Rectangle { - color: control.indeterminate ? "transparent" : UM.Theme.colors.progressbar_control - radius: UM.Theme.sizes.progressbar_radius.width + color: control.indeterminate ? "transparent" : Theme.getColor("progressbar_control") + radius: Theme.getSize("progressbar_radius").width Rectangle{ - radius: UM.Theme.sizes.progressbar_radius.width - color: UM.Theme.colors.progressbar_control - width: UM.Theme.sizes.progressbar_control.width - height: UM.Theme.sizes.progressbar_control.height + radius: Theme.getSize("progressbar_radius").width + color: Theme.getColor("progressbar_control") + width: Theme.getSize("progressbar_control").width + height: Theme.getSize("progressbar_control").height visible: control.indeterminate SequentialAnimation on x { 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 loops: Animation.Infinite NumberAnimation { from: 0; to: xAnim.animEndPoint; duration: 2000;} @@ -162,48 +161,46 @@ QtObject { } } - - property Component sidebar_category: Component { ButtonStyle { background: Rectangle { anchors.fill: parent; anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.default_margin.width + anchors.leftMargin: Theme.getSize("default_margin").width anchors.right: parent.right - anchors.rightMargin: UM.Theme.sizes.default_margin.width - implicitHeight: UM.Theme.sizes.section.height; + anchors.rightMargin: Theme.getSize("default_margin").width + implicitHeight: Theme.getSize("section").height; color: { if(control.color) { return control.color; } 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) { - return UM.Theme.colors.setting_category_active_hover; + return Theme.getColor("setting_category_active_hover"); } 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) { - return UM.Theme.colors.setting_category_hover; + return Theme.getColor("setting_category_hover"); } else { - return UM.Theme.colors.setting_category; + return Theme.getColor("setting_category"); } } Behavior on color { ColorAnimation { duration: 50; } } Rectangle { - height: UM.Theme.sizes.default_lining.height + height: Theme.getSize("default_lining").height width: parent.width anchors.bottom: parent.bottom color: { 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) { - 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)) { - return UM.Theme.colors.setting_category_active_border; + return Theme.getColor("setting_category_active_border"); } else if(control.hovered) { - return UM.Theme.colors.setting_category_hover_border; + return Theme.getColor("setting_category_hover_border"); } else { - return UM.Theme.colors.setting_category_border; + return Theme.getColor("setting_category_border"); } } } @@ -215,15 +212,15 @@ QtObject { id: icon; anchors.left: parent.left height: parent.height - width: UM.Theme.sizes.section_icon_column.width + width: Theme.getSize("section_icon_column").width UM.RecolorImage { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left - anchors.leftMargin: UM.Theme.sizes.default_margin.width - color: UM.Theme.colors.setting_category_text + anchors.leftMargin: Theme.getSize("default_margin").width + color: Theme.getColor("setting_category_text") source: control.iconSource; - width: UM.Theme.sizes.section_icon.width; - height: UM.Theme.sizes.section_icon.height; + width: Theme.getSize("section_icon").width; + height: Theme.getSize("section_icon").height; sourceSize.width: width + 15 sourceSize.height: width + 15 } @@ -232,13 +229,13 @@ QtObject { Label { anchors { left: icon.right; - leftMargin: UM.Theme.sizes.default_lining.width; + leftMargin: Theme.getSize("default_lining").width; right: parent.right; verticalCenter: parent.verticalCenter; } text: control.text; - font: UM.Theme.fonts.setting_category; - color: UM.Theme.colors.setting_category_text; + font: Theme.getFont("setting_category"); + color: Theme.getColor("setting_category_text"); fontSizeMode: Text.HorizontalFit; minimumPointSize: 8 } @@ -246,13 +243,13 @@ QtObject { id: category_arrow anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: UM.Theme.sizes.default_margin.width * 2 - width / 2 - width: UM.Theme.sizes.standard_arrow.width - height: UM.Theme.sizes.standard_arrow.height + anchors.rightMargin: Theme.getSize("default_margin").width * 2 - width / 2 + width: Theme.getSize("standard_arrow").width + height: Theme.getSize("standard_arrow").height sourceSize.width: width sourceSize.height: width - color: UM.Theme.colors.setting_category_text - source: control.checked ? UM.Theme.icons.arrow_bottom : UM.Theme.icons.arrow_left + color: Theme.getColor("setting_category_text") + source: control.checked ? Theme.getIcon("arrow_bottom") : Theme.getIcon("arrow_left") } } } @@ -266,62 +263,62 @@ QtObject { transientScrollBars: false scrollBarBackground: Rectangle { - implicitWidth: UM.Theme.sizes.scrollbar.width + implicitWidth: Theme.getSize("scrollbar").width radius: implicitWidth / 2 - color: UM.Theme.colors.scrollbar_background; + color: Theme.getColor("scrollbar_background"); } handle: Rectangle { id: scrollViewHandle - implicitWidth: UM.Theme.sizes.scrollbar.width; + implicitWidth: Theme.getSize("scrollbar").width; 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; } } } } } property variant setting_item: UM.SettingItemStyle { - labelFont: UM.Theme.fonts.default; - labelColor: UM.Theme.colors.setting_control_text; + labelFont: Theme.getFont("default"); + labelColor: Theme.getColor("setting_control_text"); - spacing: UM.Theme.sizes.default_lining.height; - fixedHeight: UM.Theme.sizes.setting.height; + spacing: Theme.getSize("default_lining").height; + fixedHeight: Theme.getSize("setting").height; - controlWidth: UM.Theme.sizes.setting_control.width; - controlRightMargin: UM.Theme.sizes.setting_control_margin.width; - controlColor: UM.Theme.colors.setting_control; - controlHighlightColor: UM.Theme.colors.setting_control_highlight; - controlBorderColor: UM.Theme.colors.setting_control_border; - controlBorderHighlightColor: UM.Theme.colors.setting_control_border_highlight; - controlTextColor: UM.Theme.colors.setting_control_text; - controlBorderWidth: UM.Theme.sizes.default_lining.width; - controlFont: UM.Theme.fonts.default; + controlWidth: Theme.getSize("setting_control").width; + controlRightMargin: Theme.getSize("setting_control_margin").width; + controlColor: Theme.getColor("setting_control"); + controlHighlightColor: Theme.getColor("setting_control_highlight"); + controlBorderColor: Theme.getColor("setting_control_border"); + controlBorderHighlightColor: Theme.getColor("setting_control_border_highlight"); + controlTextColor: Theme.getColor("setting_control_text"); + controlBorderWidth: Theme.getSize("default_lining").width; + controlFont: Theme.getFont("default"); - validationErrorColor: UM.Theme.colors.setting_validation_error; - validationWarningColor: UM.Theme.colors.setting_validation_warning; - validationOkColor: UM.Theme.colors.setting_validation_ok; + validationErrorColor: Theme.getColor("setting_validation_error"); + validationWarningColor: Theme.getColor("setting_validation_warning"); + validationOkColor: Theme.getColor("setting_validation_ok"); - unitRightMargin: UM.Theme.sizes.setting_unit_margin.width; - unitColor: UM.Theme.colors.setting_unit; - unitFont: UM.Theme.fonts.default; + unitRightMargin: Theme.getSize("setting_unit_margin").width; + unitColor: Theme.getColor("setting_unit"); + unitFont: Theme.getFont("default"); } property Component checkbox: Component { CheckBoxStyle { background: Item { } indicator: Rectangle { - implicitWidth: UM.Theme.sizes.checkbox.width; - implicitHeight: UM.Theme.sizes.checkbox.height; + implicitWidth: Theme.getSize("checkbox").width; + 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; } } - 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.color: (control.hovered || control.hovered_ex) ? UM.Theme.colors.checkbox_border_hover : UM.Theme.colors.checkbox_border; + border.width: Theme.getSize("default_lining").width; + border.color: (control.hovered || control.hovered_ex) ? Theme.getColor("checkbox_border_hover") : Theme.getColor("checkbox_border"); UM.RecolorImage { anchors.verticalCenter: parent.verticalCenter @@ -330,16 +327,16 @@ QtObject { height: parent.height/2.5 sourceSize.width: width sourceSize.height: width - color: UM.Theme.colors.checkbox_mark - source: control.exclusiveGroup ? UM.Theme.icons.dot : UM.Theme.icons.check + color: Theme.getColor("checkbox_mark") + source: control.exclusiveGroup ? Theme.getIcon("dot") : Theme.getIcon("check") opacity: control.checked Behavior on opacity { NumberAnimation { duration: 100; } } } } label: Label { text: control.text; - color: UM.Theme.colors.checkbox_text; - font: UM.Theme.fonts.default; + color: Theme.getColor("checkbox_text"); + font: Theme.getFont("default"); } } } @@ -348,11 +345,11 @@ QtObject { SliderStyle { groove: Rectangle { implicitWidth: control.width; - implicitHeight: UM.Theme.sizes.slider_groove.height; + implicitHeight: Theme.getSize("slider_groove").height; - color: UM.Theme.colors.slider_groove; - border.width: UM.Theme.sizes.default_lining.width; - border.color: UM.Theme.colors.slider_groove_border; + color: Theme.getColor("slider_groove"); + border.width: Theme.getSize("default_lining").width; + border.color: Theme.getColor("slider_groove_border"); Rectangle { anchors { @@ -360,14 +357,14 @@ QtObject { top: parent.top; 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; } } handle: Rectangle { - width: UM.Theme.sizes.slider_handle.width; - height: UM.Theme.sizes.slider_handle.height; - color: control.hovered ? UM.Theme.colors.slider_handle_hover : UM.Theme.colors.slider_handle; + width: Theme.getSize("slider_handle").width; + height: Theme.getSize("slider_handle").height; + color: control.hovered ? Theme.getColor("slider_handle_hover") : Theme.getColor("slider_handle"); Behavior on color { ColorAnimation { duration: 50; } } } } @@ -378,28 +375,28 @@ QtObject { groove: Rectangle { id: layerSliderGroove implicitWidth: control.width; - implicitHeight: UM.Theme.sizes.slider_groove.height; + implicitHeight: Theme.getSize("slider_groove").height; radius: width/2; - color: UM.Theme.colors.slider_groove; - border.width: UM.Theme.sizes.default_lining.width; - border.color: UM.Theme.colors.slider_groove_border; + color: Theme.getColor("slider_groove"); + border.width: Theme.getSize("default_lining").width; + border.color: Theme.getColor("slider_groove_border"); Rectangle { anchors { left: parent.left; top: parent.top; 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; radius: width/2 } } handle: Rectangle { id: layerSliderControl - width: UM.Theme.sizes.slider_handle.width; - height: UM.Theme.sizes.slider_handle.height; - color: control.hovered ? UM.Theme.colors.slider_handle_hover : UM.Theme.colors.slider_handle; + width: Theme.getSize("slider_handle").width; + height: Theme.getSize("slider_handle").height; + color: control.hovered ? Theme.getColor("slider_handle_hover") : Theme.getColor("slider_handle"); Behavior on color { ColorAnimation { duration: 50; } } TextField { id: valueLabel @@ -414,17 +411,17 @@ QtObject { validator: IntValidator {bottom: 1; top: control.maximumValue + 1;} visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false 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 rotation: 90 style: TextFieldStyle{ - textColor: UM.Theme.colors.setting_control_text; - font: UM.Theme.fonts.default; + textColor: Theme.getColor("setting_control_text"); + font: Theme.getFont("default"); background: Rectangle { - implicitWidth: control.maxValue.length * valueLabel.font.pixelSize + UM.Theme.sizes.default_margin.width - implicitHeight: UM.Theme.sizes.slider_handle.height + UM.Theme.sizes.default_margin.width - border.width: UM.Theme.sizes.default_lining.width; - border.color: UM.Theme.colors.slider_groove_border; + implicitWidth: control.maxValue.length * valueLabel.font.pixelSize + Theme.getSize("default_margin").width + implicitHeight: Theme.getSize("slider_handle").height + Theme.getSize("default_margin").width + border.width: Theme.getSize("default_lining").width; + border.color: Theme.getColor("slider_groove_border"); } } } @@ -434,27 +431,27 @@ QtObject { property Component text_field: Component { TextFieldStyle { - textColor: UM.Theme.colors.setting_control_text; - font: UM.Theme.fonts.default; + textColor: Theme.getColor("setting_control_text"); + font: Theme.getFont("default"); background: Rectangle { implicitHeight: control.height; implicitWidth: control.width; - border.width: UM.Theme.sizes.default_lining.width; - border.color: control.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border; + border.width: Theme.getSize("default_lining").width; + 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 { 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; text: control.unit ? control.unit : "" - color: UM.Theme.colors.setting_unit; - font: UM.Theme.fonts.default; + color: Theme.getColor("setting_unit"); + font: Theme.getFont("default"); } } }