mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
desktop widgets: niri overview only option + grid on overlay when on
overview
This commit is contained in:
@@ -24,6 +24,7 @@ Item {
|
||||
|
||||
readonly property bool showOnOverlay: instanceData?.config?.showOnOverlay ?? false
|
||||
readonly property bool showOnOverview: instanceData?.config?.showOnOverview ?? false
|
||||
readonly property bool showOnOverviewOnly: instanceData?.config?.showOnOverviewOnly ?? false
|
||||
readonly property bool overviewActive: CompositorService.isNiri && NiriService.inOverview
|
||||
|
||||
Connections {
|
||||
@@ -203,7 +204,13 @@ Item {
|
||||
PanelWindow {
|
||||
id: widgetWindow
|
||||
screen: root.screen
|
||||
visible: root.widgetEnabled && root.activeComponent !== null
|
||||
visible: {
|
||||
if (!root.widgetEnabled || root.activeComponent === null)
|
||||
return false;
|
||||
if (root.showOnOverviewOnly)
|
||||
return root.overviewActive;
|
||||
return true;
|
||||
}
|
||||
color: "transparent"
|
||||
|
||||
WlrLayershell.namespace: "quickshell:desktop-widget:" + root.pluginId + (root.instanceId ? ":" + root.instanceId : "")
|
||||
@@ -212,7 +219,7 @@ Item {
|
||||
return WlrLayer.Overlay;
|
||||
if (root.showOnOverlay)
|
||||
return WlrLayer.Overlay;
|
||||
if (root.showOnOverview && root.overviewActive)
|
||||
if (root.overviewActive && (root.showOnOverview || root.showOnOverviewOnly))
|
||||
return WlrLayer.Overlay;
|
||||
return WlrLayer.Bottom;
|
||||
}
|
||||
@@ -543,7 +550,7 @@ Item {
|
||||
mask: Region {}
|
||||
|
||||
WlrLayershell.namespace: "quickshell:desktop-widget-grid"
|
||||
WlrLayershell.layer: WlrLayer.Background
|
||||
WlrLayershell.layer: root.overviewActive && (root.showOnOverview || root.showOnOverviewOnly) ? WlrLayer.Overlay : WlrLayer.Background
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
||||
|
||||
|
||||
@@ -246,6 +246,23 @@ SettingsCard {
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {
|
||||
visible: CompositorService.isNiri
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
visible: CompositorService.isNiri
|
||||
text: I18n.tr("Show on Overview Only")
|
||||
checked: instanceData?.config?.showOnOverviewOnly ?? false
|
||||
onToggled: isChecked => {
|
||||
if (!root.instanceId)
|
||||
return;
|
||||
SettingsData.updateDesktopWidgetInstanceConfig(root.instanceId, {
|
||||
showOnOverviewOnly: isChecked
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
Item {
|
||||
|
||||
Reference in New Issue
Block a user