diff --git a/qml/PrinterButton.qml b/qml/PrinterButton.qml index 3c01a050f7..dfbbbe2984 100644 --- a/qml/PrinterButton.qml +++ b/qml/PrinterButton.qml @@ -8,22 +8,4 @@ import UM 1.0 as UM Button { id: base; style: UM.Theme.styles.tool_button; - - Rectangle { - anchors.bottom: parent.top; - - width: parent.width; - height: base.hovered ? label.height : 0; - Behavior on height { NumberAnimation { duration: 75; } } - - opacity: base.hovered ? 1.0 : 0.0; - Behavior on opacity { NumberAnimation { duration: 75; } } - - Label { - id: label - anchors.horizontalCenter: parent.horizontalCenter; - text: base.text; - font: UM.Theme.fonts.button_tooltip; - } - } } diff --git a/qml/PrinterToolbar.qml b/qml/PrinterToolbar.qml index 04fbda0bf7..09af10b132 100644 --- a/qml/PrinterToolbar.qml +++ b/qml/PrinterToolbar.qml @@ -5,30 +5,53 @@ import QtQuick.Layouts 1.1 import UM 1.0 as UM -RowLayout { +Item { id: base; - spacing: UM.Theme.sizes.default_margin.width * 2; + width: buttons.width; + height: buttons.height + panel.height; - Repeater { - id: repeat + RowLayout { + id: buttons; - model: UM.Models.toolModel + anchors.bottom: parent.bottom; + anchors.left: parent.left; - PrinterButton { - text: model.name; - iconSource: UM.Theme.icons[model.icon]; - tooltip: model.description; + spacing: UM.Theme.sizes.default_margin.width * 2; - checkable: true; - checked: model.active; + Repeater { + id: repeat - //Workaround since using ToolButton's onClicked would break the binding of the checked property, instead - //just catch the click so we do not trigger that behaviour. - MouseArea { - anchors.fill: parent; - onClicked: parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id); + model: UM.Models.toolModel + + PrinterButton { + text: model.name; + iconSource: UM.Theme.icons[model.icon]; + tooltip: model.description; + + checkable: true; + checked: model.active; + + //Workaround since using ToolButton's onClicked would break the binding of the checked property, instead + //just catch the click so we do not trigger that behaviour. + MouseArea { + anchors.fill: parent; + onClicked: parent.checked ? UM.Controller.setActiveTool(null) : UM.Controller.setActiveTool(model.id); + } } } } + + Loader { + id: panel + + anchors.left: parent.left; + anchors.right: parent.right; + anchors.bottom: buttons.top; + anchors.bottomMargin: UM.Theme.sizes.default_margin.height; + + height: childrenRect.height; + + source: UM.ActiveTool.valid ? UM.ActiveTool.activeToolPanel : ""; + } } diff --git a/qml/Sidebar.qml b/qml/Sidebar.qml index cc724ee270..f56c69fe4e 100644 --- a/qml/Sidebar.qml +++ b/qml/Sidebar.qml @@ -15,7 +15,6 @@ UM.AngledCornerRectangle { cornerSize: UM.Theme.sizes.default_margin.width; function showTooltip(item, position, text) { - print("omg zomg") tooltip.text = text; position = item.mapToItem(base, position.x, position.y); tooltip.show(position); @@ -72,16 +71,19 @@ UM.AngledCornerRectangle { onLoaded: { - if(item) item.configureSettings = base.configureMachinesAction; - if(typeof(item.onShowTooltip) != 'undefined') + if(item) { - item.showTooltip.connect(base.showTooltip) + item.configureSettings = base.configureMachinesAction; + if(item.onShowTooltip != undefined) + { + item.showTooltip.connect(base.showTooltip) + } + if(item.onHideTooltip != undefined) + { + item.hideTooltip.connect(base.hideTooltip) + } } - } - - //onShowTooltip: base.showTooltip(item,position,text) - //onHideTooltip: base.hideTooltip() } SaveButton { diff --git a/qml/SidebarAdvanced.qml b/qml/SidebarAdvanced.qml index ba7bd8ed87..bdd91fd2f9 100644 --- a/qml/SidebarAdvanced.qml +++ b/qml/SidebarAdvanced.qml @@ -1,3 +1,3 @@ import UM 1.0 as UM -UM.SettingView{} \ No newline at end of file +UM.SettingView { } diff --git a/qml/SidebarHeader.qml b/qml/SidebarHeader.qml index 085fce6e77..9d4a103637 100644 --- a/qml/SidebarHeader.qml +++ b/qml/SidebarHeader.qml @@ -110,7 +110,7 @@ Column { height: UM.Theme.sizes.section.height; iconSource: UM.Theme.icons.printsetup; - text: qsTr("Setup"); + text: qsTr("Print Setup"); enabled: false; color: UM.Theme.colors.primary;