From 573c470965491de852060b08926c7bf30963906c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 10 May 2020 12:38:56 -0700 Subject: [PATCH] Ensure the title label doesn't get drawn over when the window is small --- app/gui/main.qml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/gui/main.qml b/app/gui/main.qml index 0c977478..a613be2f 100644 --- a/app/gui/main.qml +++ b/app/gui/main.qml @@ -177,6 +177,7 @@ ApplicationWindow { Label { id: titleLabel + visible: toolBar.width > 700 anchors.fill: parent text: stackView.currentItem.objectName font.pointSize: 20 @@ -204,9 +205,20 @@ ApplicationWindow { } } + // This label will appear when the window gets too small and + // we need to ensure the toolbar controls don't collide Label { - // Placeholder to consume all remaining width + id: titleRowLabel + font.pointSize: titleLabel.font.pointSize + elide: Label.ElideRight + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter Layout.fillWidth: true + + // We need this label to always be visible so it can occupy + // the remaining space in the RowLayout. To "hide" it, we + // just set the text to empty string. + text: !titleLabel.visible ? stackView.currentItem.objectName : "" } Label {