diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 94b3dfe2..da203856 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -213,7 +213,8 @@ "respectExpireTimeout": false, "lowUrgencyDuration": 3, "normalUrgencyDuration": 8, - "criticalUrgencyDuration": 15 + "criticalUrgencyDuration": 15, + "enableKeyboardLayoutToast": true }, "osd": { "enabled": true, diff --git a/Modules/Bar/Extras/TrayMenu.qml b/Modules/Bar/Extras/TrayMenu.qml index 469f4cce..b6940e88 100644 --- a/Modules/Bar/Extras/TrayMenu.qml +++ b/Modules/Bar/Extras/TrayMenu.qml @@ -206,6 +206,14 @@ PopupWindow { if (modelData && !modelData.isSeparator && !modelData.hasChildren) { modelData.triggered() root.hideMenu() + + // Close the drawer if it's open + if (screen) { + const panel = PanelService.getPanel("trayDrawerPanel", screen) + if (panel && panel.visible) { + panel.close() + } + } } } diff --git a/Modules/Bar/Widgets/Bluetooth.qml b/Modules/Bar/Widgets/Bluetooth.qml index 2ce3fea6..a6b5894b 100644 --- a/Modules/Bar/Widgets/Bluetooth.qml +++ b/Modules/Bar/Widgets/Bluetooth.qml @@ -56,7 +56,7 @@ Item { forceOpen: !isBarVertical && root.displayMode === "alwaysShow" forceClose: isBarVertical || root.displayMode === "alwaysHide" || BluetoothService.connectedDevices.length === 0 onClicked: PanelService.getPanel("bluetoothPanel", screen)?.toggle(this) - onRightClicked: PanelService.getPanel("bluetoothPanel", screen)?.toggle(this) + onRightClicked: BluetoothService.setBluetoothEnabled(!BluetoothService.enabled) tooltipText: { if (pill.text !== "") { return pill.text diff --git a/Modules/Bar/Widgets/WiFi.qml b/Modules/Bar/Widgets/WiFi.qml index ad2d1ede..2c23542b 100644 --- a/Modules/Bar/Widgets/WiFi.qml +++ b/Modules/Bar/Widgets/WiFi.qml @@ -78,7 +78,7 @@ Item { forceOpen: !isBarVertical && root.displayMode === "alwaysShow" forceClose: isBarVertical || root.displayMode === "alwaysHide" || !pill.text onClicked: PanelService.getPanel("wifiPanel", screen)?.toggle(this) - onRightClicked: PanelService.getPanel("wifiPanel", screen)?.toggle(this) + onRightClicked: NetworkService.setWifiEnabled(!Settings.data.network.wifiEnabled) tooltipText: { if (pill.text !== "") { return pill.text diff --git a/Modules/MainScreen/MainScreen.qml b/Modules/MainScreen/MainScreen.qml index 3187ebc7..24c6f873 100644 --- a/Modules/MainScreen/MainScreen.qml +++ b/Modules/MainScreen/MainScreen.qml @@ -63,7 +63,11 @@ PanelWindow { if (CompositorService.isNiri) { return root.isPanelOpen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None } else { - return root.isPanelOpen ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None + if (!root.isPanelOpen) { + return WlrKeyboardFocus.None + } else { + return PanelService.openedPanel.exclusiveKeyboard ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.OnDemand + } } } diff --git a/Modules/MainScreen/SmartPanel.qml b/Modules/MainScreen/SmartPanel.qml index 58cabc37..e7330f13 100644 --- a/Modules/MainScreen/SmartPanel.qml +++ b/Modules/MainScreen/SmartPanel.qml @@ -43,6 +43,9 @@ Item { // Edge snapping: if panel is within this distance (in pixels) from a screen edge, snap property real edgeSnapDistance: 50 + // Edge snapping: if panel is within this distance (in pixels) from a screen edge, snap + property bool exclusiveKeyboard: false + // Track whether panel is open property bool isPanelOpen: false diff --git a/Modules/Panels/Calendar/CalendarPanel.qml b/Modules/Panels/Calendar/CalendarPanel.qml index 53d7de72..8d1bf3ab 100644 --- a/Modules/Panels/Calendar/CalendarPanel.qml +++ b/Modules/Panels/Calendar/CalendarPanel.qml @@ -7,6 +7,7 @@ import qs.Commons import qs.Modules.MainScreen import qs.Modules.Panels.ControlCenter.Cards import qs.Services.Location +import qs.Services.System import qs.Services.UI import qs.Widgets diff --git a/Modules/Panels/ControlCenter/Widgets/Bluetooth.qml b/Modules/Panels/ControlCenter/Widgets/Bluetooth.qml index d3ab79ad..e6280a37 100644 --- a/Modules/Panels/ControlCenter/Widgets/Bluetooth.qml +++ b/Modules/Panels/ControlCenter/Widgets/Bluetooth.qml @@ -10,7 +10,6 @@ NIconButtonHot { icon: BluetoothService.enabled ? "bluetooth" : "bluetooth-off" tooltipText: I18n.tr("quickSettings.bluetooth.tooltip.action") - onClicked: { - PanelService.getPanel("bluetoothPanel", screen)?.toggle(this) - } + onClicked: PanelService.getPanel("bluetoothPanel", screen)?.toggle(this) + onRightClicked: BluetoothService.setBluetoothEnabled(!BluetoothService.enabled) } diff --git a/Modules/Panels/ControlCenter/Widgets/WiFi.qml b/Modules/Panels/ControlCenter/Widgets/WiFi.qml index e40047f1..2ea25141 100644 --- a/Modules/Panels/ControlCenter/Widgets/WiFi.qml +++ b/Modules/Panels/ControlCenter/Widgets/WiFi.qml @@ -31,4 +31,5 @@ NIconButtonHot { tooltipText: I18n.tr("quickSettings.wifi.tooltip.action") onClicked: PanelService.getPanel("wifiPanel", screen)?.toggle(this) + onRightClicked: NetworkService.setWifiEnabled(!Settings.data.network.wifiEnabled) } diff --git a/Modules/Panels/Launcher/Launcher.qml b/Modules/Panels/Launcher/Launcher.qml index 9747b3ee..ca8fc07a 100644 --- a/Modules/Panels/Launcher/Launcher.qml +++ b/Modules/Panels/Launcher/Launcher.qml @@ -19,6 +19,8 @@ SmartPanel { preferredWidthRatio: 0.3 preferredHeightRatio: 0.5 + exclusiveKeyboard: true + panelBackgroundColor: Qt.alpha(Color.mSurface, Settings.data.appLauncher.backgroundOpacity) // Positioning diff --git a/Modules/Panels/Tray/TrayDrawerPanel.qml b/Modules/Panels/Tray/TrayDrawerPanel.qml index ae1376a9..ffc9bb8d 100644 --- a/Modules/Panels/Tray/TrayDrawerPanel.qml +++ b/Modules/Panels/Tray/TrayDrawerPanel.qml @@ -74,7 +74,7 @@ SmartPanel { readonly property int columns: Math.max(1, Math.min(maxColumns, itemCount)) readonly property int rows: Math.max(1, Math.ceil(itemCount / Math.max(1, columns))) - // Add 2*gap margins around the grid + // Static fallback sizes preferredWidth: (columns * cellSize) + ((columns - 1) * innerSpacing) + (2 * outerPadding) preferredHeight: (rows * cellSize) + ((rows - 1) * innerSpacing) + (2 * outerPadding) @@ -120,6 +120,10 @@ SmartPanel { panelContent: Item { id: content + // Dynamic content sizing that SmartPanel will watch for changes + property real contentPreferredWidth: (root.columns * root.cellSize) + ((root.columns - 1) * root.innerSpacing) + (2 * root.outerPadding) + property real contentPreferredHeight: (root.rows * root.cellSize) + ((root.rows - 1) * root.innerSpacing) + (2 * root.outerPadding) + Grid { id: grid anchors.fill: parent diff --git a/Widgets/NIconButton.qml b/Widgets/NIconButton.qml index 4dfb1273..eee7523e 100644 --- a/Widgets/NIconButton.qml +++ b/Widgets/NIconButton.qml @@ -30,7 +30,7 @@ Rectangle { signal clicked signal rightClicked signal middleClicked - signal wheel + signal wheel(int angleDelta) implicitWidth: applyUiScale ? Math.round(baseSize * Style.uiScaleRatio) : Math.round(baseSize) implicitHeight: applyUiScale ? Math.round(baseSize * Style.uiScaleRatio) : Math.round(baseSize)