diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml
index 8369c2a743..f89f8d63dd 100644
--- a/resources/qml/Cura.qml
+++ b/resources/qml/Cura.qml
@@ -21,36 +21,45 @@ UM.MainWindow
// Cura application window title
title: catalog.i18nc("@title:window", "Ultimaker Cura")
- viewportRect: Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0)
+ //viewportRect: Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0)
+ viewportRect: Qt.rect(0, 0, 1.0, 1.0)
backgroundColor: UM.Theme.getColor("viewport_background")
UM.I18nCatalog
{
id: catalog
- name: "cura"
+ name:"cura"
}
- onWidthChanged:
+ function showTooltip(item, position, text)
+ {
+ tooltip.text = text;
+ position = item.mapToItem(backgroundItem, position.x - UM.Theme.getSize("default_arrow").width, position.y);
+ tooltip.show(position);
+ }
+
+ function hideTooltip()
+ {
+ tooltip.hide();
+ }
+
+ /*onWidthChanged:
{
// If slidebar is collapsed then it should be invisible
// otherwise after the main_window resize the sidebar will be fully re-drawn
- if (sidebar.collapsed)
- {
- if (sidebar.visible == true)
- {
+ if (sidebar.collapsed){
+ if (sidebar.visible == true){
sidebar.visible = false
sidebar.initialWidth = 0
}
}
- else
- {
- if (sidebar.visible == false)
- {
+ else{
+ if (sidebar.visible == false){
sidebar.visible = true
sidebar.initialWidth = UM.Theme.getSize("sidebar").width
}
}
- }
+ }*/
Component.onCompleted:
{
@@ -69,11 +78,16 @@ UM.MainWindow
CuraApplication.purgeWindows()
}
- Column
+ Item
{
id: backgroundItem
anchors.fill: parent
+ SidebarTooltip
+ {
+ id: tooltip
+ }
+
signal hasMesh(string name) //this signal sends the filebase name so it can be used for the JobSpecs.qml
function getMeshName(path)
{
@@ -94,26 +108,34 @@ UM.MainWindow
ApplicationMenu
{
- id: menu
+ id: applicationMenu
window: base
}
TopHeader
{
id: topHeader
- anchors.left: parent.left
- anchors.right: parent.right
+ anchors
+ {
+ left: parent.left
+ right: parent.right
+ top: applicationMenu.bottom
+ }
}
Item
{
id: contentItem
- width: parent.width
- height: parent.height - menu.height - topHeader.height
- z: topHeader.z - 1
+ anchors
+ {
+ top: topHeader.bottom
+ bottom: parent.bottom
+ left: parent.left
+ right: parent.right
+ }
- Keys.forwardTo: menu
+ Keys.forwardTo: applicationMenu
DropArea
{
@@ -145,41 +167,39 @@ UM.MainWindow
}
}
+ Loader
+ {
+ // The stage menu is, as the name implies, a menu that is defined by the active stage.
+ // Note that this menu does not need to be set at all! It's perfectly acceptable to have a stage
+ // without this menu!
+ id: stageMenu
+
+ anchors
+ {
+ left: parent.left
+ right: parent.right
+ top: parent.top
+ margins: UM.Theme.getSize("default_margin").height
+ }
+
+ height: 50
+
+ source: UM.Controller.activeStage.stageMenuComponent
+ }
+
JobSpecs
{
id: jobSpecs
anchors
{
bottom: parent.bottom
- right: sidebar.left
+ //right: sidebar.left
bottomMargin: UM.Theme.getSize("default_margin").height
rightMargin: UM.Theme.getSize("default_margin").width
}
}
- Button
- {
- id: openFileButton
- text: catalog.i18nc("@action:button", "Open File")
- iconSource: UM.Theme.getIcon("load")
- style: UM.Theme.styles.tool_button
- tooltip: ""
- anchors
- {
- top: parent.top
- topMargin: UM.Theme.getSize("default_margin").height
- left: parent.left
- }
- action: Cura.Actions.open
- }
- MachineAndConfigurationSelector
- {
- anchors.left: openFileButton.right
- //anchors.right: sidebar.left
- anchors.leftMargin: UM.Theme.getSize("default_margin").height
- anchors.top: openFileButton.top
- }
Toolbar
{
@@ -189,7 +209,7 @@ UM.MainWindow
property int mouseY: base.mouseY
anchors {
- top: openFileButton.bottom
+ top: stageMenu.bottom
topMargin: UM.Theme.getSize("window_margin").height
left: parent.left
}
@@ -206,7 +226,7 @@ UM.MainWindow
}
}
- ApplicationViews
+ /*ApplicationViews
{
id: applicationViews
@@ -216,7 +236,7 @@ UM.MainWindow
top: parent.top
right: sidebar.left
}
- }
+ }*/
Loader
{
@@ -227,7 +247,7 @@ UM.MainWindow
top: parent.top
bottom: parent.bottom
left: parent.left
- right: sidebar.left
+ right: parent.right
}
MouseArea
@@ -241,7 +261,7 @@ UM.MainWindow
source: UM.Controller.activeStage.mainComponent
}
- Loader
+ /*Loader
{
id: sidebar
@@ -311,7 +331,7 @@ UM.MainWindow
acceptedButtons: Qt.AllButtons
onWheel: wheel.accepted = true
}
- }
+ }*/
UM.MessageStack
{
@@ -338,15 +358,33 @@ UM.MainWindow
bottom: parent.bottom
}
}
+
+
+ ProgressAndSaveWidget
+ {
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ width: UM.Theme.getSize("sidebar").width
+ anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
+ anchors.bottomMargin: UM.Theme.getSize("sidebar_margin").height
+ onShowTooltip:
+ {
+ base.showTooltip(item, location, text)
+ }
+ onHideTooltip:
+ {
+ base.hideTooltip()
+ }
+ }
}
}
// Expand or collapse sidebar
- Connections
+ /*Connections
{
target: Cura.Actions.expandSidebar
onTriggered: sidebar.callExpandOrCollapse()
- }
+ }*/
UM.PreferencesDialog
{
@@ -356,10 +394,10 @@ 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"), Qt.resolvedUrl("Preferences/GeneralPage.qml"));
+ insertPage(0, catalog.i18nc("@title:tab","General"), Qt.resolvedUrl("Preferences/GeneralPage.qml"));
removePage(1);
- insertPage(1, catalog.i18nc("@title:tab", "Settings"), Qt.resolvedUrl("Preferences/SettingVisibilityPage.qml"));
+ insertPage(1, catalog.i18nc("@title:tab","Settings"), Qt.resolvedUrl("Preferences/SettingVisibilityPage.qml"));
insertPage(2, catalog.i18nc("@title:tab", "Printers"), Qt.resolvedUrl("Preferences/MachinesPage.qml"));
@@ -532,7 +570,7 @@ UM.MainWindow
id: openDialog;
//: File open dialog title
- title: catalog.i18nc("@title:window", "Open file(s)")
+ title: catalog.i18nc("@title:window","Open file(s)")
modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal;
selectMultiple: true
nameFilters: UM.MeshFileHandler.supportedReadFileTypes;
@@ -638,7 +676,8 @@ UM.MainWindow
modality: Qt.ApplicationModal
}
- MessageDialog {
+ MessageDialog
+ {
id: infoMultipleFilesWithGcodeDialog
title: catalog.i18nc("@title:window", "Open File(s)")
icon: StandardIcon.Information
diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml
index 2c2edcb492..580ff5dce9 100644
--- a/resources/qml/ExtruderIcon.qml
+++ b/resources/qml/ExtruderIcon.qml
@@ -4,7 +4,6 @@ import UM 1.2 as UM
Item
{
-
id: extruderIconItem
implicitWidth: UM.Theme.getSize("button").width
diff --git a/resources/qml/MaterialAndVariantSelector.qml b/resources/qml/MaterialAndVariantSelector.qml
index 325ffa85a5..fff3ef1100 100644
--- a/resources/qml/MaterialAndVariantSelector.qml
+++ b/resources/qml/MaterialAndVariantSelector.qml
@@ -17,7 +17,7 @@ Rectangle
id: base
color: UM.Theme.getColor("sidebar")
-
+
// Height has an extra 2x margin for the top & bottom margin.
height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").width
diff --git a/resources/qml/PrepareSidebar.qml b/resources/qml/ProfileAndSettingComponent.qml
similarity index 66%
rename from resources/qml/PrepareSidebar.qml
rename to resources/qml/ProfileAndSettingComponent.qml
index 7c99e6e145..33c2f37fb1 100644
--- a/resources/qml/PrepareSidebar.qml
+++ b/resources/qml/ProfileAndSettingComponent.qml
@@ -16,14 +16,10 @@ Rectangle
{
id: base
+ height: childrenRect.height
+
property int currentModeIndex: -1
property bool hideSettings: PrintInformation.preSliced
- property bool hideView: Cura.MachineManager.activeMachineName == ""
-
- // Is there an output device for this printer?
- property bool printerConnected: Cura.MachineManager.printerConnected
- property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
- property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
property variant printDuration: PrintInformation.currentPrintTime
property variant printMaterialLengths: PrintInformation.materialLengths
@@ -34,7 +30,8 @@ Rectangle
color: UM.Theme.getColor("sidebar")
UM.I18nCatalog { id: catalog; name:"cura"}
- Timer {
+ Timer
+ {
id: tooltipDelayTimer
interval: 500
repeat: false
@@ -59,7 +56,8 @@ Rectangle
tooltip.hide();
}
- function strPadLeft(string, pad, length) {
+ function strPadLeft(string, pad, length)
+ {
return (new Array(length + 1).join(pad) + string).slice(-length);
}
@@ -86,35 +84,9 @@ Rectangle
}
}
- SidebarHeader
- {
- id: header
- width: parent.width
- visible: !hideSettings && (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants)
- anchors.top: parent.top
-
- onShowTooltip: base.showTooltip(item, location, text)
- onHideTooltip: base.hideTooltip()
- }
-
- Rectangle
- {
- id: headerSeparator
- width: parent.width
- visible: settingsModeSelection.visible && header.visible
- height: visible ? UM.Theme.getSize("sidebar_lining").height : 0
- color: UM.Theme.getColor("sidebar_lining")
- anchors.top: header.bottom
- anchors.topMargin: visible ? UM.Theme.getSize("sidebar_margin").height : 0
- }
-
onCurrentModeIndexChanged:
{
UM.Preferences.setValue("cura/active_mode", currentModeIndex);
- if(modesListModel.count > base.currentModeIndex)
- {
- sidebarContents.replace(modesListModel.get(base.currentModeIndex).item, { "replace": true })
- }
}
Label
@@ -122,176 +94,129 @@ Rectangle
id: settingsModeLabel
text: !hideSettings ? catalog.i18nc("@label:listbox", "Print Setup") : catalog.i18nc("@label:listbox", "Print Setup disabled\nG-code files cannot be modified")
renderType: Text.NativeRendering
- anchors.left: parent.left
- anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
- anchors.top: hideSettings ? machineSelection.bottom : headerSeparator.bottom
- anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
+
+ anchors
+ {
+ left: parent.left
+ top: parent.top
+ margins: UM.Theme.getSize("sidebar_margin").width
+ }
+
width: Math.round(parent.width * 0.45)
+ height: contentHeight
font: UM.Theme.getFont("large")
color: UM.Theme.getColor("text")
- visible: !hideView
}
- // Settings mode selection toggle
- Item
- {
- id: settingsModeSelection
+ ListView
+ {
+ // Settings mode selection toggle
+ id: settingsModeSelection
+ model: modesListModel
width: Math.round(parent.width * 0.55)
height: UM.Theme.getSize("sidebar_header_mode_toggle").height
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
- anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
- anchors.top:
- {
- if (settingsModeLabel.contentWidth >= parent.width - width - UM.Theme.getSize("sidebar_margin").width * 2)
- {
- return settingsModeLabel.bottom;
- }
- else
- {
- return headerSeparator.bottom;
- }
- }
- visible: !hideSettings && !hideView
-
- Component
- {
- id: wizardDelegate
-
- Button
- {
- id: control
-
- height: settingsModeSelection.height
- width: Math.round(parent.width / 2)
-
- anchors.left: parent.left
- anchors.leftMargin: model.index * Math.round(settingsModeSelection.width / 2)
- anchors.verticalCenter: parent.verticalCenter
-
- ButtonGroup.group: modeMenuGroup
-
- checkable: true
- checked: base.currentModeIndex == index
- onClicked: base.currentModeIndex = index
-
- onHoveredChanged:
- {
- if (hovered)
- {
- tooltipDelayTimer.item = settingsModeSelection
- tooltipDelayTimer.text = model.tooltipText
- tooltipDelayTimer.start()
- }
- else
- {
- tooltipDelayTimer.stop()
- base.hideTooltip()
- }
- }
-
- background: Rectangle
- {
- border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
- border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : control.hovered ? UM.Theme.getColor("action_button_hovered_border"): UM.Theme.getColor("action_button_border")
-
- // for some reason, QtQuick decided to use the color of the background property as text color for the contentItem, so here it is
- color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
- }
-
- contentItem: Label
- {
- text: model.text
- font: UM.Theme.getFont("default")
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- renderType: Text.NativeRendering
- elide: Text.ElideRight
- color:
- {
- if(control.pressed)
- {
- return UM.Theme.getColor("action_button_active_text");
- }
- else if(control.hovered)
- {
- return UM.Theme.getColor("action_button_hovered_text");
- }
- return UM.Theme.getColor("action_button_text");
- }
- }
- }
- }
+ anchors.top: settingsModeLabel.top
ButtonGroup
{
id: modeMenuGroup
}
- ListView
+ delegate: Button
{
- id: modesList
- model: modesListModel
- delegate: wizardDelegate
- anchors.top: parent.top
+ id: control
+
+ height: settingsModeSelection.height
+ width: Math.round(parent.width / 2)
+
anchors.left: parent.left
- width: parent.width
- }
- }
+ anchors.leftMargin: model.index * Math.round(settingsModeSelection.width / 2)
+ anchors.verticalCenter: parent.verticalCenter
- StackView
- {
- id: sidebarContents
+ ButtonGroup.group: modeMenuGroup
- anchors.bottom: footerSeparator.top
- anchors.top: settingsModeSelection.bottom
- anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
- anchors.left: base.left
- anchors.right: base.right
- visible: !hideSettings
+ checkable: true
+ checked: base.currentModeIndex == index
+ onClicked: base.currentModeIndex = index
- replaceEnter: Transition {
- PropertyAnimation {
- property: "opacity"
- from: 0
- to:1
- duration: 100
+ onHoveredChanged:
+ {
+ if (hovered)
+ {
+ tooltipDelayTimer.item = settingsModeSelection
+ tooltipDelayTimer.text = model.tooltipText
+ tooltipDelayTimer.start()
+ }
+ else
+ {
+ tooltipDelayTimer.stop()
+ base.hideTooltip()
+ }
+ }
+
+ background: Rectangle
+ {
+ border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
+ border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : control.hovered ? UM.Theme.getColor("action_button_hovered_border"): UM.Theme.getColor("action_button_border")
+
+ // for some reason, QtQuick decided to use the color of the background property as text color for the contentItem, so here it is
+ color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
+ }
+
+ contentItem: Label
+ {
+ text: model.text
+ font: UM.Theme.getFont("default")
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ renderType: Text.NativeRendering
+ elide: Text.ElideRight
+ color:
+ {
+ if(control.pressed)
+ {
+ return UM.Theme.getColor("action_button_active_text");
+ }
+ else if(control.hovered)
+ {
+ return UM.Theme.getColor("action_button_hovered_text");
+ }
+ return UM.Theme.getColor("action_button_text");
+ }
}
}
-
- replaceExit: Transition {
- PropertyAnimation {
- property: "opacity"
- from: 1
- to:0
- duration: 100
- }
- }
- }
-
- Loader
- {
- anchors.bottom: footerSeparator.top
- anchors.top: headerSeparator.bottom
- anchors.left: base.left
- anchors.right: base.right
- source: "SidebarContents.qml"
- }
-
- Rectangle
- {
- id: footerSeparator
- width: parent.width
- height: UM.Theme.getSize("sidebar_lining").height
- color: UM.Theme.getColor("sidebar_lining")
- anchors.bottom: printSpecs.top
- anchors.bottomMargin: Math.round(UM.Theme.getSize("sidebar_margin").height * 2 + UM.Theme.getSize("progressbar").height + UM.Theme.getFont("default_bold").pixelSize)
}
Item
+ {
+ id: sidebarContents
+ anchors.top: settingsModeSelection.bottom
+ anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: 500
+
+ // We load both of them at once (instead of using a loader) because the advanced sidebar can take
+ // quite some time to load. So in this case we sacrifice memory for speed.
+ SidebarAdvanced
+ {
+ anchors.fill: parent
+ visible: currentModeIndex == 1
+ }
+
+ SidebarSimple
+ {
+ anchors.fill: parent
+ visible: currentModeIndex != 1
+ }
+ }
+
+ /*Item
{
id: printSpecs
anchors.left: parent.left
@@ -499,22 +424,23 @@ Rectangle
}
}
}
- }
+ }*/
// SaveButton is actually the bottom footer panel.
- SaveButton
+ /*SaveButton
{
id: saveButton
implicitWidth: base.width
anchors.top: footerSeparator.bottom
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
anchors.bottom: parent.bottom
- }
+ }*/
+ /*
SidebarTooltip
{
id: tooltip
- }
+ }*/
// Setting mode: Recommended or Custom
ListModel
@@ -522,35 +448,15 @@ Rectangle
id: modesListModel
}
- SidebarSimple
- {
- id: sidebarSimple
- visible: false
-
- onShowTooltip: base.showTooltip(item, location, text)
- onHideTooltip: base.hideTooltip()
- }
-
- SidebarAdvanced
- {
- id: sidebarAdvanced
- visible: false
-
- onShowTooltip: base.showTooltip(item, location, text)
- onHideTooltip: base.hideTooltip()
- }
-
Component.onCompleted:
{
modesListModel.append({
text: catalog.i18nc("@title:tab", "Recommended"),
- tooltipText: catalog.i18nc("@tooltip", "Recommended Print Setup
Print with the recommended settings for the selected printer, material and quality."),
- item: sidebarSimple
+ tooltipText: catalog.i18nc("@tooltip", "Recommended Print Setup
Print with the recommended settings for the selected printer, material and quality.")
})
modesListModel.append({
text: catalog.i18nc("@title:tab", "Custom"),
- tooltipText: catalog.i18nc("@tooltip", "Custom Print Setup
Print with finegrained control over every last bit of the slicing process."),
- item: sidebarAdvanced
+ tooltipText: catalog.i18nc("@tooltip", "Custom Print Setup
Print with finegrained control over every last bit of the slicing process.")
})
var index = Math.round(UM.Preferences.getValue("cura/active_mode"))
@@ -564,24 +470,4 @@ Rectangle
currentModeIndex = 0;
}
}
-
- UM.SettingPropertyProvider
- {
- id: machineExtruderCount
-
- containerStack: Cura.MachineManager.activeMachine
- key: "machine_extruder_count"
- watchedProperties: [ "value" ]
- storeIndex: 0
- }
-
- UM.SettingPropertyProvider
- {
- id: machineHeatedBed
-
- containerStack: Cura.MachineManager.activeMachine
- key: "machine_heated_bed"
- watchedProperties: [ "value" ]
- storeIndex: 0
- }
}
diff --git a/resources/qml/ProgressAndSaveWidget.qml b/resources/qml/ProgressAndSaveWidget.qml
new file mode 100644
index 0000000000..88819af759
--- /dev/null
+++ b/resources/qml/ProgressAndSaveWidget.qml
@@ -0,0 +1,237 @@
+// Copyright (c) 2017 Ultimaker B.V.
+// Cura is released under the terms of the LGPLv3 or higher.
+
+import QtQuick 2.7
+import QtQuick.Controls 2.0
+import QtQuick.Layouts 1.3
+
+import UM 1.2 as UM
+import Cura 1.0 as Cura
+
+Rectangle
+{
+ id: base
+
+ // We need a whole lot of print duration information.
+ property variant printDuration: PrintInformation.currentPrintTime
+
+ // This widget doesn't show tooltips by itself. Instead it emits signals so others can do something with it.
+ signal showTooltip(Item item, point location, string text)
+ signal hideTooltip()
+
+ // Also add an extra margin, as we ant some breathing room around the edges.
+ height: childrenRect.height + UM.Theme.getSize("sidebar_margin").height
+ Label
+ {
+ id: timeDetails
+ anchors.left: parent.left
+ anchors.bottom: costSpec.top
+ anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
+
+ font: UM.Theme.getFont("large")
+ color: UM.Theme.getColor("text_subtext")
+ text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label Hours and minutes", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
+ renderType: Text.NativeRendering
+
+ MouseArea
+ {
+ id: timeDetailsMouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+
+ onEntered:
+ {
+ if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
+ {
+ // All the time information for the different features is achieved
+ var print_time = PrintInformation.getFeaturePrintTimes();
+ var total_seconds = parseInt(base.printDuration.getDisplayString(UM.DurationFormat.Seconds))
+
+ // A message is created and displayed when the user hover the time label
+ var tooltip_html = "%1
" + feature + ": | " + + "%1 | ".arg(print_time[feature].getDisplayString(UM.DurationFormat.ISO8601).slice(0,-3)) + + "%1% | ".arg(Math.round(100 * parseInt(print_time[feature].getDisplayString(UM.DurationFormat.Seconds)) / total_seconds)) + + "