From a79d4b916eed110fa6648707511163c597de6ae5 Mon Sep 17 00:00:00 2001 From: quadbyte Date: Thu, 14 Aug 2025 22:50:13 -0400 Subject: [PATCH] ColorScheme: empty settings for now --- Modules/Settings/SettingsPanel.qml | 188 +++++++++----------------- Modules/Settings/Tabs/ColorScheme.qml | 71 ++++------ 2 files changed, 91 insertions(+), 168 deletions(-) diff --git a/Modules/Settings/SettingsPanel.qml b/Modules/Settings/SettingsPanel.qml index 40bbac2..d8645ba 100644 --- a/Modules/Settings/SettingsPanel.qml +++ b/Modules/Settings/SettingsPanel.qml @@ -10,11 +10,12 @@ import qs.Widgets NLoader { id: root - // Enumerate all the tabs, ordering is NOT relevant + // Tabs enumeration, order is NOT relevant enum Tab { About, Audio, Bar, + ColorScheme, Display, General, Network, @@ -33,61 +34,6 @@ NLoader { readonly property real scaling: Scaling.scale(screen) property int currentTabIndex: 0 - // List of all the tabs, ordering is relevant. - property var tabsModel: [{ - "id": SettingsPanel.Tab.General, - "label": "General", - "icon": "tune", - "source": "Tabs/General.qml" - }, { - "id": SettingsPanel.Tab.Bar, - "label": "Bar", - "icon": "web_asset", - "source": "Tabs/Bar.qml" - }, { - "id": SettingsPanel.Tab.Display, - "label": "Display", - "icon": "monitor", - "source": "Tabs/Display.qml" - }, { - "id": SettingsPanel.Tab.Audio, - "label": "Audio", - "icon": "volume_up", - "source": "Tabs/Audio.qml" - }, { - "id": SettingsPanel.Tab.Network, - "label": "Network", - "icon": "lan", - "source": "Tabs/Network.qml" - }, { - "id": SettingsPanel.Tab.TimeWeather, - "label": "Time & Weather", - "icon": "schedule", - "source": "Tabs/TimeWeather.qml" - }, { - "id": SettingsPanel.Tab.Wallpaper, - "label": "Wallpaper", - "icon": "image", - "source": "Tabs/Wallpaper.qml" - }, { - "id": SettingsPanel.Tab.WallpaperSelector, - "label": "Wallpaper Selector", - "icon": "wallpaper_slideshow", - "source": "Tabs/WallpaperSelector.qml" - }, { - "id": SettingsPanel.Tab.ScreenRecorder, - "label": "Screen Recorder", - "icon": "videocam", - "source": "Tabs/ScreenRecorder.qml" - }, { - "id": SettingsPanel.Tab.About, - "label": "About", - "icon": "info", - "source": "Tabs/About.qml" - }] - - WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand - // Override hide function to animate first function hide() { // Start hide animation @@ -98,69 +44,6 @@ NLoader { hideTimer.start() } - function getTab(tabId) { - switch (tabId) { - case SettingsPanel.Tab.About: - return tabAbount - case SettingsPanel.Tab.Audio: - return tabAudio - case SettingsPanel.Tab.Bar: - return tabBar - case SettingsPanel.Tab.General: - return tabGeneral - case SettingsPanel.Tab.Network: - return tabNetwork - case SettingsPanel.Tab.ScreenRecorder: - return tabScreenRecorder - case SettingsPanel.Tab.TimeWeather: - return tabTimeWeather - case SettingsPanel.Tab.Wallpaper: - return tabWallpaper - case SettingsPanel.Tab.WallpaperSelector: - return tabWallpaperSelector - default: - return tabGeneral - } - } - - // Wrap each tab in a Component so we can spawn them with flexibility - Component { - id: tabAbount - Tabs.About {} - } - Component { - id: tabAudio - Tabs.Audio {} - } - Component { - id: tabBar - Tabs.Bar {} - } - Component { - id: tabGeneral - Tabs.General {} - } - Component { - id: tabNetwork - Tabs.Network {} - } - Component { - id: tabScreenRecorder - Tabs.ScreenRecorder {} - } - Component { - id: tabTimeWeather - Tabs.TimeWeather {} - } - Component { - id: tabWallpaper - Tabs.Wallpaper {} - } - Component { - id: tabWallpaperSelector - Tabs.WallpaperSelector {} - } - // Connect to NPanel's dismissed signal to handle external close events Connections { target: panel @@ -185,6 +68,55 @@ NLoader { } } + WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand + + // Order is NOT relevant, and should match the Tabs.xxxx {} in the StackLayout + property var tabsModel: [{ + "id": SettingsPanel.Tab.General, + "label": "General", + "icon": "tune" + }, { + "id": SettingsPanel.Tab.Bar, + "label": "Bar", + "icon": "web_asset" + }, { + "id": SettingsPanel.Tab.Audio, + "label": "Audio", + "icon": "volume_up" + }, { + "id": SettingsPanel.Tab.Display, + "label": "Display", + "icon": "monitor" + }, { + "id": SettingsPanel.Tab.Network, + "label": "Network", + "icon": "lan" + }, { + "id": SettingsPanel.Tab.TimeWeather, + "label": "Time & Weather", + "icon": "schedule" + }, { + "id": SettingsPanel.Tab.ColorScheme, + "label": "Color Scheme", + "icon": "palette" + }, { + "id": SettingsPanel.Tab.Wallpaper, + "label": "Wallpaper", + "icon": "image" + }, { + "id": SettingsPanel.Tab.WallpaperSelector, + "label": "Wallpaper Selector", + "icon": "wallpaper_slideshow" + }, { + "id": SettingsPanel.Tab.ScreenRecorder, + "label": "Screen Recorder", + "icon": "videocam" + }, { + "id": SettingsPanel.Tab.About, + "label": "About", + "icon": "info" + }] + Component.onCompleted: { show() } @@ -278,6 +210,7 @@ NLoader { spacing: Style.marginTiny * 1.5 * scaling // Minimal spacing between tabs Repeater { + id: sections model: panel.tabsModel delegate: Rectangle { @@ -385,12 +318,17 @@ NLoader { Layout.fillHeight: true currentIndex: currentTabIndex - Repeater { - model: panel.tabsModel - delegate: Loader { - sourceComponent: getTab(modelData.id) - } - } + Tabs.General {} + Tabs.Bar {} + Tabs.Audio {} + Tabs.Display {} + Tabs.Network {} + Tabs.TimeWeather {} + Tabs.ColorScheme {} + Tabs.Wallpaper {} + Tabs.WallpaperSelector {} + Tabs.ScreenRecorder {} + Tabs.About {} } } } diff --git a/Modules/Settings/Tabs/ColorScheme.qml b/Modules/Settings/Tabs/ColorScheme.qml index cd49a77..7e95a97 100644 --- a/Modules/Settings/Tabs/ColorScheme.qml +++ b/Modules/Settings/Tabs/ColorScheme.qml @@ -9,6 +9,22 @@ ColumnLayout { spacing: 0 + // property var colorSchemes: [{ + // "label": "Generated from Wallpaper (Matugen required)" + // }, { + // "label": "Catppuccin" + // }, { + // "label": "Dracula" + // }, { + // "label": "Gruvbox" + // }, { + // "label": "Nord" + // "file": "nord.json" + // }, , { + // "label": "Rosé Pine", + // "file": "rosepine.json" + // }] + ScrollView { id: scrollView @@ -33,56 +49,25 @@ ColumnLayout { Layout.fillWidth: true NText { - text: "Components" + text: "TODO" font.pointSize: Style.fontSizeXL * scaling font.weight: Style.fontWeightBold color: Colors.mOnSurface } - NToggle { - label: "Show Active Window" - description: "Display the title of the currently focused window below the bar" - value: Settings.data.bar.showActiveWindow - onToggled: function (newValue) { - Settings.data.bar.showActiveWindow = newValue - } + ButtonGroup { + id: schemes } - NToggle { - label: "Show Active Window Icon" - description: "Display the icon of the currently focused window" - value: Settings.data.bar.showActiveWindowIcon - onToggled: function (newValue) { - Settings.data.bar.showActiveWindowIcon = newValue - } - } - - NToggle { - label: "Show System Info" - description: "Display system information (CPU, RAM, Temperature)" - value: Settings.data.bar.showSystemInfo - onToggled: function (newValue) { - Settings.data.bar.showSystemInfo = newValue - } - } - - NToggle { - label: "Show Taskbar" - description: "Display a taskbar showing currently open windows" - value: Settings.data.bar.showTaskbar - onToggled: function (newValue) { - Settings.data.bar.showTaskbar = newValue - } - } - - NToggle { - label: "Show Media" - description: "Display media controls and information" - value: Settings.data.bar.showMedia - onToggled: function (newValue) { - Settings.data.bar.showMedia = newValue - } - } + // Repeater { + // model: root.colorSchemes + // ButtonGroup.group: schemes + // NRadioButton { + // // checked: Audio.sink?.id === modelData.id + // //onClicked: Audio.setAudioSink(modelData) + // text: modelData.label + // } + // } } } }