1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 22:42:50 -05:00

Merge branch 'master' of github.com:bbedward/dank-material-dark-shell

This commit is contained in:
bbedward
2025-08-19 11:06:21 -04:00
2 changed files with 72 additions and 19 deletions

View File

@@ -69,7 +69,22 @@ Rectangle {
StyledText {
id: titleText
text: NiriService.focusedWindowTitle || ""
text: {
var title = NiriService.focusedWindowTitle || "";
var appName = appText.text;
if (!title || !appName) return title;
// Remove app name from end of title if it exists there
if (title.endsWith(" - " + appName)) {
return title.substring(0, title.length - (" - " + appName).length);
}
if (title.endsWith(appName)) {
return title.substring(0, title.length - appName.length).replace(/ - $/, "");
}
return title;
}
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
color: Theme.surfaceText