ColorScheme: empty settings for now

This commit is contained in:
quadbyte 2025-08-14 22:50:13 -04:00
parent 2748e02988
commit a79d4b916e
2 changed files with 91 additions and 168 deletions

View file

@ -10,11 +10,12 @@ import qs.Widgets
NLoader { NLoader {
id: root id: root
// Enumerate all the tabs, ordering is NOT relevant // Tabs enumeration, order is NOT relevant
enum Tab { enum Tab {
About, About,
Audio, Audio,
Bar, Bar,
ColorScheme,
Display, Display,
General, General,
Network, Network,
@ -33,61 +34,6 @@ NLoader {
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: Scaling.scale(screen)
property int currentTabIndex: 0 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 // Override hide function to animate first
function hide() { function hide() {
// Start hide animation // Start hide animation
@ -98,69 +44,6 @@ NLoader {
hideTimer.start() 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 // Connect to NPanel's dismissed signal to handle external close events
Connections { Connections {
target: panel 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: { Component.onCompleted: {
show() show()
} }
@ -278,6 +210,7 @@ NLoader {
spacing: Style.marginTiny * 1.5 * scaling // Minimal spacing between tabs spacing: Style.marginTiny * 1.5 * scaling // Minimal spacing between tabs
Repeater { Repeater {
id: sections
model: panel.tabsModel model: panel.tabsModel
delegate: Rectangle { delegate: Rectangle {
@ -385,12 +318,17 @@ NLoader {
Layout.fillHeight: true Layout.fillHeight: true
currentIndex: currentTabIndex currentIndex: currentTabIndex
Repeater { Tabs.General {}
model: panel.tabsModel Tabs.Bar {}
delegate: Loader { Tabs.Audio {}
sourceComponent: getTab(modelData.id) Tabs.Display {}
} Tabs.Network {}
} Tabs.TimeWeather {}
Tabs.ColorScheme {}
Tabs.Wallpaper {}
Tabs.WallpaperSelector {}
Tabs.ScreenRecorder {}
Tabs.About {}
} }
} }
} }

View file

@ -9,6 +9,22 @@ ColumnLayout {
spacing: 0 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 { ScrollView {
id: scrollView id: scrollView
@ -33,56 +49,25 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
NText { NText {
text: "Components" text: "TODO"
font.pointSize: Style.fontSizeXL * scaling font.pointSize: Style.fontSizeXL * scaling
font.weight: Style.fontWeightBold font.weight: Style.fontWeightBold
color: Colors.mOnSurface color: Colors.mOnSurface
} }
NToggle { ButtonGroup {
label: "Show Active Window" id: schemes
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
}
} }
NToggle { // Repeater {
label: "Show Active Window Icon" // model: root.colorSchemes
description: "Display the icon of the currently focused window" // ButtonGroup.group: schemes
value: Settings.data.bar.showActiveWindowIcon // NRadioButton {
onToggled: function (newValue) { // // checked: Audio.sink?.id === modelData.id
Settings.data.bar.showActiveWindowIcon = newValue // //onClicked: Audio.setAudioSink(modelData)
} // text: modelData.label
} // }
// }
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
}
}
} }
} }
} }