Show slicing progress in SaveButton area instead of MessageStack

Add separators to sidebar
Tweak theme
This commit is contained in:
fieldOfView 2015-11-17 16:51:40 +01:00
parent e293501e37
commit 6bfed19477
5 changed files with 57 additions and 21 deletions

View file

@ -134,11 +134,11 @@ class CuraEngineBackend(Backend):
return #No slicing if we have error values since those are by definition illegal values. return #No slicing if we have error values since those are by definition illegal values.
self.processingProgress.emit(0.0) self.processingProgress.emit(0.0)
if not self._message: if self._message:
self._message = Message(catalog.i18nc("@info:status", "Slicing..."), 0, False, -1)
self._message.show()
else:
self._message.setProgress(-1) self._message.setProgress(-1)
#else:
# self._message = Message(catalog.i18nc("@info:status", "Slicing..."), 0, False, -1)
# self._message.show()
self._scene.gcode_list = [] self._scene.gcode_list = []
self._slicing = True self._slicing = True

View file

@ -76,7 +76,7 @@ Rectangle {
TextField { TextField {
id: printJobTextfield id: printJobTextfield
anchors.right: parent.right anchors.right: parent.right
height: UM.Theme.sizes.sidebar_inputFields.height height: UM.Theme.sizes.sidebar_inputfields.height
width: base.width width: base.width
property int unremovableSpacing: 5 property int unremovableSpacing: 5
text: '' text: ''

View file

@ -14,23 +14,42 @@ Rectangle {
property real progress: UM.Backend.progress; property real progress: UM.Backend.progress;
property bool activity: Printer.getPlatformActivity; property bool activity: Printer.getPlatformActivity;
Behavior on progress { NumberAnimation { duration: 250; } } Behavior on progress { NumberAnimation { duration: 250; } }
property int totalHeight: childrenRect.height + UM.Theme.sizes.default_margin.height*1.5 property int totalHeight: childrenRect.height + UM.Theme.sizes.default_margin.height
property string fileBaseName property string fileBaseName
UM.I18nCatalog { id: catalog; name:"cura"} UM.I18nCatalog { id: catalog; name:"cura"}
Rectangle{
id: progressBar
width: parent.width - 2 * UM.Theme.sizes.default_margin.width
height: UM.Theme.sizes.progressbar.height
anchors.top: parent.top
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
Rectangle{
width: Math.max(parent.width * base.progress)
height: parent.height
color: UM.Theme.colors.progressbar_control
radius: UM.Theme.sizes.progressbar_radius.width
visible: base.progress > 0.99 ? false : true
}
}
Rectangle{ Rectangle{
id: saveRow id: saveRow
width: base.width width: base.width
height: saveToButton.height + (UM.Theme.sizes.default_margin.height / 2) // height + bottomMargin height: saveToButton.height
anchors.top: parent.top anchors.top: progressBar.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left anchors.left: parent.left
Button { Button {
id: saveToButton id: saveToButton
property int resizedWidth property int resizedWidth
x: base.width - saveToButton.resizedWidth - UM.Theme.sizes.default_margin.width - UM.Theme.sizes.save_button_save_to_button.height + 2 x: base.width - saveToButton.resizedWidth - UM.Theme.sizes.default_margin.width - UM.Theme.sizes.save_button_save_to_button.height + 3
tooltip: UM.OutputDeviceManager.activeDeviceDescription; tooltip: UM.OutputDeviceManager.activeDeviceDescription;
enabled: base.progress > 0.99 && base.activity == true enabled: base.progress > 0.99 && base.activity == true
height: UM.Theme.sizes.save_button_save_to_button.height height: UM.Theme.sizes.save_button_save_to_button.height

View file

@ -52,6 +52,15 @@ Rectangle
configureMachinesAction: base.configureMachinesAction; configureMachinesAction: base.configureMachinesAction;
} }
Rectangle {
id: headerSeparator
width: parent.width
height: UM.Theme.sizes.sidebar_lining.height
color: UM.Theme.colors.sidebar_lining
anchors.top: header.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
}
ProfileSetup { ProfileSetup {
id: profileItem id: profileItem
manageProfilesAction: base.manageProfilesAction manageProfilesAction: base.manageProfilesAction
@ -80,7 +89,7 @@ Rectangle
text: catalog.i18nc("@label:listbox","Setup"); text: catalog.i18nc("@label:listbox","Setup");
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width; anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: header.bottom anchors.top: headerSeparator.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width/100*45 width: parent.width/100*45
font: UM.Theme.fonts.large; font: UM.Theme.fonts.large;
@ -93,7 +102,7 @@ Rectangle
height: UM.Theme.sizes.sidebar_header_mode_toggle.height height: UM.Theme.sizes.sidebar_header_mode_toggle.height
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.top: header.bottom anchors.top: headerSeparator.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.sizes.default_margin.height
Component{ Component{
id: wizardDelegate id: wizardDelegate
@ -145,7 +154,7 @@ Rectangle
Loader Loader
{ {
id: sidebarContents; id: sidebarContents;
anchors.bottom: saveButton.top anchors.bottom: footerSeparator.top
anchors.top: profileItem.bottom anchors.top: profileItem.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: base.left anchors.left: base.left
@ -172,6 +181,15 @@ Rectangle
} }
} }
Rectangle {
id: footerSeparator
width: parent.width
height: UM.Theme.sizes.sidebar_lining.height
color: UM.Theme.colors.sidebar_lining
anchors.bottom: saveButton.top
anchors.bottomMargin: UM.Theme.sizes.default_margin.height
}
SaveButton SaveButton
{ {
id: saveButton; id: saveButton;

View file

@ -45,7 +45,7 @@
}, },
"colors": { "colors": {
"text_default": [0, 0, 0, 255], "text_default": [0, 0, 0, 255],
"sidebar": [255, 255, 255, 255], "sidebar": [255, 255, 255, 255],
"lining": [208, 210, 211, 255], "lining": [208, 210, 211, 255],
@ -64,6 +64,7 @@
"error": [255, 140, 0, 255], "error": [255, 140, 0, 255],
"sidebar_header_bar": [24, 41, 77, 255], "sidebar_header_bar": [24, 41, 77, 255],
"sidebar_lining": [245, 245, 245, 255],
"button": [24, 41, 77, 255], "button": [24, 41, 77, 255],
"button_hover": [70, 84, 113, 255], "button_hover": [70, 84, 113, 255],
@ -156,16 +157,15 @@
"sizes": { "sizes": {
"window_margin": [1.0, 1.0], "window_margin": [1.0, 1.0],
"default_margin": [1.0, 1.0], "default_margin": [1.0, 1.0],
"default_lining": [0.25, 0.25], "default_lining": [0.08, 0.08],
"logo": [9.5, 2.0], "logo": [9.5, 2.0],
"sidebar": [30.0, 10.0], "sidebar": [30.0, 10.0],
"sidebar_header": [0.0, 4.0], "sidebar_header": [0.0, 4.0],
"sidebar_header_mode_toggle": [0.0, 2.0], "sidebar_header_mode_toggle": [0.0, 2.0],
"sidebar_setup": [0.0, 2.6], "sidebar_lining": [0.5, 0.5],
"sidebar_subParts": [0.0, 2.4], "sidebar_setup": [0.0, 2.0],
"sidebar_specs_bar": [0.0, 2.2], "sidebar_inputfields": [0.0, 2.0],
"sidebar_inputFields": [0.0, 1.9],
"simple_mode_infill_caption": [0.0, 5.0], "simple_mode_infill_caption": [0.0, 5.0],
"simple_mode_infill_height": [0.0, 8.0], "simple_mode_infill_height": [0.0, 8.0],
@ -190,10 +190,11 @@
"button_lining": [0, 0], "button_lining": [0, 0],
"progressbar": [26.0, 0.8], "progressbar": [26.0, 0.8],
"progressbar_radius": [0.4, 0.4],
"progressbar_control": [8.0, 0.8], "progressbar_control": [8.0, 0.8],
"progressbar_padding": [0.0, 1.0], "progressbar_padding": [0.0, 1.0],
"scrollbar": [0.7, 0.5], "scrollbar": [0.75, 0.5],
"slider_groove": [0.5, 0.5], "slider_groove": [0.5, 0.5],
"slider_handle": [1.5, 1.5], "slider_handle": [1.5, 1.5],
@ -207,8 +208,6 @@
"tooltip": [20.0, 10.0], "tooltip": [20.0, 10.0],
"tooltip_margins": [1.0, 1.0], "tooltip_margins": [1.0, 1.0],
"save_button_border": [0.06, 0.06],
"save_button_header": [0.0, 3.2],
"save_button_text_margin": [0.3, 0.6], "save_button_text_margin": [0.3, 0.6],
"save_button_slicing_bar": [0.0, 2.2], "save_button_slicing_bar": [0.0, 2.2],
"save_button_label_margin": [0.5, 0.5], "save_button_label_margin": [0.5, 0.5],