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 {
|
ColumnLayout {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
anchors.margins: UM.Theme.defaultMargin;
|
anchors.margins: UM.Styles.defaultMargin;
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Please select the type of printer:");
|
text: qsTr("Please select the type of printer:");
|
||||||
|
@ -26,7 +26,7 @@ Rectangle {
|
|||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
anchors.margins: UM.Theme.defaultMargin;
|
anchors.margins: UM.Styles.defaultMargin;
|
||||||
|
|
||||||
//: Open file button
|
//: Open file button
|
||||||
Button { text: qsTr("Open File"); iconSource: UM.Resources.getIcon("open.png"); Layout.fillWidth: true; onClicked: base.requestOpenFile(); }
|
Button { text: qsTr("Open File"); iconSource: UM.Resources.getIcon("open.png"); Layout.fillWidth: true; onClicked: base.requestOpenFile(); }
|
||||||
@ -70,7 +70,7 @@ Rectangle {
|
|||||||
Label {
|
Label {
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: UM.Theme.defaultMargin;
|
anchors.leftMargin: UM.Styles.defaultMargin;
|
||||||
|
|
||||||
text: model.name;
|
text: model.name;
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,9 @@ import UM 1.0 as UM
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: base;
|
id: base;
|
||||||
|
|
||||||
color: UM.Theme.primaryColor;
|
color: UM.Styles.primaryColor;
|
||||||
border.width: 1;
|
border.width: 1;
|
||||||
border.color: UM.Theme.borderColor;
|
border.color: UM.Styles.borderColor;
|
||||||
|
|
||||||
signal saveRequested();
|
signal saveRequested();
|
||||||
signal saveToSDRequested();
|
signal saveToSDRequested();
|
||||||
@ -21,7 +21,7 @@ Rectangle {
|
|||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.right: icon.left;
|
anchors.right: icon.left;
|
||||||
horizontalAlignment: Text.AlignHCenter;
|
horizontalAlignment: Text.AlignHCenter;
|
||||||
font.pointSize: UM.Theme.largeTextSize;
|
font.pointSize: UM.Styles.largeTextSize;
|
||||||
color: "white";
|
color: "white";
|
||||||
|
|
||||||
//: Save file to disk button
|
//: Save file to disk button
|
||||||
@ -43,7 +43,7 @@ Rectangle {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
anchors { left: parent.left; top: parent.top; bottom: parent.bottom; }
|
anchors { left: parent.left; top: parent.top; bottom: parent.bottom; }
|
||||||
width: 1;
|
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'; }
|
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;
|
id: files;
|
||||||
|
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: UM.Theme.windowLeftMargin;
|
anchors.leftMargin: UM.Styles.windowLeftMargin;
|
||||||
anchors.top: toolbar.bottom;
|
anchors.top: toolbar.bottom;
|
||||||
anchors.topMargin: -1;
|
anchors.topMargin: -1;
|
||||||
|
|
||||||
border.width: 1;
|
border.width: 1;
|
||||||
border.color: UM.Theme.borderColor;
|
border.color: UM.Styles.borderColor;
|
||||||
|
|
||||||
width: UM.Theme.panelWidth;
|
width: UM.Styles.panelWidth;
|
||||||
height: base.height / 2 - UM.Theme.toolbarHeight;
|
height: base.height / 2 - UM.Styles.toolbarHeight;
|
||||||
|
|
||||||
onRequestOpenFile: actions.open.trigger();
|
onRequestOpenFile: actions.open.trigger();
|
||||||
onOpenFile: UM.Controller.addMesh(file);
|
onOpenFile: UM.Controller.addMesh(file);
|
||||||
@ -153,14 +153,14 @@ UM.MainWindow {
|
|||||||
id: settings;
|
id: settings;
|
||||||
|
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.rightMargin: UM.Theme.windowRightMargin;
|
anchors.rightMargin: UM.Styles.windowRightMargin;
|
||||||
anchors.top: toolbar.bottom;
|
anchors.top: toolbar.bottom;
|
||||||
anchors.topMargin: -1;
|
anchors.topMargin: -1;
|
||||||
|
|
||||||
border.width: 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;
|
expandedHeight: base.height;
|
||||||
|
|
||||||
@ -171,12 +171,12 @@ UM.MainWindow {
|
|||||||
|
|
||||||
OutputGCodeButton {
|
OutputGCodeButton {
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.rightMargin: UM.Theme.windowRightMargin;
|
anchors.rightMargin: UM.Styles.windowRightMargin;
|
||||||
|
|
||||||
anchors.bottom: parent.bottom;
|
anchors.bottom: parent.bottom;
|
||||||
anchors.bottomMargin: -1;
|
anchors.bottomMargin: -1;
|
||||||
|
|
||||||
width: UM.Theme.panelWidth;
|
width: UM.Styles.panelWidth;
|
||||||
height: 40;
|
height: 40;
|
||||||
|
|
||||||
onSaveRequested: actions.save.trigger();
|
onSaveRequested: actions.save.trigger();
|
||||||
@ -331,4 +331,6 @@ UM.MainWindow {
|
|||||||
target: Printer
|
target: Printer
|
||||||
onRequestAddPrinter: addMachine.visible = true;
|
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 redo;
|
||||||
property Action settings;
|
property Action settings;
|
||||||
|
|
||||||
Item { width: UM.Theme.windowLeftMargin; }
|
Item { width: UM.Styles.windowLeftMargin; }
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: UM.Theme.panelWidth;
|
width: UM.Styles.panelWidth;
|
||||||
Image { anchors.centerIn: parent; source: UM.Resources.getIcon("cura_logo.png"); }
|
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.undo; iconSource: UM.Resources.getIcon('undo.png'); }
|
||||||
ToolButton { style: UM.ToolbarButtonStyle { } action: base.redo; iconSource: UM.Resources.getIcon('redo.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 {
|
ToolButton {
|
||||||
id: machineButton;
|
id: machineButton;
|
||||||
width: UM.Theme.panelWidth - UM.Theme.toolbarButtonWidth - 1;
|
width: UM.Styles.panelWidth - UM.Styles.toolbarButtonWidth - 1;
|
||||||
height: UM.Theme.toolbarButtonHeight;
|
height: UM.Styles.toolbarButtonHeight;
|
||||||
text: UM.Application.machineName;
|
text: UM.Application.machineName;
|
||||||
|
|
||||||
style: UM.ToolbarButtonStyle {
|
style: UM.ToolbarButtonStyle {
|
||||||
@ -109,8 +109,8 @@ UM.Toolbar {
|
|||||||
text: control.text;
|
text: control.text;
|
||||||
elide: Text.ElideRight;
|
elide: Text.ElideRight;
|
||||||
fontSizeMode: Text.HorizontalFit;
|
fontSizeMode: Text.HorizontalFit;
|
||||||
minimumPointSize: UM.Theme.smallTextSize;
|
minimumPointSize: UM.Styles.smallTextSize;
|
||||||
font.pointSize: UM.Theme.largeTextSize;
|
font.pointSize: UM.Styles.largeTextSize;
|
||||||
|
|
||||||
verticalAlignment: Text.AlignBottom;
|
verticalAlignment: Text.AlignBottom;
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ UM.Toolbar {
|
|||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
//: Machine toolbar button
|
//: Machine toolbar button
|
||||||
text: qsTr("Machine");
|
text: qsTr("Machine");
|
||||||
font.pointSize: UM.Theme.tinyTextSize;
|
font.pointSize: UM.Styles.tinyTextSize;
|
||||||
font.capitalization: Font.AllUppercase;
|
font.capitalization: Font.AllUppercase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -156,5 +156,5 @@ UM.Toolbar {
|
|||||||
iconSource: UM.Resources.getIcon("settings.png");
|
iconSource: UM.Resources.getIcon("settings.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
Item { width: UM.Theme.windowRightMargin; }
|
Item { width: UM.Styles.windowRightMargin; }
|
||||||
}
|
}
|
||||||
|
@ -30,17 +30,17 @@ Rectangle {
|
|||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: contents;
|
id: contents;
|
||||||
spacing: UM.Theme.defaultMargin;
|
spacing: UM.Styles.defaultMargin;
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left;
|
left: parent.left;
|
||||||
leftMargin: UM.Theme.defaultMargin;
|
leftMargin: UM.Styles.defaultMargin;
|
||||||
right: parent.right;
|
right: parent.right;
|
||||||
rightMargin: UM.Theme.defaultMargin;
|
rightMargin: UM.Styles.defaultMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
//: Print Settings panel title
|
//: 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 {
|
Item {
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
@ -48,7 +48,7 @@ Rectangle {
|
|||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
spacing: UM.Theme.defaultMargin;
|
spacing: UM.Styles.defaultMargin;
|
||||||
|
|
||||||
//: Material selection combo box label
|
//: Material selection combo box label
|
||||||
Label { text: qsTr("Material"); horizontalAlignment: Text.AlignRight; width: base.width * 0.5; }
|
Label { text: qsTr("Material"); horizontalAlignment: Text.AlignRight; width: base.width * 0.5; }
|
||||||
@ -69,7 +69,7 @@ Rectangle {
|
|||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
spacing: UM.Theme.defaultMargin;
|
spacing: UM.Styles.defaultMargin;
|
||||||
//: Time display label
|
//: Time display label
|
||||||
Label { text: qsTr("Time"); width: base.width * 0.5; horizontalAlignment: Text.AlignRight; }
|
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; }
|
Label { text: Qt.formatTime(new Date(timeSlider.value * 60000)); width: base.width * 0.35; horizontalAlignment: Text.AlignLeft; }
|
||||||
@ -114,7 +114,7 @@ Rectangle {
|
|||||||
color: "black";
|
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