mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 14:05:38 -05:00
Configurable widget displays
This commit is contained in:
@@ -19,6 +19,14 @@ Singleton {
|
|||||||
property bool nightModeEnabled: false
|
property bool nightModeEnabled: false
|
||||||
property string profileImage: ""
|
property string profileImage: ""
|
||||||
|
|
||||||
|
// Widget visibility preferences for TopBar
|
||||||
|
property bool showFocusedWindow: true
|
||||||
|
property bool showWeather: true
|
||||||
|
property bool showMusic: true
|
||||||
|
property bool showClipboard: true
|
||||||
|
property bool showSystemResources: true
|
||||||
|
property bool showSystemTray: true
|
||||||
|
|
||||||
|
|
||||||
Component.onCompleted: loadSettings()
|
Component.onCompleted: loadSettings()
|
||||||
|
|
||||||
@@ -59,6 +67,12 @@ Singleton {
|
|||||||
useFahrenheit = settings.useFahrenheit !== undefined ? settings.useFahrenheit : false
|
useFahrenheit = settings.useFahrenheit !== undefined ? settings.useFahrenheit : false
|
||||||
nightModeEnabled = settings.nightModeEnabled !== undefined ? settings.nightModeEnabled : false
|
nightModeEnabled = settings.nightModeEnabled !== undefined ? settings.nightModeEnabled : false
|
||||||
profileImage = settings.profileImage !== undefined ? settings.profileImage : ""
|
profileImage = settings.profileImage !== undefined ? settings.profileImage : ""
|
||||||
|
showFocusedWindow = settings.showFocusedWindow !== undefined ? settings.showFocusedWindow : true
|
||||||
|
showWeather = settings.showWeather !== undefined ? settings.showWeather : true
|
||||||
|
showMusic = settings.showMusic !== undefined ? settings.showMusic : true
|
||||||
|
showClipboard = settings.showClipboard !== undefined ? settings.showClipboard : true
|
||||||
|
showSystemResources = settings.showSystemResources !== undefined ? settings.showSystemResources : true
|
||||||
|
showSystemTray = settings.showSystemTray !== undefined ? settings.showSystemTray : true
|
||||||
console.log("Loaded settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "transparency:", topBarTransparency, "recentApps:", recentlyUsedApps.length)
|
console.log("Loaded settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "transparency:", topBarTransparency, "recentApps:", recentlyUsedApps.length)
|
||||||
|
|
||||||
applyStoredTheme()
|
applyStoredTheme()
|
||||||
@@ -82,7 +96,13 @@ Singleton {
|
|||||||
use24HourClock,
|
use24HourClock,
|
||||||
useFahrenheit,
|
useFahrenheit,
|
||||||
nightModeEnabled,
|
nightModeEnabled,
|
||||||
profileImage
|
profileImage,
|
||||||
|
showFocusedWindow,
|
||||||
|
showWeather,
|
||||||
|
showMusic,
|
||||||
|
showClipboard,
|
||||||
|
showSystemResources,
|
||||||
|
showSystemTray
|
||||||
}, null, 2))
|
}, null, 2))
|
||||||
console.log("Saving settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "transparency:", topBarTransparency, "recentApps:", recentlyUsedApps.length)
|
console.log("Saving settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "transparency:", topBarTransparency, "recentApps:", recentlyUsedApps.length)
|
||||||
}
|
}
|
||||||
@@ -200,4 +220,41 @@ Singleton {
|
|||||||
profileImage = imageUrl
|
profileImage = imageUrl
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Widget visibility setters
|
||||||
|
function setShowFocusedWindow(enabled) {
|
||||||
|
console.log("Prefs setShowFocusedWindow called - showFocusedWindow:", enabled)
|
||||||
|
showFocusedWindow = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setShowWeather(enabled) {
|
||||||
|
console.log("Prefs setShowWeather called - showWeather:", enabled)
|
||||||
|
showWeather = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setShowMusic(enabled) {
|
||||||
|
console.log("Prefs setShowMusic called - showMusic:", enabled)
|
||||||
|
showMusic = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setShowClipboard(enabled) {
|
||||||
|
console.log("Prefs setShowClipboard called - showClipboard:", enabled)
|
||||||
|
showClipboard = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setShowSystemResources(enabled) {
|
||||||
|
console.log("Prefs setShowSystemResources called - showSystemResources:", enabled)
|
||||||
|
showSystemResources = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setShowSystemTray(enabled) {
|
||||||
|
console.log("Prefs setShowSystemTray called - showSystemTray:", enabled)
|
||||||
|
showSystemTray = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -328,6 +328,59 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Widget Visibility Settings
|
||||||
|
SettingsSection {
|
||||||
|
title: "Top Bar Widgets"
|
||||||
|
iconName: "widgets"
|
||||||
|
|
||||||
|
content: Column {
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
SettingsToggle {
|
||||||
|
text: "Focused Window"
|
||||||
|
description: "Show the currently focused application in the top bar"
|
||||||
|
checked: Prefs.showFocusedWindow
|
||||||
|
onToggled: (checked) => Prefs.setShowFocusedWindow(checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggle {
|
||||||
|
text: "Weather Widget"
|
||||||
|
description: "Display weather information in the top bar"
|
||||||
|
checked: Prefs.showWeather
|
||||||
|
onToggled: (checked) => Prefs.setShowWeather(checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggle {
|
||||||
|
text: "Media Controls"
|
||||||
|
description: "Show currently playing media in the top bar"
|
||||||
|
checked: Prefs.showMusic
|
||||||
|
onToggled: (checked) => Prefs.setShowMusic(checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggle {
|
||||||
|
text: "Clipboard Button"
|
||||||
|
description: "Show clipboard access button in the top bar"
|
||||||
|
checked: Prefs.showClipboard
|
||||||
|
onToggled: (checked) => Prefs.setShowClipboard(checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggle {
|
||||||
|
text: "System Resources"
|
||||||
|
description: "Display CPU and RAM usage indicators"
|
||||||
|
checked: Prefs.showSystemResources
|
||||||
|
onToggled: (checked) => Prefs.setShowSystemResources(checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggle {
|
||||||
|
text: "System Tray"
|
||||||
|
description: "Show system tray icons in the top bar"
|
||||||
|
checked: Prefs.showSystemTray
|
||||||
|
onToggled: (checked) => Prefs.setShowSystemTray(checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Display Settings
|
// Display Settings
|
||||||
SettingsSection {
|
SettingsSection {
|
||||||
title: "Display & Appearance"
|
title: "Display & Appearance"
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ PanelWindow {
|
|||||||
|
|
||||||
FocusedAppWidget {
|
FocusedAppWidget {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: Prefs.showFocusedWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,6 +180,7 @@ PanelWindow {
|
|||||||
anchors.rightMargin: Theme.spacingS
|
anchors.rightMargin: Theme.spacingS
|
||||||
activePlayer: topBar.activePlayer
|
activePlayer: topBar.activePlayer
|
||||||
hasActiveMedia: topBar.hasActiveMedia
|
hasActiveMedia: topBar.hasActiveMedia
|
||||||
|
visible: Prefs.showMusic && topBar.hasActiveMedia
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (topBar.shellRoot) {
|
if (topBar.shellRoot) {
|
||||||
@@ -201,6 +203,7 @@ PanelWindow {
|
|||||||
weatherCode: topBar.weatherCode
|
weatherCode: topBar.weatherCode
|
||||||
weatherTemp: topBar.weatherTemp
|
weatherTemp: topBar.weatherTemp
|
||||||
weatherTempF: topBar.weatherTempF
|
weatherTempF: topBar.weatherTempF
|
||||||
|
visible: Prefs.showWeather
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (topBar.shellRoot) {
|
if (topBar.shellRoot) {
|
||||||
@@ -222,6 +225,7 @@ PanelWindow {
|
|||||||
|
|
||||||
SystemTrayWidget {
|
SystemTrayWidget {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: Prefs.showSystemTray
|
||||||
onMenuRequested: (menu, item, x, y) => {
|
onMenuRequested: (menu, item, x, y) => {
|
||||||
topBar.currentTrayMenu = menu
|
topBar.currentTrayMenu = menu
|
||||||
topBar.currentTrayItem = item
|
topBar.currentTrayItem = item
|
||||||
@@ -239,6 +243,7 @@ PanelWindow {
|
|||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: clipboardArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.08)
|
color: clipboardArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.08)
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: Prefs.showClipboard
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -275,10 +280,12 @@ PanelWindow {
|
|||||||
// System Monitor Widgets
|
// System Monitor Widgets
|
||||||
CpuMonitorWidget {
|
CpuMonitorWidget {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: Prefs.showSystemResources
|
||||||
}
|
}
|
||||||
|
|
||||||
RamMonitorWidget {
|
RamMonitorWidget {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: Prefs.showSystemResources
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationCenterButton {
|
NotificationCenterButton {
|
||||||
|
|||||||
Reference in New Issue
Block a user