mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 07:22:50 -05:00
modules cleanup and qmlfmt everywhere
- throw in 24H clock fix and app drawer fix too
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
@@ -17,19 +17,20 @@ Rectangle {
|
||||
readonly property int maxCompactWidth: 288
|
||||
readonly property Toplevel activeWindow: ToplevelManager.activeToplevel
|
||||
|
||||
width: compactMode ? Math.min(baseWidth,
|
||||
maxCompactWidth) : Math.min(baseWidth,
|
||||
maxNormalWidth)
|
||||
width: compactMode ? Math.min(baseWidth, maxCompactWidth) : Math.min(baseWidth, maxNormalWidth)
|
||||
height: widgetHeight
|
||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
||||
color: {
|
||||
if (!activeWindow || !activeWindow.title)
|
||||
return "transparent"
|
||||
|
||||
if (SettingsData.topBarNoBackground) return "transparent"
|
||||
const baseColor = mouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover
|
||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
|
||||
baseColor.a * Theme.widgetTransparency)
|
||||
if (!activeWindow || !activeWindow.title) {
|
||||
return "transparent";
|
||||
}
|
||||
|
||||
if (SettingsData.topBarNoBackground) {
|
||||
return "transparent";
|
||||
}
|
||||
|
||||
const baseColor = mouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover;
|
||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
|
||||
}
|
||||
clip: true
|
||||
visible: activeWindow && activeWindow.title
|
||||
@@ -44,12 +45,12 @@ Rectangle {
|
||||
id: appText
|
||||
|
||||
text: {
|
||||
if (!activeWindow || !activeWindow.appId)
|
||||
return ""
|
||||
if (!activeWindow || !activeWindow.appId) {
|
||||
return "";
|
||||
}
|
||||
|
||||
var desktopEntry = DesktopEntries.heuristicLookup(activeWindow.appId)
|
||||
return desktopEntry
|
||||
&& desktopEntry.name ? desktopEntry.name : activeWindow.appId
|
||||
const desktopEntry = DesktopEntries.heuristicLookup(activeWindow.appId);
|
||||
return desktopEntry && desktopEntry.name ? desktopEntry.name : activeWindow.appId;
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.weight: Font.Medium
|
||||
@@ -73,24 +74,22 @@ Rectangle {
|
||||
id: titleText
|
||||
|
||||
text: {
|
||||
var title = activeWindow && activeWindow.title ? activeWindow.title : ""
|
||||
var appName = appText.text
|
||||
|
||||
if (!title || !appName)
|
||||
return title
|
||||
const title = activeWindow && activeWindow.title ? activeWindow.title : "";
|
||||
const 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.substring(0, title.length - (" - " + appName).length);
|
||||
}
|
||||
|
||||
return title
|
||||
if (title.endsWith(appName)) {
|
||||
return title.substring(0, title.length - appName.length).replace(/ - $/, "");
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.weight: Font.Medium
|
||||
@@ -101,6 +100,7 @@ Rectangle {
|
||||
width: Math.min(implicitWidth, compactMode ? 280 : 250)
|
||||
visible: text.length > 0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -115,6 +115,7 @@ Rectangle {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Behavior on width {
|
||||
@@ -122,5 +123,7 @@ Rectangle {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user