1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 21:45:38 -05:00

General code cleanups

This commit is contained in:
bbedward
2025-08-02 16:18:12 -04:00
parent 2cf7497324
commit 599118c63e
68 changed files with 102 additions and 1241 deletions

View File

@@ -24,7 +24,6 @@ Item {
interval: 256
repeat: true
onTriggered: {
// Generate fake audio levels when cava is unavailable
CavaService.values = [Math.random() * 40 + 10, Math.random() * 60 + 20, Math.random() * 50 + 15, Math.random() * 35 + 20, Math.random() * 45 + 15, Math.random() * 55 + 25];
}
}

View File

@@ -96,7 +96,6 @@ Rectangle {
}
}
// Tooltip on hover
Rectangle {
id: batteryTooltip

View File

@@ -46,11 +46,9 @@ PanelWindow {
bottom: true
}
// Click outside to dismiss overlay
MouseArea {
anchors.fill: parent
onClicked: function(mouse) {
// Only close if click is outside the content loader
var localPos = mapToItem(contentLoader, mouse.x, mouse.y);
if (localPos.x < 0 || localPos.x > contentLoader.width || localPos.y < 0 || localPos.y > contentLoader.height)
batteryPopupVisible = false;
@@ -70,7 +68,6 @@ PanelWindow {
height: targetHeight
x: Math.max(Theme.spacingL, Screen.width - targetWidth - Theme.spacingL)
y: Theme.barHeight + Theme.spacingS
// GPU-accelerated scale + opacity animation
opacity: batteryPopupVisible ? 1 : 0
scale: batteryPopupVisible ? 1 : 0.9
@@ -97,11 +94,9 @@ PanelWindow {
radius: Theme.cornerRadiusLarge
border.color: Theme.outlineMedium
border.width: 1
// Remove layer rendering for better performance
antialiasing: true
smooth: true
// Material 3 elevation with multiple layers
Rectangle {
anchors.fill: parent
anchors.margins: -3
@@ -273,7 +268,6 @@ PanelWindow {
}
// No battery info card
Rectangle {
width: parent.width
height: 80
@@ -317,7 +311,6 @@ PanelWindow {
}
// Battery details
Column {
width: parent.width
spacing: Theme.spacingM
@@ -334,7 +327,6 @@ PanelWindow {
width: parent.width
spacing: Theme.spacingXL
// Health
Column {
spacing: 2
width: (parent.width - Theme.spacingXL) / 2
@@ -360,7 +352,6 @@ PanelWindow {
}
// Capacity
Column {
spacing: 2
width: (parent.width - Theme.spacingXL) / 2
@@ -384,7 +375,6 @@ PanelWindow {
}
// Power profiles
Column {
width: parent.width
spacing: Theme.spacingM
@@ -465,7 +455,6 @@ PanelWindow {
}
// Degradation reason warning
Rectangle {
width: parent.width
height: 60

View File

@@ -10,7 +10,6 @@ Rectangle {
signal clicked()
// Helper function for consistent WiFi signal icons
function getWiFiSignalIcon(signalStrength) {
switch (signalStrength) {
case "excellent":
@@ -40,7 +39,6 @@ Rectangle {
anchors.centerIn: parent
spacing: Theme.spacingXS
// Network Status Icon
DankIcon {
name: {
if (NetworkService.networkStatus === "ethernet")
@@ -56,7 +54,6 @@ Rectangle {
visible: true
}
// Bluetooth Icon (when available and enabled) - moved next to network
DankIcon {
name: "bluetooth"
size: Theme.iconSize - 8
@@ -65,7 +62,6 @@ Rectangle {
visible: BluetoothService.available && BluetoothService.enabled
}
// Audio Icon with scroll wheel support
Rectangle {
width: audioIcon.implicitWidth + 4
height: audioIcon.implicitHeight + 4
@@ -82,9 +78,6 @@ Rectangle {
}
MouseArea {
// Scroll up - increase volume
// Scroll down - decrease volume
id: audioWheelArea
anchors.fill: parent
@@ -108,7 +101,6 @@ Rectangle {
}
// Microphone Icon (when active)
DankIcon {
name: "mic"
size: Theme.iconSize - 8

View File

@@ -16,7 +16,6 @@ Rectangle {
height: 30
radius: Theme.cornerRadius
color: {
// Only show background when there's content to display
if (!FocusedWindowService.focusedAppName && !FocusedWindowService.focusedWindowTitle)
return "transparent";

View File

@@ -25,7 +25,6 @@ Rectangle {
color: Prefs.doNotDisturb ? Theme.error : (notificationArea.containsMouse || root.isActive ? Theme.primary : Theme.surfaceText)
}
// Notification dot indicator
Rectangle {
width: 8
height: 8

View File

@@ -13,7 +13,6 @@ Rectangle {
height: 30
radius: Theme.cornerRadius
color: {
// Only show background when there are system tray items to display
if (SystemTray.items.values.length === 0)
return "transparent";

View File

@@ -39,11 +39,9 @@ PanelWindow {
radius: Theme.cornerRadiusLarge
border.color: Theme.outlineMedium
border.width: 1
// Material 3 animations
opacity: showContextMenu ? 1 : 0
scale: showContextMenu ? 1 : 0.85
// Material 3 drop shadow
Rectangle {
anchors.fill: parent
anchors.topMargin: 4
@@ -65,11 +63,9 @@ PanelWindow {
menu: currentTrayItem && currentTrayItem.hasMenu ? currentTrayItem.menu : null
}
// Custom menu styling using ListView
ListView {
id: menuList
// Calculate maximum text width for dynamic menu sizing
property real maxTextWidth: {
let maxWidth = 0;
if (model && model.values) {
@@ -101,7 +97,6 @@ PanelWindow {
radius: modelData.isSeparator ? 0 : Theme.cornerRadiusSmall
color: modelData.isSeparator ? "transparent" : (menuItemArea.containsMouse ? Theme.primaryHover : "transparent")
// Separator line
Rectangle {
visible: modelData.isSeparator
anchors.centerIn: parent
@@ -110,7 +105,6 @@ PanelWindow {
color: Theme.surfaceVariantAlpha
}
// Menu item content
Row {
visible: !modelData.isSeparator
anchors.left: parent.left
@@ -176,7 +170,6 @@ PanelWindow {
}
// Click outside to close
MouseArea {
anchors.fill: parent
z: -1

View File

@@ -125,7 +125,6 @@ PanelWindow {
id: topBarContent
readonly property int availableWidth: width
// Use estimated fixed widths to break circular dependencies
readonly property int launcherButtonWidth: 40
readonly property int workspaceSwitcherWidth: 120 // Approximate
readonly property int focusedAppMaxWidth: 456 // Fixed width since we don't have focusedApp reference
@@ -228,7 +227,6 @@ PanelWindow {
anchors.bottomMargin: Theme.spacingXS
clip: true
// Dynamic left section
Row {
id: leftSection
@@ -357,8 +355,8 @@ PanelWindow {
item.onWidthChanged.connect(centerSection.updateLayout);
if (model.widgetId === "spacer")
item.spacerSize = Qt.binding(() => {
return model.size || 20;
});
return model.size || 20;
});
Qt.callLater(centerSection.updateLayout);
}

View File

@@ -8,7 +8,6 @@ Rectangle {
signal clicked()
// Visibility is now controlled by TopBar.qml
width: visible ? Math.min(100, weatherRow.implicitWidth + Theme.spacingS * 2) : 0
height: 30
radius: Theme.cornerRadius

View File

@@ -83,10 +83,8 @@ Rectangle {
target: NiriService
}
// Force update when padding preference changes
Connections {
function onShowWorkspacePaddingChanged() {
// Force re-evaluation by updating the property
var baseList = root.getDisplayWorkspaces();
root.workspaceList = Prefs.showWorkspacePadding ? root.padWorkspaces(baseList) : baseList;
}
@@ -128,7 +126,6 @@ Rectangle {
}
}
// Show index for placeholders if Prefs.showWorkspaceIndex is true, otherwise show a subtle dot
StyledText {
visible: Prefs.showWorkspaceIndex
anchors.centerIn: parent