Merge pull request #562 from Ultimaker/feature_ux2-1

Design rework for 2.1 release
This commit is contained in:
Tamara Hogenhout 2015-12-10 11:05:19 +01:00
commit e61d3e4f3e
25 changed files with 1159 additions and 4111 deletions

View file

@ -310,14 +310,24 @@ UM.MainWindow
}
}
JobSpecs
{
anchors
{
bottom: parent.bottom;
right: sidebar.left;
bottomMargin: UM.Theme.sizes.default_margin.height;
rightMargin: UM.Theme.sizes.default_margin.width;
}
}
UM.MessageStack
{
anchors
{
horizontalCenter: parent.horizontalCenter
horizontalCenterOffset: -(UM.Theme.sizes.logo.width/ 2)
top: parent.verticalCenter;
bottom: parent.bottom;
horizontalCenterOffset: -(UM.Theme.sizes.sidebar.width/ 2)
verticalCenter: parent.verticalCenter;
}
}
@ -330,8 +340,7 @@ UM.MainWindow
//anchors.bottom: parent.bottom
anchors.top: viewModeButton.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height;
anchors.right: sidebar.left;
anchors.rightMargin: UM.Theme.sizes.window_margin.width;
anchors.left: viewModeButton.left;
//anchors.bottom: buttons.top;
//anchors.bottomMargin: UM.Theme.sizes.default_margin.height;
@ -344,10 +353,9 @@ UM.MainWindow
{
id: openFileButton;
//style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
//style: UM.Theme.styles.open_file_button
text: catalog.i18nc("@action:button","Open File");
iconSource: UM.Theme.icons.load
style: UM.Theme.styles.open_file_button
style: UM.Theme.styles.tool_button
tooltip: '';
anchors
{
@ -373,6 +381,7 @@ UM.MainWindow
source: UM.Theme.images.logo;
width: UM.Theme.sizes.logo.width;
height: UM.Theme.sizes.logo.height;
z: -1;
sourceSize.width: width;
sourceSize.height: height;
@ -381,13 +390,12 @@ UM.MainWindow
Button
{
id: viewModeButton
property bool verticalTooltip: true
anchors
{
top: parent.top;
right: sidebar.left;
rightMargin: UM.Theme.sizes.window_margin.width;
top: toolbar.bottom;
topMargin: UM.Theme.sizes.window_margin.height;
left: parent.left;
}
text: catalog.i18nc("@action:button","View Mode");
iconSource: UM.Theme.icons.viewmode;
@ -422,12 +430,9 @@ UM.MainWindow
id: toolbar;
anchors {
left: parent.left
top: parent.top
topMargin: UM.Theme.sizes.window_margin.height + UM.Theme.sizes.button.height
//horizontalCenter: parent.horizontalCenter
//horizontalCenterOffset: -(UM.Theme.sizes.sidebar.width / 2)
//top: parent.top;
top: openFileButton.bottom;
topMargin: UM.Theme.sizes.window_margin.height;
left: parent.left;
}
}
@ -629,7 +634,7 @@ UM.MainWindow
id: openDialog;
//: File open dialog title
title: catalog.i18nc("@title:window","Open File")
title: catalog.i18nc("@title:window","Open file")
modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal;
//TODO: Support multiple file selection, workaround bug in KDE file dialog
//selectMultiple: true

165
resources/qml/JobSpecs.qml Normal file
View file

@ -0,0 +1,165 @@
// Copyright (c) 2015 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import UM 1.1 as UM
Rectangle {
id: base;
property bool activity: Printer.getPlatformActivity;
property string fileBaseName
property variant activeMachineInstance: UM.MachineManager.activeMachineInstance
onActiveMachineInstanceChanged:
{
base.createFileName()
}
UM.I18nCatalog { id: catalog; name:"cura"}
property variant printDuration: PrintInformation.currentPrintTime;
property real printMaterialAmount: PrintInformation.materialAmount;
width: UM.Theme.sizes.jobspecs.width
height: childrenRect.height
color: "transparent"
function createFileName(){
var splitMachineName = UM.MachineManager.activeMachineInstance.split(" ")
var abbrMachine = ''
for (var i = 0; i < splitMachineName.length; i++){
if (splitMachineName[i].search(/ultimaker/i) != -1){
abbrMachine += 'UM'
}
else{
if (splitMachineName[i].charAt(0).search(/[0-9]/g) == -1)
abbrMachine += splitMachineName[i].charAt(0)
}
var regExpAdditives = /[0-9\+]/g;
var resultAdditives = splitMachineName[i].match(regExpAdditives);
if (resultAdditives != null){
for (var j = 0; j < resultAdditives.length; j++){
abbrMachine += resultAdditives[j]
}
}
}
printJobTextfield.text = abbrMachine + '_' + base.fileBaseName
}
Connections {
target: openDialog
onHasMesh: {
if(base.fileBaseName == ''){
base.fileBaseName = name
base.createFileName()
}
}
}
onActivityChanged: {
if (activity == false){
base.fileBaseName = ''
base.createFileName()
}
}
TextField {
id: printJobTextfield
anchors.right: parent.right
height: UM.Theme.sizes.jobspecs_line.height
width: base.width
property int unremovableSpacing: 5
text: ''
horizontalAlignment: TextInput.AlignRight
onTextChanged: Printer.setJobName(text)
visible: base.activity
onEditingFinished: {
if (printJobTextfield.text != ''){
printJobTextfield.focus = false
}
}
validator: RegExpValidator {
regExp: /^[^\\ \/ \.]*$/
}
style: TextFieldStyle{
textColor: UM.Theme.colors.setting_control_text;
font: UM.Theme.fonts.default;
background: Rectangle {
opacity: 0
border.width: 0
}
}
}
Label{
id: boundingSpec
anchors.top: printJobTextfield.bottom
anchors.right: parent.right
height: UM.Theme.sizes.jobspecs_line.height
verticalAlignment: Text.AlignVCenter
font: UM.Theme.fonts.small
color: UM.Theme.colors.text_subtext
text: Printer.getSceneBoundingBoxString
}
Rectangle {
id: specsRow
anchors.top: boundingSpec.bottom
anchors.right: parent.right
height: UM.Theme.sizes.jobspecs_line.height
Item{
width: parent.width
height: parent.height
UM.RecolorImage {
id: timeIcon
anchors.right: timeSpec.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width/2
anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.sizes.save_button_specs_icons.width
height: UM.Theme.sizes.save_button_specs_icons.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.text_subtext
source: UM.Theme.icons.print_time;
}
Label{
id: timeSpec
anchors.right: lengthIcon.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.small
color: UM.Theme.colors.text_subtext
text: (!base.printDuration || !base.printDuration.valid) ? "00h 00min" : base.printDuration.getDisplayString(UM.DurationFormat.Short)
}
UM.RecolorImage {
id: lengthIcon
anchors.right: lengthSpec.left
anchors.rightMargin: UM.Theme.sizes.default_margin.width/2
anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.sizes.save_button_specs_icons.width
height: UM.Theme.sizes.save_button_specs_icons.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.text_subtext
source: UM.Theme.icons.category_material;
}
Label{
id: lengthSpec
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.small
color: UM.Theme.colors.text_subtext
text: base.printMaterialAmount <= 0 ? "0.0 m" : catalog.i18nc("@label %1 is length of filament","%1 m").arg(base.printMaterialAmount)
}
}
}
}

View file

@ -81,7 +81,7 @@ Item{
text: catalog.i18nc("@label","Global Profile:");
width: parent.width/100*45
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.text;
}

View file

@ -10,187 +10,71 @@ import UM 1.1 as UM
Rectangle {
id: base;
UM.I18nCatalog { id: catalog; name:"cura"}
property real progress: UM.Backend.progress;
property bool activity: Printer.getPlatformActivity;
Behavior on progress { NumberAnimation { duration: 250; } }
property int totalHeight: childrenRect.height
//Behavior on progress { NumberAnimation { duration: 250; } }
property int totalHeight: childrenRect.height + UM.Theme.sizes.default_margin.height
property string fileBaseName
property variant activeMachineInstance: UM.MachineManager.activeMachineInstance
onActiveMachineInstanceChanged:
{
base.createFileName()
}
UM.I18nCatalog { id: catalog; name:"cura"}
property variant printDuration: PrintInformation.currentPrintTime;
property real printMaterialAmount: PrintInformation.materialAmount;
function createFileName(){
var splitMachineName = UM.MachineManager.activeMachineInstance.split(" ")
var abbrMachine = ''
for (var i = 0; i < splitMachineName.length; i++){
if (splitMachineName[i].search(/ultimaker/i) != -1){
abbrMachine += 'UM'
}
else{
if (splitMachineName[i].charAt(0).search(/[0-9]/g) == -1)
abbrMachine += splitMachineName[i].charAt(0)
}
var regExpAdditives = /[0-9\+]/g;
var resultAdditives = splitMachineName[i].match(regExpAdditives);
if (resultAdditives != null){
for (var j = 0; j < resultAdditives.length; j++){
abbrMachine += resultAdditives[j]
}
}
}
printJobTextfield.text = abbrMachine + '_' + base.fileBaseName
}
Connections {
target: openDialog
onHasMesh: {
if(base.fileBaseName == ''){
base.fileBaseName = name
base.createFileName()
property string statusText: {
if(progress == 0) {
if(!activity) {
return catalog.i18nc("@label:PrintjobStatus","Please load a 3d model");
} else {
return catalog.i18nc("@label:PrintjobStatus","Preparing to slice...");
}
} else if(base.progress < 0.99) {
return catalog.i18nc("@label:PrintjobStatus","Slicing...");
} else {
return catalog.i18nc("@label:PrintjobStatus","Ready to ") + UM.OutputDeviceManager.activeDeviceShortDescription;
}
}
onActivityChanged: {
if (activity == false){
base.fileBaseName = ''
base.createFileName()
}
Label {
id: statusLabel
width: parent.width - 2 * UM.Theme.sizes.default_margin.width
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
color: UM.Theme.colors.text
font: UM.Theme.fonts.large
text: statusText;
}
Rectangle{
id: printJobRow
implicitWidth: base.width;
implicitHeight: UM.Theme.sizes.save_button_header.height
anchors.top: parent.top
color: UM.Theme.colors.sidebar_header_bar
Label{
id: printJobTextfieldLabel
text: catalog.i18nc("@label:textbox", "Printjob Name");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_white
}
TextField {
id: printJobTextfield
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
width: parent.width/100*55
height: UM.Theme.sizes.sidebar_inputFields.height
property int unremovableSpacing: 5
text: ''
onTextChanged: Printer.setJobName(text)
onEditingFinished: {
if (printJobTextfield.text != ''){
printJobTextfield.focus = false
}
}
validator: RegExpValidator {
regExp: /^[^\\ \/ \.]*$/
}
style: TextFieldStyle{
textColor: UM.Theme.colors.setting_control_text;
font: UM.Theme.fonts.default;
background: Rectangle {
radius: 0
implicitWidth: parent.width
implicitHeight: parent.height
border.width: 1;
border.color: UM.Theme.colors.slider_groove_border;
}
}
}
}
id: progressBar
width: parent.width - 2 * UM.Theme.sizes.default_margin.width
height: UM.Theme.sizes.progressbar.height
anchors.top: statusLabel.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height/4
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 {
id: specsRow
implicitWidth: base.width
implicitHeight: UM.Theme.sizes.sidebar_specs_bar.height
anchors.top: printJobRow.bottom
visible: base.progress > 0.99 && base.activity == true
Item{
id: time
width: childrenRect.width;
Rectangle{
width: Math.max(parent.width * base.progress)
height: parent.height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
anchors.top: parent.top
visible: base.printMaterialAmount > 0 ? true : false
UM.RecolorImage {
id: timeIcon
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
width: UM.Theme.sizes.save_button_specs_icons.width
height: UM.Theme.sizes.save_button_specs_icons.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.text_hover
source: UM.Theme.icons.print_time;
}
Label{
id: timeSpec
anchors.verticalCenter: parent.verticalCenter
anchors.left: timeIcon.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width/2
font: UM.Theme.fonts.default
color: UM.Theme.colors.text
text: (!base.printDuration || !base.printDuration.valid) ? "" : base.printDuration.getDisplayString(UM.DurationFormat.Short)
}
}
Item{
width: parent.width / 100 * 55
height: parent.height
anchors.left: time.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: parent.top
visible: base.printMaterialAmount > 0 ? true : false
UM.RecolorImage {
id: lengthIcon
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
width: UM.Theme.sizes.save_button_specs_icons.width
height: UM.Theme.sizes.save_button_specs_icons.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.text_hover
source: UM.Theme.icons.category_material;
}
Label{
id: lengthSpec
anchors.verticalCenter: parent.verticalCenter
anchors.left: lengthIcon.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width/2
font: UM.Theme.fonts.default
color: UM.Theme.colors.text
text: base.printMaterialAmount <= 0 ? "" : catalog.i18nc("@label %1 is length of filament","%1 m").arg(base.printMaterialAmount)
}
color: UM.Theme.colors.progressbar_control
radius: UM.Theme.sizes.progressbar_radius.width
visible: base.progress > 0.99 ? false : true
}
}
Rectangle{
id: saveRow
width: base.width
height: saveToButton.height + (UM.Theme.sizes.default_margin.height / 2) // height + bottomMargin
anchors.top: specsRow.bottom
height: saveToButton.height
anchors.top: progressBar.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
Button {
id: saveToButton
property int resizedWidth
x: base.width - saveToButton.resizedWidth - UM.Theme.sizes.default_margin.width - UM.Theme.sizes.save_button_save_to_button.height
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;
enabled: base.progress > 0.99 && base.activity == true
height: UM.Theme.sizes.save_button_save_to_button.height
@ -206,39 +90,25 @@ Rectangle {
background: Rectangle {
//opacity: control.enabled ? 1.0 : 0.5
//Behavior on opacity { NumberAnimation { duration: 50; } }
color: {
if(!control.enabled){
return UM.Theme.colors.button;
}
else if(control.enabled && control.hovered) {
return UM.Theme.colors.load_save_button_hover
} else {
return UM.Theme.colors.load_save_button
}
}
border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border :
control.pressed ? UM.Theme.colors.action_button_active_border :
control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border
color: !control.enabled ? UM.Theme.colors.action_button_disabled :
control.pressed ? UM.Theme.colors.action_button_active :
control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button
Behavior on color { ColorAnimation { duration: 50; } }
width: {
var w = 0;
if (base.width*0.55 > actualLabel.width + (UM.Theme.sizes.default_margin.width * 2)){
saveToButton.resizedWidth = base.width*0.55
w = base.width*0.55
}
else {
saveToButton.resizedWidth = actualLabel.width + (UM.Theme.sizes.default_margin.width * 2)
w = actualLabel.width + (UM.Theme.sizes.default_margin.width * 2)
}
if(w < base.width * 0.55) {
w = base.width * 0.55;
}
return w;
saveToButton.resizedWidth = actualLabel.width + (UM.Theme.sizes.default_margin.width * 2)
return saveToButton.resizedWidth
}
Label {
id: actualLabel
opacity: control.enabled ? 1.0 : 0.4
//Behavior on opacity { NumberAnimation { duration: 50; } }
anchors.centerIn: parent
color: UM.Theme.colors.load_save_button_text
font: UM.Theme.fonts.default
color: !control.enabled ? UM.Theme.colors.action_button_disabled_text :
control.pressed ? UM.Theme.colors.action_button_active_text :
control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text
font: UM.Theme.fonts.action_button
text: control.text;
}
}
@ -260,16 +130,12 @@ Rectangle {
style: ButtonStyle {
background: Rectangle {
id: deviceSelectionIcon
color: {
if(!control.enabled){
return UM.Theme.colors.button;
}
else if(control.enabled && control.hovered) {
return UM.Theme.colors.load_save_button_hover
} else {
return UM.Theme.colors.load_save_button
}
}
border.color: !control.enabled ? UM.Theme.colors.action_button_disabled_border :
control.pressed ? UM.Theme.colors.action_button_active_border :
control.hovered ? UM.Theme.colors.action_button_hovered_border : UM.Theme.colors.action_button_border
color: !control.enabled ? UM.Theme.colors.action_button_disabled :
control.pressed ? UM.Theme.colors.action_button_active :
control.hovered ? UM.Theme.colors.action_button_hovered : UM.Theme.colors.action_button
Behavior on color { ColorAnimation { duration: 50; } }
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.save_button_text_margin.width / 2;
@ -282,9 +148,11 @@ Rectangle {
width: UM.Theme.sizes.standard_arrow.width
height: UM.Theme.sizes.standard_arrow.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.load_save_button_text
source: UM.Theme.icons.arrow_bottom
sourceSize.height: height
color: !control.enabled ? UM.Theme.colors.action_button_disabled_text :
control.pressed ? UM.Theme.colors.action_button_active_text :
control.hovered ? UM.Theme.colors.action_button_hovered_text : UM.Theme.colors.action_button_text;
source: UM.Theme.icons.arrow_bottom;
}
}
label: Label{ }

View file

@ -15,6 +15,7 @@ Rectangle
property Action addMachineAction;
property Action configureMachinesAction;
property Action manageProfilesAction;
property int currentModeIndex;
color: UM.Theme.colors.sidebar;
UM.I18nCatalog { id: catalog; name:"cura"}
@ -49,38 +50,118 @@ Rectangle
addMachineAction: base.addMachineAction;
configureMachinesAction: base.configureMachinesAction;
modesModel: modesListModel;
}
currentModeIndex:
{
var index = parseInt(UM.Preferences.getValue("cura/active_mode"))
if(index)
{
return index;
}
return 0;
}
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex);
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 {
id: profileItem
manageProfilesAction: base.manageProfilesAction
anchors.top: header.bottom
anchors.top: settingsModeSelection.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width
height: totalHeightProfileSetup
}
currentModeIndex:
{
var index = parseInt(UM.Preferences.getValue("cura/active_mode"))
if(index)
{
return index;
}
return 0;
}
onCurrentModeIndexChanged:
{
UM.Preferences.setValue("cura/active_mode", currentModeIndex);
}
Label {
id: settingsModeLabel
text: catalog.i18nc("@label:listbox","Setup");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: headerSeparator.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width/100*45
font: UM.Theme.fonts.large;
color: UM.Theme.colors.text
}
Rectangle {
id: settingsModeSelection
width: parent.width/100*55
height: UM.Theme.sizes.sidebar_header_mode_toggle.height
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.top: headerSeparator.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
Component{
id: wizardDelegate
Button {
height: settingsModeSelection.height
anchors.left: parent.left
anchors.leftMargin: model.index * (settingsModeSelection.width / 2)
anchors.verticalCenter: parent.verticalCenter
width: parent.width / 2
text: model.text
exclusiveGroup: modeMenuGroup;
checkable: true;
checked: base.currentModeIndex == index
onClicked: base.currentModeIndex = index
style: ButtonStyle {
background: Rectangle {
border.color: control.checked ? UM.Theme.colors.toggle_checked_border :
control.pressed ? UM.Theme.colors.toggle_active_border :
control.hovered ? UM.Theme.colors.toggle_hovered_border : UM.Theme.colors.toggle_unchecked_border
color: control.checked ? UM.Theme.colors.toggle_checked :
control.pressed ? UM.Theme.colors.toggle_active :
control.hovered ? UM.Theme.colors.toggle_hovered : UM.Theme.colors.toggle_unchecked
Behavior on color { ColorAnimation { duration: 50; } }
Label {
anchors.centerIn: parent
color: control.checked ? UM.Theme.colors.toggle_checked_text :
control.pressed ? UM.Theme.colors.toggle_active_text :
control.hovered ? UM.Theme.colors.toggle_hovered_text : UM.Theme.colors.toggle_unchecked_text
font: UM.Theme.fonts.default
text: control.text;
}
}
label: Item { }
}
}
}
ExclusiveGroup { id: modeMenuGroup; }
ListView{
id: modesList
property var index: 0
model: modesListModel
delegate: wizardDelegate
anchors.top: parent.top
anchors.left: parent.left
width: parent.width
}
}
Loader
{
id: sidebarContents;
anchors.bottom: saveButton.top
anchors.bottom: footerSeparator.top
anchors.top: profileItem.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: base.left
anchors.right: base.right
source: modesListModel.count > header.currentModeIndex ? modesListModel.get(header.currentModeIndex).file : "";
source: modesListModel.count > base.currentModeIndex ? modesListModel.get(base.currentModeIndex).file : "";
property Item sidebar: base;
@ -101,6 +182,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
{
id: saveButton;
@ -123,6 +213,6 @@ Rectangle
{
modesListModel.append({ text: catalog.i18nc("@title:tab", "Simple"), file: "SidebarSimple.qml" })
modesListModel.append({ text: catalog.i18nc("@title:tab", "Advanced"), file: "SidebarAdvanced.qml" })
sidebarContents.setSource(modesListModel.get(header.currentModeIndex).file)
sidebarContents.setSource(modesListModel.get(base.currentModeIndex).file)
}
}

View file

@ -11,8 +11,6 @@ Item
{
id: base;
// Machine Setup
property variant modesModel;
property int currentModeIndex: 0;
property Action addMachineAction;
property Action configureMachinesAction;
UM.I18nCatalog { id: catalog; name:"cura"}
@ -21,74 +19,28 @@ Item
Rectangle {
id: settingsModeRow
width: base.width
height: UM.Theme.sizes.sidebar_header.height
height: 0
anchors.top: parent.top
color: UM.Theme.colors.sidebar_header_bar
}
Label{
id: settingsModeLabel
text: catalog.i18nc("@label:listbox","Print Setup");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
width: parent.width/100*45
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_white
}
Rectangle{
id: settingsModeSelection
width: parent.width/100*55
height: UM.Theme.sizes.sidebar_header_mode_toggle.height
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width;
anchors.verticalCenter: parent.verticalCenter
Component{
id: wizardDelegate
Button {
height: settingsModeSelection.height
anchors.left: parent.left
anchors.leftMargin: model.index * (settingsModeSelection.width / 2)
anchors.verticalCenter: parent.verticalCenter
width: parent.width / 2
text: model.text
exclusiveGroup: modeMenuGroup;
checkable: true;
checked: base.currentModeIndex == index
onClicked: base.currentModeIndex = index
style: ButtonStyle {
background: Rectangle {
color: control.checked ? UM.Theme.colors.toggle_active : UM.Theme.colors.toggle_disabled
Behavior on color { ColorAnimation { duration: 50; } }
Label {
anchors.centerIn: parent
color: control.checked ? UM.Theme.colors.toggle_active_text : UM.Theme.colors.toggle_disabled_text
font: UM.Theme.fonts.default
text: control.text;
}
}
label: Item { }
}
}
}
ExclusiveGroup { id: modeMenuGroup; }
ListView{
id: modesList
property var index: 0
model: base.modesModel
delegate: wizardDelegate
anchors.top: parent.top
anchors.left: parent.left
width: parent.width
}
}
Label{
id: printjobTabLabel
text: catalog.i18nc("@label:listbox","Print Job");
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: settingsModeRow.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width/100*45
font: UM.Theme.fonts.large;
color: UM.Theme.colors.text
}
Rectangle {
id: machineSelectionRow
width: base.width
height: UM.Theme.sizes.sidebar_setup.height
anchors.top: settingsModeRow.bottom
anchors.top: printjobTabLabel.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.horizontalCenter: parent.horizontalCenter
@ -100,7 +52,7 @@ Item
anchors.leftMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.text;
}
ToolButton {

View file

@ -13,6 +13,9 @@ Item
id: base;
anchors.fill: parent;
signal showTooltip(Item item, point location, string text);
signal hideTooltip();
property Action configureSettings;
property variant minimumPrintTime: PrintInformation.minimumPrintTime;
property variant maximumPrintTime: PrintInformation.maximumPrintTime;
@ -20,12 +23,110 @@ Item
Component.onCompleted: PrintInformation.enabled = true
Component.onDestruction: PrintInformation.enabled = false
UM.I18nCatalog { id: catalog; name:"cura"}
/*
Rectangle{
id: speedCellLeft
anchors.top: parent.top
anchors.left: parent.left
width: base.width/100*35 - UM.Theme.sizes.default_margin.width
height: childrenRect.height
Label{
id: speedLabel
//: Speed selection label
text: catalog.i18nc("@label","Speed:");
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text;
anchors.top: parent.top
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
}
}
Rectangle {
id: speedCellRight
anchors.left: speedCellLeft.right
anchors.top: speedCellLeft.top
anchors.topMargin: UM.Theme.sizes.default_margin.height
width: parent.width/100*65 - UM.Theme.sizes.default_margin.width
height: childrenRect.height
CheckBox{
id: normalSpeedCheckBox
property bool hovered_ex: false
anchors.top: parent.top
anchors.left: parent.left
//: Normal speed checkbox
text: catalog.i18nc("@option:check","Normal");
style: UM.Theme.styles.checkbox;
exclusiveGroup: speedCheckBoxGroup
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.speed_print <= 60 : true;
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked:
{
UM.MachineManager.setSettingValue("speed_print", 60)
}
onEntered:
{
parent.hovered_ex = true
base.showTooltip(normalSpeedCheckBox, Qt.point(-speedCellRight.x, parent.height),
catalog.i18nc("@label", "Use normal printing speed. This will result in high quality prints."));
}
onExited:
{
parent.hovered_ex = false
base.hideTooltip();
}
}
}
CheckBox{
id: highSpeedCheckBox
property bool hovered_ex: false
anchors.top: parent.top
anchors.left: normalSpeedCheckBox.right
anchors.leftMargin: UM.Theme.sizes.default_margin.width
//: High speed checkbox
text: catalog.i18nc("@option:check","Fast");
style: UM.Theme.styles.checkbox;
exclusiveGroup: speedCheckBoxGroup
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.speed_print > 60 : true;
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked:
{
UM.MachineManager.setSettingValue("speed_print", 100)
}
onEntered:
{
parent.hovered_ex = true
base.showTooltip(normalSpeedCheckBox, Qt.point(-speedCellRight.x, parent.height),
catalog.i18nc("@label", "Use high printing speed. This will reduce printing time, but may affect the quality of the print."));
}
onExited:
{
parent.hovered_ex = false
base.hideTooltip();
}
}
}
ExclusiveGroup { id: speedCheckBoxGroup; }
}
*/
Rectangle{
id: infillCellLeft
anchors.top: parent.top
anchors.left: parent.left
width: base.width/100* 55 - UM.Theme.sizes.default_margin.width
width: base.width/100* 35 - UM.Theme.sizes.default_margin.width
height: childrenRect.height < UM.Theme.sizes.simple_mode_infill_caption.height ? UM.Theme.sizes.simple_mode_infill_caption.height : childrenRect.height
Label{
@ -33,34 +134,34 @@ Item
//: Infill selection label
text: catalog.i18nc("@label","Infill:");
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.text;
anchors.top: parent.top
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
}
Label{
/* Label{
id: infillCaption
width: infillCellLeft.width - UM.Theme.sizes.default_margin.width
width: infillCellLeft.width - UM.Theme.sizes.default_margin.width * 2
text: infillModel.count > 0 && infillListView.activeIndex != -1 ? infillModel.get(infillListView.activeIndex).text : ""
font: UM.Theme.fonts.caption
wrapMode: Text.Wrap
color: UM.Theme.colors.text
color: UM.Theme.colors.text_subtext
anchors.top: infillLabel.bottom
anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
}
} */
}
Flow {
id: infillCellRight
height: childrenRect.height;
width: base.width / 100 * 45
width: base.width / 100 * 65
spacing: UM.Theme.sizes.default_margin.width
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width - (UM.Theme.sizes.default_margin.width/4)
anchors.top: parent.top
anchors.left: infillCellLeft.right
anchors.top: infillCellLeft.top
anchors.topMargin: UM.Theme.sizes.default_margin.height
Repeater {
@ -91,28 +192,41 @@ Item
Rectangle{
id: infillIconLining
width: infillCellRight.width / 3 - UM.Theme.sizes.default_margin.width;
width: (infillCellRight.width - 3 * UM.Theme.sizes.default_margin.width) / 4;
height: width
border.color: infillListView.activeIndex == index ? UM.Theme.colors.setting_control_text : UM.Theme.colors.setting_control_border
border.width: infillListView.activeIndex == index ? 2 : 1
color: infillListView.activeIndex == index ? UM.Theme.colors.setting_category_active : "transparent"
border.color: (infillListView.activeIndex == index) ? UM.Theme.colors.setting_control_selected :
(mousearea.containsMouse ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border)
border.width: UM.Theme.sizes.default_lining.width
color: infillListView.activeIndex == index ? UM.Theme.colors.setting_control_selected : "transparent"
Image {
UM.RecolorImage {
id: infillIcon
anchors.fill: parent;
anchors.margins: UM.Theme.sizes.default_margin.width / 2
anchors.margins: UM.Theme.sizes.infill_button_margin.width
sourceSize.width: width
sourceSize.height: width
source: UM.Theme.icons[model.icon];
color: (infillListView.activeIndex == index) ? UM.Theme.colors.text_white : UM.Theme.colors.text
}
MouseArea {
id: mousearea
anchors.fill: parent
hoverEnabled: true
onClicked: {
infillListView.activeIndex = index
UM.MachineManager.setSettingValue("infill_sparse_density", model.percentage)
if (infillListView.activeIndex != index)
{
infillListView.activeIndex = index
UM.MachineManager.setSettingValue("infill_sparse_density", model.percentage)
}
}
onEntered: {
base.showTooltip(infillCellRight, Qt.point(-infillCellRight.x, parent.height), model.text);
}
onExited: {
base.hideTooltip();
}
}
}
@ -132,9 +246,15 @@ Item
Component.onCompleted:
{
infillModel.append({
name: catalog.i18nc("@label", "Sparse"),
name: catalog.i18nc("@label", "Hollow"),
percentage: 0,
text: catalog.i18nc("@label", "No (0%) infill will leave your model hollow at the cost of low strength"),
icon: "hollow"
})
infillModel.append({
name: catalog.i18nc("@label", "Light"),
percentage: 20,
text: catalog.i18nc("@label", "Sparse (20%) infill will give your model an average strength"),
text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"),
icon: "sparse"
})
infillModel.append({
@ -158,7 +278,7 @@ Item
anchors.top: infillCellRight.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: parent.left
width: parent.width/100*45 - UM.Theme.sizes.default_margin.width
width: parent.width/100*35 - UM.Theme.sizes.default_margin.width
height: childrenRect.height
Label{
@ -167,45 +287,81 @@ Item
//: Helpers selection label
text: catalog.i18nc("@label:listbox","Helpers:");
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.text;
}
}
Rectangle {
id: helpersCellRight
anchors.top: helpersCellLeft.top
anchors.left: helpersCellLeft.right
width: parent.width/100*55 - UM.Theme.sizes.default_margin.width
width: parent.width/100*65 - UM.Theme.sizes.default_margin.width
height: childrenRect.height
CheckBox{
id: skirtCheckBox
id: brimCheckBox
property bool hovered_ex: false
anchors.top: parent.top
anchors.left: parent.left
//: Setting enable skirt adhesion checkbox
text: catalog.i18nc("@option:check","Enable Skirt Adhesion");
text: catalog.i18nc("@option:check","Generate Brim");
style: UM.Theme.styles.checkbox;
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.adhesion_type == "brim" : false;
onClicked:
{
UM.MachineManager.setSettingValue("adhesion_type", "brim")
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked:
{
parent.checked = !parent.checked
UM.MachineManager.setSettingValue("adhesion_type", parent.checked?"brim":"skirt")
}
onEntered:
{
parent.hovered_ex = true
base.showTooltip(brimCheckBox, Qt.point(-helpersCellRight.x, parent.height),
catalog.i18nc("@label", "Enable printing a brim. This will add a single-layer-thick flat area around your object which is easy to cut off afterwards."));
}
onExited:
{
parent.hovered_ex = false
base.hideTooltip();
}
}
}
CheckBox{
anchors.top: skirtCheckBox.bottom
id: supportCheckBox
property bool hovered_ex: false
anchors.top: brimCheckBox.bottom
anchors.topMargin: UM.Theme.sizes.default_lining.height
anchors.left: parent.left
//: Setting enable support checkbox
text: catalog.i18nc("@option:check","Enable Support");
text: catalog.i18nc("@option:check","Generate Support Structure");
style: UM.Theme.styles.checkbox;
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.support_enable : false;
onClicked:
{
UM.MachineManager.setSettingValue("support_enable", checked)
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked:
{
parent.checked = !parent.checked
UM.MachineManager.setSettingValue("support_enable", parent.checked)
}
onEntered:
{
parent.hovered_ex = true
base.showTooltip(supportCheckBox, Qt.point(-helpersCellRight.x, parent.height),
catalog.i18nc("@label", "Enable printing support structures. This will build up supporting structures below the model to prevent the model from sagging or printing in mid air."));
}
onExited:
{
parent.hovered_ex = false
base.hideTooltip();
}
}
}
}

View file

@ -8,13 +8,15 @@ import QtQuick.Layouts 1.1
import UM 1.0 as UM
Rectangle {
UM.PointingRectangle {
id: base;
width: UM.Theme.sizes.tooltip.width;
height: label.height + UM.Theme.sizes.tooltip_margins.height * 2;
color: UM.Theme.colors.tooltip;
arrowSize: UM.Theme.sizes.default_arrow.width
opacity: 0;
Behavior on opacity { NumberAnimation { duration: 100; } }
@ -26,9 +28,10 @@ Rectangle {
y = parent.height - base.height;
} else {
x = position.x - base.width;
y = position.y;
y = position.y - UM.Theme.sizes.tooltip_arrow_margins.height;
}
base.opacity = 1;
target = Qt.point(40 , position.y)
}
function hide() {
@ -47,6 +50,6 @@ Rectangle {
}
wrapMode: Text.Wrap;
font: UM.Theme.fonts.default;
color: UM.Theme.colors.text_default;
color: UM.Theme.colors.tooltip_text;
}
}

View file

@ -20,7 +20,7 @@ Item {
anchors.bottom: parent.bottom;
anchors.left: parent.left;
spacing: UM.Theme.sizes.default_lining.width
spacing: UM.Theme.sizes.button_lining.width
Repeater {
id: repeat
@ -50,20 +50,17 @@ Item {
}
}
Rectangle {
width: base.width
height: base.height
z: parent.z - 1
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: UM.Theme.colors.lining
}
Rectangle {
id: panelBackground;
UM.PointingRectangle {
id: panelBorder;
anchors.left: parent.right;
y: base.activeY
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
anchors.top: base.top;
anchors.topMargin: base.activeY
z: buttons.z -1
target: Qt.point(parent.right, base.activeY + UM.Theme.sizes.button.height/2)
arrowSize: UM.Theme.sizes.default_arrow.width
width: {
if (panel.item && panel.width > 0){
@ -78,9 +75,20 @@ Item {
opacity: panel.item ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
color: UM.Theme.colors.tool_panel_background;
border.width: UM.Theme.sizes.default_lining.width
border.color: UM.Theme.colors.lining
color: UM.Theme.colors.lining;
//border.width: UM.Theme.sizes.default_lining.width
//border.color: UM.Theme.colors.lining
UM.PointingRectangle {
id: panelBackground;
color: UM.Theme.colors.tool_panel_background;
anchors.fill: parent
anchors.margins: UM.Theme.sizes.default_lining.width
target: Qt.point(-UM.Theme.sizes.default_margin.width, UM.Theme.sizes.button.height/2)
arrowSize: parent.arrowSize
}
Loader {
id: panel