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

View file

@ -12,33 +12,14 @@ Item {
id: base;
width: buttons.width;
height: buttons.height + panel.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;
}
}
height: buttons.height
RowLayout {
id: buttons;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
spacing: UM.Theme.sizes.default_margin.width * 2;
spacing: 1
Repeater {
id: repeat
@ -51,7 +32,6 @@ Item {
checkable: true;
checked: model.active;
onCheckedChanged: if (checked) activeItemBackground.setActive(x);
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;
anchors.left: parent.left;
anchors.bottom: buttons.top;
anchors.bottomMargin: UM.Theme.sizes.default_margin.height;
anchors.top: buttons.bottom;
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;
opacity: panel.item ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
color: UM.Theme.colors.tool_panel_background;
cornerSize: width > 0 ? UM.Theme.sizes.default_margin.width : 0;
Loader {
id: panel