This commit is contained in:
2026-02-09 09:17:08 -06:00
parent 9d18d477d5
commit 112ff5c88e
39 changed files with 1660 additions and 88 deletions

View File

@@ -40,8 +40,11 @@ Item {
property bool removeMargins: cfg.removeMargins ?? defaults.removeMargins
property int iconSpacing: cfg.iconSpacing || Style.marginXS
readonly property color activeColor: Color.mPrimary
readonly property color inactiveColor: Qt.alpha(Color.mOnSurfaceVariant, 0.3)
property string activeColorKey: cfg.activeColor ?? defaults.activeColor
property string inactiveColorKey: cfg.inactiveColor ?? defaults.inactiveColor
readonly property color activeColor: Color.resolveColorKey(activeColorKey)
readonly property color inactiveColor: inactiveColorKey === "none" ? Qt.alpha(Color.mOnSurfaceVariant, 0.3) : Color.resolveColorKey(inactiveColorKey)
readonly property color micColor: micActive ? activeColor : inactiveColor
readonly property color camColor: camActive ? activeColor : inactiveColor
readonly property color scrColor: scrActive ? activeColor : inactiveColor
@@ -276,11 +279,37 @@ Item {
}
}
NPopupContextMenu {
id: contextMenu
model: [
{
"label": pluginApi?.tr("menu.settings"),
"action": "settings",
"icon": "settings"
},
]
onTriggered: function (action) {
contextMenu.close();
PanelService.closeContextMenu(screen);
if (action === "settings") {
BarService.openPluginSettings(root.screen, pluginApi.manifest);
}
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
hoverEnabled: true
onClicked: function (mouse) {
if (mouse.button === Qt.RightButton) {
PanelService.showContextMenu(contextMenu, root, screen);
}
}
onEntered: {
var tooltipText = buildTooltip();
if (tooltipText) {

View File

@@ -14,6 +14,8 @@ ColumnLayout {
property bool hideInactive: cfg.hideInactive ?? defaults.hideInactive
property bool removeMargins: cfg.removeMargins ?? defaults.removeMargins
property int iconSpacing: cfg.iconSpacing || Style.marginXS
property string activeColor: cfg.activeColor ?? defaults.activeColor
property string inactiveColor: cfg.inactiveColor ?? defaults.inactiveColor
spacing: Style.marginL
@@ -45,6 +47,22 @@ ColumnLayout {
}
}
NComboBox {
label: pluginApi?.tr("settings.activeColor.label")
description: pluginApi?.tr("settings.activeColor.desc")
model: Color.colorKeyModel
currentKey: root.activeColor
onSelected: key => root.activeColor = key
}
NComboBox {
label: pluginApi?.tr("settings.inactiveColor.label")
description: pluginApi?.tr("settings.inactiveColor.desc")
model: Color.colorKeyModel
currentKey: root.inactiveColor
onSelected: key => root.inactiveColor = key
}
NComboBox {
label: pluginApi?.tr("settings.iconSpacing.label")
description: pluginApi?.tr("settings.iconSpacing.desc")
@@ -80,6 +98,8 @@ ColumnLayout {
pluginApi.pluginSettings.hideInactive = root.hideInactive;
pluginApi.pluginSettings.iconSpacing = root.iconSpacing;
pluginApi.pluginSettings.removeMargins = root.removeMargins;
pluginApi.pluginSettings.activeColor = root.activeColor;
pluginApi.pluginSettings.inactiveColor = root.inactiveColor;
pluginApi.saveSettings();

View File

@@ -1,9 +1,20 @@
{
"menu": {
"settings": "Widget settings"
},
"settings": {
"activeColor": {
"desc": "Color of the icons when active.",
"label": "Active icon color"
},
"hideInactive": {
"desc": "Hide microphone, camera, and screen icons when there are inactive.",
"label": "Hide inactive states"
},
"inactiveColor": {
"desc": "Color of the icons when inactive.",
"label": "Inactive icon color"
},
"iconSpacing": {
"desc": "Set the spacing between the icons.",
"label": "Icon spacing"

View File

@@ -1,7 +1,7 @@
{
"id": "privacy-indicator",
"name": "Privacy Indicator",
"version": "1.0.13",
"version": "1.1.0",
"minNoctaliaVersion": "3.6.0",
"author": "Noctalia Team",
"official": true,
@@ -19,7 +19,9 @@
"metadata": {
"defaultSettings": {
"hideInactive": false,
"removeMargins": false
"removeMargins": false,
"activeColor": "primary",
"inactiveColor": "none"
}
}
}