Restyling of the sidebar header and and profile setup

commits to: issue CURA-177
This commit is contained in:
Tamara Hogenhout 2015-09-21 16:03:53 +02:00
parent d6793bc197
commit f866ecdd63
5 changed files with 48 additions and 57 deletions

View File

@ -8,69 +8,65 @@ import QtQuick.Layouts 1.1
import UM 1.1 as UM
Column{
Item{
id: base;
UM.I18nCatalog { id: catalog; name:"cura"}
property int totalHeightProfileSetup: childrenRect.height
property Action manageProfilesAction
spacing: 0
Rectangle{
id: variantItem;
height: UM.Theme.sizes.sidebar_setup.height
Rectangle {
id: variantRow
anchors.top: base.top
width: base.width
height: UM.Theme.sizes.sidebar_setup.height
visible: UM.MachineManager.hasVariants;
Rectangle {
id: variantRow
width: base.width
height: parent.heigth
Label{
id: variantLabel
text: catalog.i18nc("@label","Variant:");
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;
}
Label{
id: variantLabel
text: catalog.i18nc("@label","Variant:");
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;
}
ToolButton {
id: variantSelection
text: UM.MachineManager.activeMachineVariant
width: parent.width/100*55
height: UM.Theme.sizes.setting_control.height
tooltip: UM.MachineManager.activeMachineInstance;
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter
style: UM.Theme.styles.sidebar_header_button
ToolButton {
id: variantSelection
text: UM.MachineManager.activeMachineVariant
width: parent.width/100*55
height: UM.Theme.sizes.setting_control.height
tooltip: UM.MachineManager.activeMachineInstance;
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter
style: UM.Theme.styles.sidebar_header_button
menu: Menu
menu: Menu
{
id: variantsSelectionMenu
Instantiator
{
id: variantsSelectionMenu
Instantiator
model: UM.MachineVariantsModel { }
MenuItem
{
model: UM.MachineVariantsModel { }
MenuItem
{
text: model.name;
checkable: true;
checked: model.active;
exclusiveGroup: variantSelectionMenuGroup;
onTriggered: UM.MachineManager.setActiveMachineVariant(model.getItem(index).name)
}
text: model.name;
checkable: true;
checked: model.active;
exclusiveGroup: variantSelectionMenuGroup;
onTriggered: UM.MachineManager.setActiveMachineVariant(model.getItem(index).name)
}
ExclusiveGroup { id: variantSelectionMenuGroup; }
}
ExclusiveGroup { id: variantSelectionMenuGroup; }
}
}
}
Rectangle{
id: globalProfileRow;
anchors.top: UM.MachineManager.hasVariants ? variantRow.bottom : base.top
//anchors.top: variantRow.bottom
height: UM.Theme.sizes.sidebar_setup.height
width: base.width
@ -148,8 +144,4 @@ Column{
// }
}
}
Rectangle{
width: base.width
height: UM.Theme.sizes.default_margin.width/2
}
}

View File

@ -76,6 +76,7 @@ Rectangle
id: sidebarContents;
anchors.bottom: saveButton.top
anchors.top: profileItem.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.left: base.left
anchors.right: base.right

View File

@ -80,8 +80,6 @@ Item
anchors.top: parent.top
anchors.left: parent.left
width: parent.width
height: UM.Theme.sizes.sidebar_header.height
currentIndex: base.currentIndex;
}
}
}
@ -89,8 +87,9 @@ Item
Rectangle {
id: machineSelectionRow
width: base.width
height: UM.Theme.sizes.sidebar_header.height
height: UM.Theme.sizes.sidebar_setup.height
anchors.top: settingsModeRow.bottom
anchors.topMargin: UM.Theme.sizes.default_margin.height
anchors.horizontalCenter: parent.horizontalCenter
Label{
@ -109,7 +108,6 @@ Item
width: parent.width/100*55
height: UM.Theme.sizes.setting_control.height
tooltip: UM.MachineManager.activeMachineInstance;
//style: UM.Theme.styles.sidebar_header_button;
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter

View File

@ -34,17 +34,17 @@ QtObject {
elide: Text.ElideRight;
anchors.left: parent.left;
anchors.leftMargin: UM.Theme.sizes.setting_unit_margin.width
anchors.right: downArrow.left;
anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width
anchors.right: separationLine.left;
anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.fonts.default
}
Rectangle{
id: separationLine
width: 1
height: UM.Theme.sizes.setting_control.height
color: UM.Theme.colors.setting_control_border
anchors.right: sidebarComboBoxLabel.right
anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width
anchors.right: downArrow.left
anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width + downArrow.width/2
anchors.top: parent.top
z: parent.z + 1
}

View File

@ -155,7 +155,7 @@
"sidebar": [26.0, 10.0],
"sidebar_header": [0.0, 3.8],
"sidebar_header_mode_toggle": [0.0, 2.4],
"sidebar_setup": [0.0, 2.8],
"sidebar_setup": [0.0, 2.6],
"sidebar_subParts": [0.0, 2.4],
"sidebar_specs_bar": [0.0, 2.2],
"sidebar_inputFields": [0.0, 1.9],
@ -166,7 +166,7 @@
"section_icon_column": [2.8, 0.0],
"setting": [21.0, 1.8],
"setting_control": [6.0, 2.0],
"setting_control": [7.5, 2.0],
"setting_control_margin": [3.0, 3.0],
"setting_unit_margin": [0.5, 0.5],
"setting_text_maxwidth": [40.0, 0.0],