From 89a035bab4b51a0fa0badc42298858e3e1606580 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 25 Mar 2015 13:36:40 +0100 Subject: [PATCH] Rename Theme to Styles to allow for the introduction of a proper Theme object --- qml/AddMachineWizard.qml | 2 +- qml/FilePane.qml | 4 ++-- qml/OutputGCodeButton.qml | 8 ++++---- qml/Printer.qml | 20 +++++++++++--------- qml/PrinterToolbar.qml | 20 ++++++++++---------- qml/SettingsPane.qml | 14 +++++++------- 6 files changed, 35 insertions(+), 33 deletions(-) diff --git a/qml/AddMachineWizard.qml b/qml/AddMachineWizard.qml index fc8dd4d4be..e3aa6c4457 100644 --- a/qml/AddMachineWizard.qml +++ b/qml/AddMachineWizard.qml @@ -20,7 +20,7 @@ Window { ColumnLayout { anchors.fill: parent; - anchors.margins: UM.Theme.defaultMargin; + anchors.margins: UM.Styles.defaultMargin; Label { text: qsTr("Please select the type of printer:"); diff --git a/qml/FilePane.qml b/qml/FilePane.qml index df2d4745c2..83d9c6845e 100644 --- a/qml/FilePane.qml +++ b/qml/FilePane.qml @@ -26,7 +26,7 @@ Rectangle { ColumnLayout { anchors.fill: parent; - anchors.margins: UM.Theme.defaultMargin; + anchors.margins: UM.Styles.defaultMargin; //: Open file button Button { text: qsTr("Open File"); iconSource: UM.Resources.getIcon("open.png"); Layout.fillWidth: true; onClicked: base.requestOpenFile(); } @@ -70,7 +70,7 @@ Rectangle { Label { anchors.verticalCenter: parent.verticalCenter; anchors.left: parent.left; - anchors.leftMargin: UM.Theme.defaultMargin; + anchors.leftMargin: UM.Styles.defaultMargin; text: model.name; } diff --git a/qml/OutputGCodeButton.qml b/qml/OutputGCodeButton.qml index d94b51319a..52af6ee4be 100644 --- a/qml/OutputGCodeButton.qml +++ b/qml/OutputGCodeButton.qml @@ -8,9 +8,9 @@ import UM 1.0 as UM Rectangle { id: base; - color: UM.Theme.primaryColor; + color: UM.Styles.primaryColor; border.width: 1; - border.color: UM.Theme.borderColor; + border.color: UM.Styles.borderColor; signal saveRequested(); signal saveToSDRequested(); @@ -21,7 +21,7 @@ Rectangle { anchors.left: parent.left; anchors.right: icon.left; horizontalAlignment: Text.AlignHCenter; - font.pointSize: UM.Theme.largeTextSize; + font.pointSize: UM.Styles.largeTextSize; color: "white"; //: Save file to disk button @@ -43,7 +43,7 @@ Rectangle { Rectangle { anchors { left: parent.left; top: parent.top; bottom: parent.bottom; } width: 1; - color: UM.Theme.borderColor; + color: UM.Styles.borderColor; } UM.RecolorImage { id: iconImage; anchors.centerIn: parent; width: 32; height: 32; source: UM.Resources.getIcon('save.png'); color: '#000'; } diff --git a/qml/Printer.qml b/qml/Printer.qml index c15a54e0fe..a1b476fbe2 100644 --- a/qml/Printer.qml +++ b/qml/Printer.qml @@ -135,15 +135,15 @@ UM.MainWindow { id: files; anchors.left: parent.left; - anchors.leftMargin: UM.Theme.windowLeftMargin; + anchors.leftMargin: UM.Styles.windowLeftMargin; anchors.top: toolbar.bottom; anchors.topMargin: -1; border.width: 1; - border.color: UM.Theme.borderColor; + border.color: UM.Styles.borderColor; - width: UM.Theme.panelWidth; - height: base.height / 2 - UM.Theme.toolbarHeight; + width: UM.Styles.panelWidth; + height: base.height / 2 - UM.Styles.toolbarHeight; onRequestOpenFile: actions.open.trigger(); onOpenFile: UM.Controller.addMesh(file); @@ -153,14 +153,14 @@ UM.MainWindow { id: settings; anchors.right: parent.right; - anchors.rightMargin: UM.Theme.windowRightMargin; + anchors.rightMargin: UM.Styles.windowRightMargin; anchors.top: toolbar.bottom; anchors.topMargin: -1; border.width: 1; - border.color: UM.Theme.borderColor; + border.color: UM.Styles.borderColor; - width: UM.Theme.panelWidth; + width: UM.Styles.panelWidth; expandedHeight: base.height; @@ -171,12 +171,12 @@ UM.MainWindow { OutputGCodeButton { anchors.right: parent.right; - anchors.rightMargin: UM.Theme.windowRightMargin; + anchors.rightMargin: UM.Styles.windowRightMargin; anchors.bottom: parent.bottom; anchors.bottomMargin: -1; - width: UM.Theme.panelWidth; + width: UM.Styles.panelWidth; height: 40; onSaveRequested: actions.save.trigger(); @@ -331,4 +331,6 @@ UM.MainWindow { target: Printer onRequestAddPrinter: addMachine.visible = true; } + + Component.onCompleted: UM.Theme.load(UM.Resources.getPath(UM.Resources.ThemesLocation, "cura")) } diff --git a/qml/PrinterToolbar.qml b/qml/PrinterToolbar.qml index 29a9214dbd..bf40ad64c1 100644 --- a/qml/PrinterToolbar.qml +++ b/qml/PrinterToolbar.qml @@ -12,14 +12,14 @@ UM.Toolbar { property Action redo; property Action settings; - Item { width: UM.Theme.windowLeftMargin; } + Item { width: UM.Styles.windowLeftMargin; } Item { - width: UM.Theme.panelWidth; + width: UM.Styles.panelWidth; Image { anchors.centerIn: parent; source: UM.Resources.getIcon("cura_logo.png"); } } - Item { width: UM.Theme.toolbarSpacing; } + Item { width: UM.Styles.toolbarSpacing; } ToolButton { style: UM.ToolbarButtonStyle { } action: base.undo; iconSource: UM.Resources.getIcon('undo.png'); } ToolButton { style: UM.ToolbarButtonStyle { } action: base.redo; iconSource: UM.Resources.getIcon('redo.png'); } @@ -85,12 +85,12 @@ UM.Toolbar { } } - Item { width: UM.Theme.toolbarSpacing; } + Item { width: UM.Styles.toolbarSpacing; } ToolButton { id: machineButton; - width: UM.Theme.panelWidth - UM.Theme.toolbarButtonWidth - 1; - height: UM.Theme.toolbarButtonHeight; + width: UM.Styles.panelWidth - UM.Styles.toolbarButtonWidth - 1; + height: UM.Styles.toolbarButtonHeight; text: UM.Application.machineName; style: UM.ToolbarButtonStyle { @@ -109,8 +109,8 @@ UM.Toolbar { text: control.text; elide: Text.ElideRight; fontSizeMode: Text.HorizontalFit; - minimumPointSize: UM.Theme.smallTextSize; - font.pointSize: UM.Theme.largeTextSize; + minimumPointSize: UM.Styles.smallTextSize; + font.pointSize: UM.Styles.largeTextSize; verticalAlignment: Text.AlignBottom; } @@ -120,7 +120,7 @@ UM.Toolbar { anchors.left: parent.left; //: Machine toolbar button text: qsTr("Machine"); - font.pointSize: UM.Theme.tinyTextSize; + font.pointSize: UM.Styles.tinyTextSize; font.capitalization: Font.AllUppercase; } } @@ -156,5 +156,5 @@ UM.Toolbar { iconSource: UM.Resources.getIcon("settings.png"); } - Item { width: UM.Theme.windowRightMargin; } + Item { width: UM.Styles.windowRightMargin; } } diff --git a/qml/SettingsPane.qml b/qml/SettingsPane.qml index 6c3ceb0405..433e03025c 100644 --- a/qml/SettingsPane.qml +++ b/qml/SettingsPane.qml @@ -30,17 +30,17 @@ Rectangle { Column { id: contents; - spacing: UM.Theme.defaultMargin; + spacing: UM.Styles.defaultMargin; anchors { left: parent.left; - leftMargin: UM.Theme.defaultMargin; + leftMargin: UM.Styles.defaultMargin; right: parent.right; - rightMargin: UM.Theme.defaultMargin; + rightMargin: UM.Styles.defaultMargin; } //: Print Settings panel title - Label { text: qsTr("Print Settings"); width: parent.width; font.capitalization: Font.AllUppercase; font.pointSize: UM.Theme.smallTextSize; } + Label { text: qsTr("Print Settings"); width: parent.width; font.capitalization: Font.AllUppercase; font.pointSize: UM.Styles.smallTextSize; } Item { width: parent.width; @@ -48,7 +48,7 @@ Rectangle { Row { anchors.fill: parent; - spacing: UM.Theme.defaultMargin; + spacing: UM.Styles.defaultMargin; //: Material selection combo box label Label { text: qsTr("Material"); horizontalAlignment: Text.AlignRight; width: base.width * 0.5; } @@ -69,7 +69,7 @@ Rectangle { Row { anchors.fill: parent; - spacing: UM.Theme.defaultMargin; + spacing: UM.Styles.defaultMargin; //: Time display label Label { text: qsTr("Time"); width: base.width * 0.5; horizontalAlignment: Text.AlignRight; } Label { text: Qt.formatTime(new Date(timeSlider.value * 60000)); width: base.width * 0.35; horizontalAlignment: Text.AlignLeft; } @@ -114,7 +114,7 @@ Rectangle { color: "black"; } } - handle: Rectangle { width: 5; height: control.height; color: UM.Theme.primaryColor; } + handle: Rectangle { width: 5; height: control.height; color: UM.Styles.primaryColor; } } }