Merge branch 'master' of github.com:ultimaker/Cura into per_object_settings

* 'master' of github.com:ultimaker/Cura:
  15.10 restyling of the sidebar header
This commit is contained in:
Arjen Hiemstra 2015-09-01 18:04:06 +02:00
commit 82c7dd8d0a
3 changed files with 53 additions and 76 deletions

View File

@ -4,11 +4,10 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import UM 1.1 as UM import UM 1.1 as UM
ColumnLayout Item
{ {
id: base; id: base;
// Machine Setup // Machine Setup
@ -18,7 +17,6 @@ ColumnLayout
property Action configureMachinesAction; property Action configureMachinesAction;
UM.I18nCatalog { id: catalog; name:"cura"} UM.I18nCatalog { id: catalog; name:"cura"}
property int totalHeightHeader: childrenRect.height property int totalHeightHeader: childrenRect.height
spacing: 0
Rectangle { Rectangle {
id: settingsModeRow id: settingsModeRow
@ -45,7 +43,6 @@ ColumnLayout
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
color: "red"
Component{ Component{
id: wizardDelegate id: wizardDelegate
Button { Button {
@ -56,13 +53,15 @@ ColumnLayout
anchors.top: parent.top anchors.top: parent.top
width: parent.width / 2 width: parent.width / 2
text: model.text text: model.text
exclusiveGroup: modeMenuGroup;
onClicked: modesList.currentIndex = index
style: ButtonStyle { style: ButtonStyle {
background: Rectangle { background: Rectangle {
color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button color: modesList.currentIndex == index ? UM.Theme.colors.toggle_active : UM.Theme.colors.toggle_disabled
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
Label { Label {
anchors.centerIn: parent anchors.centerIn: parent
color: UM.Theme.colors.load_save_button_text color: modesList.currentIndex == index ? UM.Theme.colors.toggle_active_text : UM.Theme.colors.toggle_disabled_text
font: UM.Theme.fonts.default font: UM.Theme.fonts.default
text: control.text; text: control.text;
} }
@ -71,7 +70,7 @@ ColumnLayout
} }
} }
} }
ExclusiveGroup { id: modeMenuGroup; }
ListView{ ListView{
id: modesList id: modesList
property var index: 0 property var index: 0
@ -87,7 +86,7 @@ ColumnLayout
Rectangle { Rectangle {
id: machineSelectionRow id: machineSelectionRow
width: base.width - (UM.Theme.sizes.default_margin.width * 2) width: base.width
height: UM.Theme.sizes.sidebar_header.height height: UM.Theme.sizes.sidebar_header.height
anchors.top: settingsModeRow.bottom anchors.top: settingsModeRow.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -97,6 +96,7 @@ ColumnLayout
//: Machine selection label //: Machine selection label
text: catalog.i18nc("@label","Machine:"); text: catalog.i18nc("@label","Machine:");
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
} }
@ -105,11 +105,13 @@ ColumnLayout
id: machineSelection id: machineSelection
text: UM.MachineManager.activeMachineInstance; text: UM.MachineManager.activeMachineInstance;
width: parent.width/100*55 width: parent.width/100*55
height: UM.Theme.sizes.sidebar_header.height height: UM.Theme.sizes.setting_control.height
tooltip: UM.MachineManager.activeMachineInstance; tooltip: UM.MachineManager.activeMachineInstance;
//style: UM.Theme.styles.sidebar_header_button; //style: UM.Theme.styles.sidebar_header_button;
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
style: UM.Theme.styles.sidebar_header_button
menu: Menu menu: Menu
{ {
@ -138,52 +140,4 @@ ColumnLayout
} }
} }
} }
/////////////////tot hier
// ToolButton
// {
// text: base.modesModel ? base.modesModel.get(modeMenu.currentIndex).text : "";
//
// style: UM.Theme.styles.sidebar_header_button;
//
// menu: Menu
// {
// id: modeMenu;
//
// property int currentIndex: 0;
//
// Instantiator
// {
// model: base.modesModel;
//
// MenuItem
// {
// text: model.text;
// checkable: true;
// checked: modeMenu.currentIndex == index;
// exclusiveGroup: modeMenuGroup;
// onTriggered: modeMenu.currentIndex = index;
// }
// onObjectAdded: modeMenu.insertItem(index, object)
// onObjectRemoved: modeMenu.removeItem(object)
// }
//
// ExclusiveGroup { id: modeMenuGroup; }
// }
// }
/*
UM.SidebarCategoryHeader
{
width: parent.width;
height: UM.Theme.sizes.section.height;
iconSource: UM.Theme.icons.printsetup;
//: Sidebar header label
text: catalog.i18nc("@label","Print Setup");
enabled: false;
color: UM.Theme.colors.primary;
}*/
} }

View File

@ -10,28 +10,46 @@ import UM 1.0 as UM
QtObject { QtObject {
property Component sidebar_header_button: Component { property Component sidebar_header_button: Component {
ButtonStyle { ButtonStyle {
background: Item { background: Rectangle {
color: UM.Theme.colors.setting_control
border.width: 1
border.color: UM.Theme.colors.setting_control_border
UM.RecolorImage {
id: downArrow
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width
width: UM.Theme.sizes.standard_arrow.width
height: UM.Theme.sizes.standard_arrow.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.colors.setting_category_text
source: UM.Theme.icons.arrow_bottom
}
Label { Label {
anchors.right: parent.right; id: sidebarComboBoxLabel
anchors.top: parent.top; //property bool down: control.pressed || (control.checkable && control.checked);
color: UM.Theme.colors.setting_control_text
text: "▼"; text: control.text;
elide: Text.ElideRight;
property bool down: control.pressed || (control.checkable && control.checked); anchors.left: parent.left;
color: down ? UM.Theme.colors.text_pressed : control.hovered ? UM.Theme.colors.text_hover : UM.Theme.colors.text; anchors.leftMargin: UM.Theme.sizes.setting_unit_margin.width
anchors.right: downArrow.left;
anchors.rightMargin: UM.Theme.sizes.setting_unit_margin.width
anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.fonts.default
}
Rectangle{
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.top: parent.top
z: parent.z + 1
} }
} }
label: Label{}
label: Label {
property bool down: control.pressed || (control.checkable && control.checked);
font: UM.Theme.fonts.sidebar_header;
color: down ? UM.Theme.colors.text_pressed : control.hovered ? UM.Theme.colors.text_hover : UM.Theme.colors.text;
text: control.text;
elide: Text.ElideRight;
}
} }
} }

View File

@ -74,6 +74,11 @@
"button_disabled": [245, 245, 245, 255], "button_disabled": [245, 245, 245, 255],
"button_tooltip_text": [35, 35, 35, 255], "button_tooltip_text": [35, 35, 35, 255],
"toggle_active": [255, 255, 255, 255],
"toggle_active_text": [77, 184, 226, 255],
"toggle_disabled": [77, 184, 226, 255],
"toggle_disabled_text": [255, 255, 255, 255],
"load_save_button": [0, 0, 0, 255], "load_save_button": [0, 0, 0, 255],
"load_save_button_text": [255, 255, 255, 255], "load_save_button_text": [255, 255, 255, 255],
"load_save_button_hover": [43, 45, 46, 255], "load_save_button_hover": [43, 45, 46, 255],