From 5df5dfec029e6685789012ecacafb6815dabc179 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 14 Sep 2017 08:50:23 +0200 Subject: [PATCH] Auto-adjust mode tab position based on text length CURA-4322 --- resources/qml/Sidebar.qml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index ba357f40a5..c598af7d99 100755 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -125,7 +125,6 @@ Rectangle font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") visible: !monitoringPrint - elide: Text.ElideRight } Rectangle { @@ -135,7 +134,17 @@ Rectangle height: UM.Theme.getSize("sidebar_header_mode_toggle").height anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width - anchors.top: headerSeparator.bottom + anchors.top: + { + if (settingsModeLabel.contentWidth >= parent.width - width - UM.Theme.getSize("sidebar_margin").width) + { + return settingsModeLabel.bottom; + } + else + { + return headerSeparator.bottom; + } + } anchors.topMargin: UM.Theme.getSize("sidebar_margin").height visible: !monitoringPrint && !hideSettings Component{