mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-07 12:25:15 +00:00
feat: Add custom settings and blacklist for Tray module
This commit is contained in:
@@ -16,11 +16,28 @@ Rectangle {
|
|||||||
property ShellScreen screen
|
property ShellScreen screen
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
|
||||||
|
// Widget properties passed from Bar.qml for per-instance settings
|
||||||
|
property string widgetId: ""
|
||||||
|
property string section: ""
|
||||||
|
property int sectionWidgetIndex: -1
|
||||||
|
property int sectionWidgetsCount: 0
|
||||||
|
|
||||||
|
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||||
|
property var widgetSettings: {
|
||||||
|
if (section && sectionWidgetIndex >= 0) {
|
||||||
|
var widgets = Settings.data.bar.widgets[section]
|
||||||
|
if (widgets && sectionWidgetIndex < widgets.length) {
|
||||||
|
return widgets[sectionWidgetIndex]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
readonly property string barPosition: Settings.data.bar.position
|
readonly property string barPosition: Settings.data.bar.position
|
||||||
readonly property bool isVertical: barPosition === "left" || barPosition === "right"
|
readonly property bool isVertical: barPosition === "left" || barPosition === "right"
|
||||||
readonly property bool compact: (Settings.data.bar.density === "compact")
|
readonly property bool compact: (Settings.data.bar.density === "compact")
|
||||||
property real itemSize: Math.round(Style.capsuleHeight * 0.65 * scaling)
|
property real itemSize: Math.round(Style.capsuleHeight * 0.65 * scaling)
|
||||||
property list<string> blacklist: Settings.data.bar.trayBlacklist || [] // Read from settings
|
property list<string> blacklist: widgetSettings.blacklist || Settings.data.bar.trayBlacklist || [] // Read from settings
|
||||||
property var filteredItems: []
|
property var filteredItems: []
|
||||||
|
|
||||||
function wildCardMatch(str, rule) {
|
function wildCardMatch(str, rule) {
|
||||||
|
|||||||
@@ -110,12 +110,7 @@ Popup {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (settingsLoader.item && settingsLoader.item.saveSettings) {
|
if (settingsLoader.item && settingsLoader.item.saveSettings) {
|
||||||
var newSettings = settingsLoader.item.saveSettings()
|
var newSettings = settingsLoader.item.saveSettings()
|
||||||
if (widgetSettings.widgetId === "Tray") {
|
root.updateWidgetSettings(sectionId, widgetSettings.widgetIndex, newSettings)
|
||||||
Settings.data.bar.trayBlacklist = newSettings.blacklist || []
|
|
||||||
Settings.saveImmediate()
|
|
||||||
} else {
|
|
||||||
root.updateWidgetSettings(sectionId, widgetSettings.widgetIndex, newSettings)
|
|
||||||
}
|
|
||||||
widgetSettings.close()
|
widgetSettings.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,8 @@ Singleton {
|
|||||||
"onlyActiveWorkspaces": true
|
"onlyActiveWorkspaces": true
|
||||||
},
|
},
|
||||||
"Tray": {
|
"Tray": {
|
||||||
"allowUserSettings": true
|
"allowUserSettings": true,
|
||||||
|
"blacklist": []
|
||||||
},
|
},
|
||||||
"Workspace": {
|
"Workspace": {
|
||||||
"allowUserSettings": true,
|
"allowUserSettings": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user