mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 01:26:01 +08:00
Restyling of the sidebar header and and profile setup
commits to: issue CURA-177
This commit is contained in:
parent
d6793bc197
commit
f866ecdd63
@ -8,69 +8,65 @@ import QtQuick.Layouts 1.1
|
|||||||
|
|
||||||
import UM 1.1 as UM
|
import UM 1.1 as UM
|
||||||
|
|
||||||
Column{
|
Item{
|
||||||
id: base;
|
id: base;
|
||||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||||
property int totalHeightProfileSetup: childrenRect.height
|
property int totalHeightProfileSetup: childrenRect.height
|
||||||
property Action manageProfilesAction
|
property Action manageProfilesAction
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
Rectangle{
|
Rectangle {
|
||||||
id: variantItem;
|
id: variantRow
|
||||||
height: UM.Theme.sizes.sidebar_setup.height
|
anchors.top: base.top
|
||||||
width: base.width
|
width: base.width
|
||||||
|
height: UM.Theme.sizes.sidebar_setup.height
|
||||||
visible: UM.MachineManager.hasVariants;
|
visible: UM.MachineManager.hasVariants;
|
||||||
|
|
||||||
Rectangle {
|
Label{
|
||||||
id: variantRow
|
id: variantLabel
|
||||||
width: base.width
|
text: catalog.i18nc("@label","Variant:");
|
||||||
height: parent.heigth
|
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{
|
ToolButton {
|
||||||
id: variantLabel
|
id: variantSelection
|
||||||
text: catalog.i18nc("@label","Variant:");
|
text: UM.MachineManager.activeMachineVariant
|
||||||
anchors.left: parent.left
|
width: parent.width/100*55
|
||||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
height: UM.Theme.sizes.setting_control.height
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
tooltip: UM.MachineManager.activeMachineInstance;
|
||||||
width: parent.width/100*45
|
anchors.right: parent.right
|
||||||
font: UM.Theme.fonts.default;
|
anchors.rightMargin: UM.Theme.sizes.default_margin.width
|
||||||
}
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
style: UM.Theme.styles.sidebar_header_button
|
||||||
|
|
||||||
ToolButton {
|
menu: Menu
|
||||||
id: variantSelection
|
{
|
||||||
text: UM.MachineManager.activeMachineVariant
|
id: variantsSelectionMenu
|
||||||
width: parent.width/100*55
|
Instantiator
|
||||||
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
|
|
||||||
{
|
{
|
||||||
id: variantsSelectionMenu
|
model: UM.MachineVariantsModel { }
|
||||||
Instantiator
|
MenuItem
|
||||||
{
|
{
|
||||||
model: UM.MachineVariantsModel { }
|
text: model.name;
|
||||||
MenuItem
|
checkable: true;
|
||||||
{
|
checked: model.active;
|
||||||
text: model.name;
|
exclusiveGroup: variantSelectionMenuGroup;
|
||||||
checkable: true;
|
onTriggered: UM.MachineManager.setActiveMachineVariant(model.getItem(index).name)
|
||||||
checked: model.active;
|
|
||||||
exclusiveGroup: variantSelectionMenuGroup;
|
|
||||||
onTriggered: UM.MachineManager.setActiveMachineVariant(model.getItem(index).name)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExclusiveGroup { id: variantSelectionMenuGroup; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExclusiveGroup { id: variantSelectionMenuGroup; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id: globalProfileRow;
|
id: globalProfileRow;
|
||||||
|
anchors.top: UM.MachineManager.hasVariants ? variantRow.bottom : base.top
|
||||||
|
//anchors.top: variantRow.bottom
|
||||||
height: UM.Theme.sizes.sidebar_setup.height
|
height: UM.Theme.sizes.sidebar_setup.height
|
||||||
width: base.width
|
width: base.width
|
||||||
|
|
||||||
@ -148,8 +144,4 @@ Column{
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle{
|
|
||||||
width: base.width
|
|
||||||
height: UM.Theme.sizes.default_margin.width/2
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -76,6 +76,7 @@ Rectangle
|
|||||||
id: sidebarContents;
|
id: sidebarContents;
|
||||||
anchors.bottom: saveButton.top
|
anchors.bottom: saveButton.top
|
||||||
anchors.top: profileItem.bottom
|
anchors.top: profileItem.bottom
|
||||||
|
anchors.topMargin: UM.Theme.sizes.default_margin.height
|
||||||
anchors.left: base.left
|
anchors.left: base.left
|
||||||
anchors.right: base.right
|
anchors.right: base.right
|
||||||
|
|
||||||
|
@ -80,8 +80,6 @@ Item
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: UM.Theme.sizes.sidebar_header.height
|
|
||||||
currentIndex: base.currentIndex;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,8 +87,9 @@ Item
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: machineSelectionRow
|
id: machineSelectionRow
|
||||||
width: base.width
|
width: base.width
|
||||||
height: UM.Theme.sizes.sidebar_header.height
|
height: UM.Theme.sizes.sidebar_setup.height
|
||||||
anchors.top: settingsModeRow.bottom
|
anchors.top: settingsModeRow.bottom
|
||||||
|
anchors.topMargin: UM.Theme.sizes.default_margin.height
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
Label{
|
Label{
|
||||||
@ -109,7 +108,6 @@ Item
|
|||||||
width: parent.width/100*55
|
width: parent.width/100*55
|
||||||
height: UM.Theme.sizes.setting_control.height
|
height: UM.Theme.sizes.setting_control.height
|
||||||
tooltip: UM.MachineManager.activeMachineInstance;
|
tooltip: UM.MachineManager.activeMachineInstance;
|
||||||
//style: UM.Theme.styles.sidebar_header_button;
|
|
||||||
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.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
@ -34,17 +34,17 @@ QtObject {
|
|||||||
elide: Text.ElideRight;
|
elide: Text.ElideRight;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: UM.Theme.sizes.setting_unit_margin.width
|
anchors.leftMargin: UM.Theme.sizes.setting_unit_margin.width
|
||||||
anchors.right: downArrow.left;
|
anchors.right: separationLine.left;
|
||||||
anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width
|
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
font: UM.Theme.fonts.default
|
font: UM.Theme.fonts.default
|
||||||
}
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
id: separationLine
|
||||||
width: 1
|
width: 1
|
||||||
height: UM.Theme.sizes.setting_control.height
|
height: UM.Theme.sizes.setting_control.height
|
||||||
color: UM.Theme.colors.setting_control_border
|
color: UM.Theme.colors.setting_control_border
|
||||||
anchors.right: sidebarComboBoxLabel.right
|
anchors.right: downArrow.left
|
||||||
anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width
|
anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width + downArrow.width/2
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
z: parent.z + 1
|
z: parent.z + 1
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@
|
|||||||
"sidebar": [26.0, 10.0],
|
"sidebar": [26.0, 10.0],
|
||||||
"sidebar_header": [0.0, 3.8],
|
"sidebar_header": [0.0, 3.8],
|
||||||
"sidebar_header_mode_toggle": [0.0, 2.4],
|
"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_subParts": [0.0, 2.4],
|
||||||
"sidebar_specs_bar": [0.0, 2.2],
|
"sidebar_specs_bar": [0.0, 2.2],
|
||||||
"sidebar_inputFields": [0.0, 1.9],
|
"sidebar_inputFields": [0.0, 1.9],
|
||||||
@ -166,7 +166,7 @@
|
|||||||
"section_icon_column": [2.8, 0.0],
|
"section_icon_column": [2.8, 0.0],
|
||||||
|
|
||||||
"setting": [21.0, 1.8],
|
"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_control_margin": [3.0, 3.0],
|
||||||
"setting_unit_margin": [0.5, 0.5],
|
"setting_unit_margin": [0.5, 0.5],
|
||||||
"setting_text_maxwidth": [40.0, 0.0],
|
"setting_text_maxwidth": [40.0, 0.0],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user