mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Rename Theme to Styles to allow for the introduction of a proper Theme object
This commit is contained in:
parent
4a8f6beb26
commit
89a035bab4
@ -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:");
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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'; }
|
||||
|
@ -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"))
|
||||
}
|
||||
|
@ -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; }
|
||||
}
|
||||
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user