Merge branch 'rebuild' of https://github.com/Ly-sec/Noctalia into rebuild

This commit is contained in:
Ly-sec 2025-08-14 13:58:32 +02:00
commit 94a646cfb3
8 changed files with 38 additions and 42 deletions

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
import qs.Modules.Settings
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -52,7 +53,7 @@ Item {
} }
} }
onClicked: { onClicked: {
settingsPanel.requestedTab = settingsPanel.tabsIds.AUDIO settingsPanel.requestedTab = SettingsPanel.Tab.Audio
settingsPanel.isLoaded = true settingsPanel.isLoaded = true
} }
} }

View file

@ -10,26 +10,22 @@ import qs.Widgets
NLoader { NLoader {
id: root id: root
property var tabsIds: null enum Tab {
property var requestedTab: null General,
Bar,
Component.onCompleted: { TimeWeather,
// Fill up our ideads ScreenRecorder,
tabsIds = Object.freeze({ Network,
"GENERAL": 0, Audio,
"BAR": 1, Display,
"TIME_WEATHER": 2, Wallpaper,
"SCREEN_RECORDER": 3, WallpaperSelector,
"NETWORK": 4, //Misc,
"AUDIO": 5, About
"DISPLAY": 6,
"WALLPAPER": 7,
"WALLPAPER_SELECTOR": 8,
"MISC": 9,
"ABOUT": 10
})
} }
property int requestedTab: SettingsPanel.Tab.General
content: Component { content: Component {
NPanel { NPanel {
id: panel id: panel
@ -74,63 +70,67 @@ NLoader {
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
property var tabsModel: [{ property var tabsModel: [{
"id": root.tabsIds.GENERAL, "id": SettingsPanel.Tab.General,
"label": "General", "label": "General",
"icon": "tune", "icon": "tune",
"source": "Tabs/General.qml" "source": "Tabs/General.qml"
}, { }, {
"id": root.tabsIds.BAR, "id": SettingsPanel.Tab.Bar,
"label": "Bar", "label": "Bar",
"icon": "web_asset", "icon": "web_asset",
"source": "Tabs/Bar.qml" "source": "Tabs/Bar.qml"
}, { }, {
"id": root.tabsIds.TIME_WEATHER, "id": SettingsPanel.Tab.TimeWeather,
"label": "Time & Weather", "label": "Time & Weather",
"icon": "schedule", "icon": "schedule",
"source": "Tabs/TimeWeather.qml" "source": "Tabs/TimeWeather.qml"
}, { }, {
"id": root.tabsIds.SCREEN_RECORDER, "id": SettingsPanel.Tab.ScreenRecorder,
"label": "Screen Recorder", "label": "Screen Recorder",
"icon": "videocam", "icon": "videocam",
"source": "Tabs/ScreenRecorder.qml" "source": "Tabs/ScreenRecorder.qml"
}, { }, {
"id": root.tabsIds.NETWORK, "id": SettingsPanel.Tab.Network,
"label": "Network", "label": "Network",
"icon": "lan", "icon": "lan",
"source": "Tabs/Network.qml" "source": "Tabs/Network.qml"
}, { }, {
"id": root.tabsIds.AUDIO, "id": SettingsPanel.Tab.Audio,
"label": "Audio", "label": "Audio",
"icon": "volume_up", "icon": "volume_up",
"source": "Tabs/Audio.qml" "source": "Tabs/Audio.qml"
}, { }, {
"id": root.tabsIds.DISPLAY, "id": SettingsPanel.Tab.Display,
"label": "Display", "label": "Display",
"icon": "monitor", "icon": "monitor",
"source": "Tabs/Display.qml" "source": "Tabs/Display.qml"
}, { }, {
"id": root.tabsIds.WALLPAPER, "id": SettingsPanel.Tab.Wallpaper,
"label": "Wallpaper", "label": "Wallpaper",
"icon": "image", "icon": "image",
"source": "Tabs/Wallpaper.qml" "source": "Tabs/Wallpaper.qml"
}, { }, {
"id": root.tabsIds.WALLPAPER_SELECTOR, "id": SettingsPanel.Tab.WallpaperSelector,
"label": "Wallpaper Selector", "label": "Wallpaper Selector",
"icon": "wallpaper_slideshow", "icon": "wallpaper_slideshow",
"source": "Tabs/WallpaperSelector.qml" "source": "Tabs/WallpaperSelector.qml"
}, // { }, // {
// "id": root.tabsIds.MISC, // "id": SettingsPanel.Tab.Misc,
// "label": "Misc", // "label": "Misc",
// "icon": "more_horiz", // "icon": "more_horiz",
// "source": "Tabs/Misc.qml" // "source": "Tabs/Misc.qml"
// }, // },
{ {
"id": root.tabsIds.ABOUT, "id": SettingsPanel.Tab.About,
"label": "About", "label": "About",
"icon": "info", "icon": "info",
"source": "Tabs/About.qml" "source": "Tabs/About.qml"
}] }]
Component.onCompleted: {
show()
}
// Combined visibility change handler // Combined visibility change handler
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
@ -156,8 +156,6 @@ NLoader {
} }
} }
Component.onCompleted: show()
Rectangle { Rectangle {
id: bgRect id: bgRect
color: Colors.backgroundPrimary color: Colors.backgroundPrimary

View file

@ -4,9 +4,10 @@ import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Widgets import Quickshell.Widgets
import qs.Modules.Settings
import qs.Modules.SidePanel
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
import qs.Modules.SidePanel
// Header card with avatar, user and quick actions // Header card with avatar, user and quick actions
NBox { NBox {
@ -15,8 +16,6 @@ NBox {
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: Scaling.scale(screen)
property string uptimeText: "--" property string uptimeText: "--"
Layout.fillWidth: true Layout.fillWidth: true
// Height driven by content // Height driven by content
implicitHeight: content.implicitHeight + Style.marginMedium * 2 * scaling implicitHeight: content.implicitHeight + Style.marginMedium * 2 * scaling
@ -61,7 +60,7 @@ NBox {
icon: "settings" icon: "settings"
tooltipText: "Open settings" tooltipText: "Open settings"
onClicked: { onClicked: {
settingsPanel.requestedTab = settingsPanel.tabsIds.GENERAL settingsPanel.requestedTab = SettingsPanel.Tab.General
settingsPanel.isLoaded = !settingsPanel.isLoaded settingsPanel.isLoaded = !settingsPanel.isLoaded
} }
} }

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import qs.Modules.Settings
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@ -31,7 +32,7 @@ NBox {
NIconButton { NIconButton {
icon: "image" icon: "image"
onClicked: { onClicked: {
settingsPanel.requestedTab = settingsPanel.tabsIds.WALLPAPER_SELECTOR settingsPanel.requestedTab = SettingsPanel.Tab.WallpaperSelector
settingsPanel.isLoaded = true settingsPanel.isLoaded = true
} }
} }

View file

@ -12,8 +12,6 @@ NPanel {
id: powerMenu id: powerMenu
visible: false visible: false
// Anchors will be set by the parent component // Anchors will be set by the parent component
function show() { function show() {
visible = true visible = true

View file

@ -15,7 +15,6 @@ NLoader {
// Target screen to open on // Target screen to open on
property var targetScreen: null property var targetScreen: null
function openAt(x, screen) { function openAt(x, screen) {
anchorX = x anchorX = x
targetScreen = screen targetScreen = screen