mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
New windowing system
Large commit that totally refactor of the way we handle the bar and panels. Testing should focus on Panels, Bar, Keyboard Focus, IPC calls. Changes brief: - One NFullScreenWindow per screen which handle it's bar and dedicated panels. - Added shadows - Reintroduced dimming - New panels animations - Proper Z ordering - Panels on overlay laywer is not reimplemented, if we do it then the bar will be on the Overlay too - Panel dragging was not reimplemented, to be discussed before reimplementing - Still a WIP, need to work more on shadows and polishing + debugging.
This commit is contained in:
@@ -60,8 +60,9 @@ NBox {
|
||||
icon: "settings"
|
||||
tooltipText: I18n.tr("tooltips.open-settings")
|
||||
onClicked: {
|
||||
settingsPanel.requestedTab = SettingsPanel.Tab.General
|
||||
settingsPanel.open()
|
||||
var panel = PanelService.getPanel("settingsPanel", screen)
|
||||
panel.requestedTab = SettingsPanel.Tab.General
|
||||
panel.open()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +70,8 @@ NBox {
|
||||
icon: "power"
|
||||
tooltipText: I18n.tr("tooltips.session-menu")
|
||||
onClicked: {
|
||||
sessionMenuPanel.open()
|
||||
controlCenterPanel.close()
|
||||
PanelService.getPanel("sessionMenuPanel", screen)?.open()
|
||||
PanelService.getPanel("controlCenterPanel", screen)?.close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +79,7 @@ NBox {
|
||||
icon: "close"
|
||||
tooltipText: I18n.tr("tooltips.close")
|
||||
onClicked: {
|
||||
controlCenterPanel.close()
|
||||
PanelService.getPanel("controlCenterPanel", screen)?.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,10 +28,13 @@ RowLayout {
|
||||
Repeater {
|
||||
model: Settings.data.controlCenter.shortcuts.left
|
||||
delegate: ControlCenterWidgetLoader {
|
||||
required property var modelData
|
||||
required property int index
|
||||
|
||||
Layout.fillWidth: false
|
||||
widgetId: (modelData.id !== undefined ? modelData.id : "")
|
||||
widgetScreen: root.screen
|
||||
widgetProps: {
|
||||
"screen": root.modelData || null,
|
||||
"widgetId": modelData.id,
|
||||
"section": "quickSettings",
|
||||
"sectionWidgetIndex": index,
|
||||
@@ -63,10 +66,13 @@ RowLayout {
|
||||
Repeater {
|
||||
model: Settings.data.controlCenter.shortcuts.right
|
||||
delegate: ControlCenterWidgetLoader {
|
||||
required property var modelData
|
||||
required property int index
|
||||
|
||||
Layout.fillWidth: false
|
||||
widgetId: (modelData.id !== undefined ? modelData.id : "")
|
||||
widgetScreen: root.screen
|
||||
widgetProps: {
|
||||
"screen": root.modelData || null,
|
||||
"widgetId": modelData.id,
|
||||
"section": "quickSettings",
|
||||
"sectionWidgetIndex": index,
|
||||
|
||||
@@ -10,7 +10,6 @@ import qs.Widgets
|
||||
NPanel {
|
||||
id: root
|
||||
|
||||
panelKeyboardFocus: true
|
||||
preferredWidth: Math.round(460 * Style.uiScaleRatio)
|
||||
preferredHeight: {
|
||||
var height = 0
|
||||
|
||||
@@ -6,9 +6,10 @@ import qs.Commons
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property string widgetId: ""
|
||||
property var widgetProps: ({})
|
||||
property string screenName: widgetProps && widgetProps.screen ? widgetProps.screen.name : ""
|
||||
required property string widgetId
|
||||
required property var widgetScreen
|
||||
required property var widgetProps
|
||||
|
||||
property string section: widgetProps && widgetProps.section || ""
|
||||
property int sectionIndex: widgetProps && widgetProps.sectionWidgetIndex || 0
|
||||
|
||||
@@ -23,30 +24,29 @@ Item {
|
||||
Loader {
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
active: widgetId !== ""
|
||||
asynchronous: false
|
||||
sourceComponent: {
|
||||
if (!active) {
|
||||
return null
|
||||
}
|
||||
return ControlCenterWidgetRegistry.getWidget(widgetId)
|
||||
}
|
||||
sourceComponent: ControlCenterWidgetRegistry.getWidget(widgetId)
|
||||
|
||||
onLoaded: {
|
||||
if (item && widgetProps) {
|
||||
// Apply properties to loaded widget
|
||||
for (var prop in widgetProps) {
|
||||
if (item.hasOwnProperty(prop)) {
|
||||
item[prop] = widgetProps[prop]
|
||||
}
|
||||
if (!item)
|
||||
return
|
||||
|
||||
// Apply properties to loaded widget
|
||||
for (var prop in widgetProps) {
|
||||
if (item.hasOwnProperty(prop)) {
|
||||
item[prop] = widgetProps[prop]
|
||||
}
|
||||
}
|
||||
|
||||
// Set screen property
|
||||
if (item.hasOwnProperty("screen")) {
|
||||
item.screen = widgetScreen
|
||||
}
|
||||
|
||||
// Call custom onLoaded if it exists
|
||||
if (item.hasOwnProperty("onLoaded")) {
|
||||
item.onLoaded()
|
||||
}
|
||||
|
||||
//Logger.i("ControlCenterWidgetLoader", "Loaded", widgetId, "on screen", item.screen.name)
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
@@ -56,8 +56,8 @@ Item {
|
||||
}
|
||||
|
||||
// Error handling
|
||||
onWidgetIdChanged: {
|
||||
if (widgetId && !ControlCenterWidgetRegistry.hasWidget(widgetId)) {
|
||||
Component.onCompleted: {
|
||||
if (!ControlCenterWidgetRegistry.hasWidget(widgetId)) {
|
||||
Logger.w("ControlCenterWidgetLoader", "Widget not found in registry:", widgetId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,7 @@ NIconButtonHot {
|
||||
|
||||
icon: BluetoothService.enabled ? "bluetooth" : "bluetooth-off"
|
||||
tooltipText: I18n.tr("quickSettings.bluetooth.tooltip.action")
|
||||
onClicked: PanelService.getPanel("bluetoothPanel")?.toggle(this)
|
||||
onClicked: {
|
||||
PanelService.getPanel("bluetoothPanel", screen)?.toggle(this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ NIconButtonHot {
|
||||
}
|
||||
|
||||
onRightClicked: {
|
||||
var settingsPanel = PanelService.getPanel("settingsPanel")
|
||||
var settingsPanel = PanelService.getPanel("settingsPanel", screen)
|
||||
settingsPanel.requestedTab = SettingsPanel.Tab.Display
|
||||
settingsPanel.open()
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ NIconButtonHot {
|
||||
icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell"
|
||||
hot: Settings.data.notifications.doNotDisturb
|
||||
tooltipText: I18n.tr("quickSettings.notifications.tooltip.action")
|
||||
onClicked: PanelService.getPanel("notificationHistoryPanel")?.toggle(this)
|
||||
onClicked: PanelService.getPanel("notificationHistoryPanel", screen)?.toggle(this)
|
||||
onRightClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ NIconButtonHot {
|
||||
enabled: hasPP
|
||||
icon: PowerProfileService.getIcon()
|
||||
hot: !PowerProfileService.isDefault()
|
||||
tooltipText: hasPP ? I18n.tr("quickSettings.powerProfile.tooltip.action") : I18n.tr("quickSettings.powerProfile.tooltip.disabled")
|
||||
tooltipText: I18n.tr("quickSettings.powerProfile.tooltip.action")
|
||||
onClicked: {
|
||||
PowerProfileService.cycleProfile()
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ NIconButtonHot {
|
||||
onClicked: {
|
||||
ScreenRecorderService.toggleRecording()
|
||||
if (!ScreenRecorderService.isRecording) {
|
||||
var panel = PanelService.getPanel("controlCenterPanel")
|
||||
var panel = PanelService.getPanel("controlCenterPanel", screen)
|
||||
panel?.close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ NIconButtonHot {
|
||||
enabled: Settings.data.wallpaper.enabled
|
||||
icon: "wallpaper-selector"
|
||||
tooltipText: I18n.tr("quickSettings.wallpaperSelector.tooltip.action")
|
||||
onClicked: PanelService.getPanel("wallpaperPanel")?.toggle()
|
||||
onClicked: PanelService.getPanel("wallpaperPanel", screen)?.toggle()
|
||||
onRightClicked: WallpaperService.setRandomWallpaper()
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ NIconButtonHot {
|
||||
}
|
||||
|
||||
tooltipText: I18n.tr("quickSettings.wifi.tooltip.action")
|
||||
onClicked: PanelService.getPanel("wifiPanel")?.toggle(this)
|
||||
onClicked: PanelService.getPanel("wifiPanel", screen)?.toggle(this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user