This commit is contained in:
Jaime van Kessel 2015-08-18 10:47:38 +02:00
commit b35912e7ba
4 changed files with 35 additions and 50 deletions

View File

@ -257,10 +257,12 @@ UM.MainWindow {
} }
Image { Image {
id: logo
anchors { anchors {
verticalCenter: openFileButton.verticalCenter; left: parent.left
left: openFileButton.right; leftMargin: UM.Theme.sizes.default_margin.width;
leftMargin: UM.Theme.sizes.window_margin.width; bottom: parent.bottom
bottomMargin: UM.Theme.sizes.default_margin.height;
} }
source: UM.Theme.images.logo; source: UM.Theme.images.logo;
@ -272,13 +274,12 @@ UM.MainWindow {
} }
Button { Button {
id: viewModeButton
anchors { anchors {
top: parent.top; top: parent.top;
topMargin: UM.Theme.sizes.window_margin.height;
right: sidebar.left; right: sidebar.left;
rightMargin: UM.Theme.sizes.window_margin.width; rightMargin: UM.Theme.sizes.window_margin.width;
} }
id: viewModeButton
//: View Mode toolbar button //: View Mode toolbar button
text: qsTr("View Mode"); text: qsTr("View Mode");
iconSource: UM.Theme.icons.viewmode; iconSource: UM.Theme.icons.viewmode;
@ -308,10 +309,9 @@ UM.MainWindow {
id: toolbar; id: toolbar;
anchors { anchors {
left: parent.left; horizontalCenter: parent.horizontalCenter
leftMargin: UM.Theme.sizes.window_margin.width; horizontalCenterOffset: -(UM.Theme.sizes.panel.width / 2)
bottom: parent.bottom; top: parent.top;
bottomMargin: UM.Theme.sizes.window_margin.height;
} }
} }

View File

@ -12,33 +12,14 @@ Item {
id: base; id: base;
width: buttons.width; width: buttons.width;
height: buttons.height + panel.height; height: buttons.height
Rectangle {
id: activeItemBackground;
anchors.bottom: parent.bottom;
anchors.bottomMargin: UM.Theme.sizes.default_margin.height;
width: UM.Theme.sizes.button.width;
height: UM.Theme.sizes.button.height * 2;
opacity: panelBackground.opacity;
color: UM.Theme.colors.tool_panel_background
function setActive(new_x) {
x = new_x;
}
}
RowLayout { RowLayout {
id: buttons; id: buttons;
anchors.bottom: parent.bottom; anchors.bottom: parent.bottom;
anchors.left: parent.left; anchors.left: parent.left;
spacing: 1
spacing: UM.Theme.sizes.default_margin.width * 2;
Repeater { Repeater {
id: repeat id: repeat
@ -51,7 +32,6 @@ Item {
checkable: true; checkable: true;
checked: model.active; checked: model.active;
onCheckedChanged: if (checked) activeItemBackground.setActive(x);
style: UM.Theme.styles.tool_button; style: UM.Theme.styles.tool_button;
@ -65,21 +45,28 @@ Item {
} }
} }
UM.AngledCornerRectangle { Rectangle {
width: base.width - 10
height: base.height
z: parent.z - 1
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: UM.Theme.colors.button_lining
}
Rectangle {
id: panelBackground; id: panelBackground;
anchors.left: parent.left; anchors.left: parent.left;
anchors.bottom: buttons.top; anchors.top: buttons.bottom;
anchors.bottomMargin: UM.Theme.sizes.default_margin.height;
width: panel.item ? Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width, activeItemBackground.x + activeItemBackground.width) : 0; width: panel.item ? Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width) : 0;
height: panel.item ? panel.height + 2 * UM.Theme.sizes.default_margin.height : 0; height: panel.item ? panel.height + 2 * UM.Theme.sizes.default_margin.height : 0;
opacity: panel.item ? 1 : 0 opacity: panel.item ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } } Behavior on opacity { NumberAnimation { duration: 100 } }
color: UM.Theme.colors.tool_panel_background; color: UM.Theme.colors.tool_panel_background;
cornerSize: width > 0 ? UM.Theme.sizes.default_margin.width : 0;
Loader { Loader {
id: panel id: panel

View File

@ -90,34 +90,32 @@ QtObject {
property Component tool_button: Component { property Component tool_button: Component {
ButtonStyle { ButtonStyle {
background: Item { background: Item {
///////////TODO CHANGE SIZES!!
implicitWidth: UM.Theme.sizes.button.width; implicitWidth: UM.Theme.sizes.button.width;
implicitHeight: UM.Theme.sizes.button.height; implicitHeight: UM.Theme.sizes.button.height;
Rectangle { Rectangle {
anchors.bottom: parent.verticalCenter; id: tool_button_background
anchors.top: parent.verticalCenter;
width: parent.width; width: parent.width;
///////////TODO CHANGE LABELHEIGHT!!
height: control.hovered ? parent.height / 2 + label.height : 0; height: control.hovered ? parent.height / 2 + label.height : 0;
Behavior on height { NumberAnimation { duration: 100; } } Behavior on height { NumberAnimation { duration: 100; } }
opacity: control.hovered ? 1.0 : 0.0; opacity: control.hovered ? 1.0 : 0.0;
Behavior on opacity { NumberAnimation { duration: 100; } } Behavior on opacity { NumberAnimation { duration: 100; } }
Rectangle { Label {
anchors.horizontalCenter: parent.horizontalCenter; id: label
width: childrenRect.width; anchors.bottom: parent.bottom
height: childrenRect.height; text: control.text.replace("&", "");
font: UM.Theme.fonts.button_tooltip;
Label { color: UM.Theme.colors.button_tooltip_text;
id: label
text: control.text.replace("&", "");
font: UM.Theme.fonts.button_tooltip;
color: UM.Theme.colors.button_tooltip_text;
}
} }
} }
UM.AngledCornerRectangle { Rectangle {
id: buttonFace; id: buttonFace;
anchors.fill: parent; anchors.fill: parent;
@ -138,7 +136,6 @@ QtObject {
} }
} }
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
cornerSize: UM.Theme.sizes.default_margin.width;
Label { Label {
anchors.right: parent.right; anchors.right: parent.right;

View File

@ -70,6 +70,7 @@
"button_hover": [140, 144, 154, 255], "button_hover": [140, 144, 154, 255],
"button_active": [12, 169, 227, 255], "button_active": [12, 169, 227, 255],
"button_active_hover": [34, 150, 199, 255], "button_active_hover": [34, 150, 199, 255],
"button_lining": [140, 144, 154, 255],
"button_text": [255, 255, 255, 255], "button_text": [255, 255, 255, 255],
"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],