Quick GUI: Show full file path as tooltip

This commit is contained in:
Martchus 2018-09-08 20:00:43 +02:00
parent 65d41276e8
commit a5ffe32861
1 changed files with 27 additions and 7 deletions

View File

@ -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