From a5ffe32861c82f554b5aa556d5fd26651065a298 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 8 Sep 2018 20:00:43 +0200 Subject: [PATCH] Quick GUI: Show full file path as tooltip --- qml/main.qml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/qml/main.qml b/qml/main.qml index 76a4cda..7950233 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -9,6 +9,17 @@ Kirigami.ApplicationWindow { property alias showPasswordsOnFocus: showPasswordsOnFocusSwitch.checked header: Kirigami.ApplicationHeader { + backButtonEnabled: true + minimumHeight: 0 + preferredHeight: Kirigami.Units.gridUnit * 2.3 + maximumHeight: Kirigami.Units.gridUnit * 3 + + Controls.TextField { + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + placeholderText: qsTr("Filter") + width: Kirigami.Units.gridUnit * 8 + } } globalDrawer: Kirigami.GlobalDrawer { id: leftMenu @@ -25,6 +36,7 @@ Kirigami.ApplicationWindow { Layout.fillWidth: true } Controls.Label { + id: fileNameLabel padding: 8 wrapMode: Controls.Label.Wrap fontSizeMode: Text.HorizontalFit @@ -33,6 +45,21 @@ Kirigami.ApplicationWindow { Layout.fillWidth: true text: nativeInterface.fileOpen ? nativeInterface.fileName : qsTr( "No file opened") + MouseArea { + id: fileNameMouseArea + anchors.fill: parent + hoverEnabled: true + } + Controls.ToolTip { + z: 1000 + text: nativeInterface.filePath + visible: text ? fileNameMouseArea.containsMouse : false + delay: Qt.styleHints.mousePressAndHoldInterval + onAboutToShow: { + x = fileNameMouseArea.mouseX + 10 + y = fileNameMouseArea.mouseY + 10 + } + } } } actions: [ @@ -82,13 +109,6 @@ Kirigami.ApplicationWindow { text: qsTr("Show passwords on focus") checked: true } - - Controls.Label { - wrapMode: Controls.Label.Wrap - Layout.fillWidth: true - text: nativeInterface.fileOpen ? nativeInterface.filePath : qsTr( - "No file opened") - } } contextDrawer: Kirigami.ContextDrawer { id: contextDrawer