Commit c3242c1d authored by Nate Graham's avatar Nate Graham 🔩
Browse files

[wallpapers/image] Disambiguate identical folder names in paths list

Summary:
When multiple paths that end in the same folder name are added (for example with D26483),
currently the list shows multiple identical entries distinguished only by their different
tooltips. This patch improves the situation by putting the path to the folder in a
subtitle.

Test Plan:
Before: {F7868784}

After: {F7868785}

Reviewers: #vdg, #plasma, mart

Reviewed By: #vdg, #plasma, mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26510
parent 276eac85
......@@ -286,16 +286,37 @@ ColumnLayout {
onTriggered: imageWallpaper.openFolder(modelData)
}
]
QtControls2.Label {
text: modelData.endsWith("/") ? modelData.split('/').reverse()[1] : modelData.split('/').pop()
Layout.fillWidth: true
ColumnLayout {
width: slidePathsView.width
QtControls2.ToolTip.text: modelData
QtControls2.ToolTip.visible: folderDelegate.hovered
QtControls2.ToolTip.visible: folderDelegate.hovered && subtitle.truncated
QtControls2.ToolTip.delay: 1000
QtControls2.ToolTip.timeout: 5000
// Header: the folder
QtControls2.Label {
Layout.fillWidth: true
elide: Text.ElideRight
text: {
var strippedPath = modelData.replace(/\/+$/, "");
return strippedPath.split('/').pop()
}
}
// Subtitle: the path to the folder
QtControls2.Label {
id: subtitle
Layout.fillWidth: true
elide: Text.ElideRight
text: {
var strippedPath = modelData.replace(/\/+$/, "");
return strippedPath.replace(/\/[^\/]*$/, '');;
}
font.pointSize: theme.smallestFont.pointSize
opacity: 0.6
}
}
width: slidePathsView.width
height: paintedHeight;
}
Kirigami.Heading {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment