This commit is contained in:
2026-01-29 17:55:26 -06:00
parent 13c920fd32
commit 9d18d477d5
24 changed files with 501 additions and 166 deletions

View File

@@ -9,7 +9,7 @@ import qs.Modules.Bar.Extras
import qs.Services.UI
import qs.Widgets
Rectangle {
Item {
id: root
property var pluginApi: null
@@ -18,8 +18,13 @@ Rectangle {
property string widgetId: ""
property string section: ""
readonly property string barPosition: Settings.data.bar.position
// Bar positioning properties
readonly property string screenName: screen ? screen.name : ""
readonly property string barPosition: Settings.getBarPositionForScreen(screenName)
readonly property bool isVertical: barPosition === "left" || barPosition === "right"
readonly property real barHeight: Style.getBarHeightForScreen(screenName)
readonly property real capsuleHeight: Style.getCapsuleHeightForScreen(screenName)
readonly property real barFontSize: Style.getBarFontSizeForScreen(screenName)
property bool micActive: false
property bool camActive: false
@@ -44,12 +49,14 @@ Rectangle {
readonly property bool isVisible: !hideInactive || micActive || camActive || scrActive
property real margins: removeMargins ? 0 : Style.marginM * 2
implicitWidth: isVertical ? Style.capsuleHeight : Math.round(layout.implicitWidth + margins)
implicitHeight: isVertical ? Math.round(layout.implicitHeight + margins) : Style.capsuleHeight
readonly property real contentWidth: isVertical ? Style.capsuleHeight : Math.round(layout.implicitWidth + margins)
readonly property real contentHeight: isVertical ? Math.round(layout.implicitHeight + margins) : Style.capsuleHeight
implicitWidth: contentWidth
implicitHeight: contentHeight
Layout.alignment: Qt.AlignVCenter
radius: Style.radiusM
color: Style.capsuleColor
visible: root.isVisible
opacity: root.isVisible ? 1.0 : 0.0
@@ -221,6 +228,54 @@ Rectangle {
return parts.length > 0 ? parts.join("\n") : "";
}
Rectangle {
id: visualCapsule
x: Style.pixelAlignCenter(parent.width, width)
y: Style.pixelAlignCenter(parent.height, height)
width: root.contentWidth
height: root.contentHeight
radius: Style.radiusM
color: Style.capsuleColor
border.color: Style.capsuleBorderColor
border.width: Style.capsuleBorderWidth
Item {
id: layout
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
implicitWidth: iconsLayout.implicitWidth
implicitHeight: iconsLayout.implicitHeight
GridLayout {
id: iconsLayout
columns: root.isVertical ? 1 : 3
rows: root.isVertical ? 3 : 1
rowSpacing: root.iconSpacing
columnSpacing: root.iconSpacing
NIcon {
visible: micActive || !root.hideInactive
icon: micActive ? "microphone" : "microphone-off"
color: root.micColor
}
NIcon {
visible: camActive || !root.hideInactive
icon: camActive ? "camera" : "camera-off"
color: root.camColor
}
NIcon {
visible: scrActive || !root.hideInactive
icon: scrActive ? "screen-share" : "screen-share-off"
color: root.scrColor
}
}
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
@@ -234,40 +289,4 @@ Rectangle {
}
onExited: TooltipService.hide()
}
Item {
id: layout
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
implicitWidth: iconsLayout.implicitWidth
implicitHeight: iconsLayout.implicitHeight
GridLayout {
id: iconsLayout
columns: root.isVertical ? 1 : 3
rows: root.isVertical ? 3 : 1
rowSpacing: root.iconSpacing
columnSpacing: root.iconSpacing
NIcon {
visible: micActive || !root.hideInactive
icon: micActive ? "microphone" : "microphone-off"
color: root.micColor
}
NIcon {
visible: camActive || !root.hideInactive
icon: camActive ? "camera" : "camera-off"
color: root.camColor
}
NIcon {
visible: scrActive || !root.hideInactive
icon: scrActive ? "screen-share" : "screen-share-off"
color: root.scrColor
}
}
}
}

View File

@@ -0,0 +1,21 @@
{
"settings": {
"hideInactive": {
"desc": "Mikrofon, kamera és képernyő ikonok elrejtése, ha éppen nincsenek használatban.",
"label": "Inaktív állapotok elrejtése"
},
"iconSpacing": {
"desc": "Állítsa be az ikonok közötti távolságot.",
"label": "Ikon távolság"
},
"removeMargins": {
"desc": "Távolítsd el a widget összes külső margóját.",
"label": "Margók eltávolítása"
}
},
"tooltip": {
"cam-on": "Kamera: {apps}",
"mic-on": "Mikrofon: {apps}",
"screen-on": "Képernyőmegosztás: {apps}"
}
}

View File

@@ -0,0 +1,21 @@
{
"settings": {
"hideInactive": {
"desc": "Îkonên mîkrofon, kamera û ekranê dema ku neçalak bin veşêre.",
"label": "Rewşa neçalak veşêre"
},
"iconSpacing": {
"desc": "Cihê di navbera îkonan de diyar bike.",
"label": "Dûrahiya îkonan"
},
"removeMargins": {
"desc": "Hemû marjînalên derveyî yên widgetê rake.",
"label": "Derdestên derxînin"
}
},
"tooltip": {
"cam-on": "Kamera: {apps}",
"mic-on": "Mîkrofon: {apps}",
"screen-on": "Parvekirina ekranê: {apps}"
}
}

View File

@@ -0,0 +1,21 @@
{
"settings": {
"hideInactive": {
"desc": "Ukryj ikony mikrofonu, kamery i ekranu, gdy są nieaktywne.",
"label": "Ukryj nieaktywne stany"
},
"iconSpacing": {
"desc": "Ustaw odstęp między ikonami.",
"label": "Odstępy ikon"
},
"removeMargins": {
"desc": "Usuń wszystkie zewnętrzne marginesy widżetu.",
"label": "Usuń marginesy"
}
},
"tooltip": {
"cam-on": "Kamera: {apps}",
"mic-on": "Mikrofon: {apps}",
"screen-on": "Udostępnianie ekranu: {apps}"
}
}

View File

@@ -0,0 +1,21 @@
{
"settings": {
"hideInactive": {
"desc": "當麥克風, 攝影機及螢幕分享沒有啟動時就直接隱藏",
"label": "隱藏未啟動的狀態"
},
"iconSpacing": {
"desc": "設定圖示之間的留空",
"label": "圖示間距"
},
"removeMargins": {
"desc": "移除小工具外面的所有邊距",
"label": "移除邊距"
}
},
"tooltip": {
"cam-on": "攝影機: {apps}",
"mic-on": "麥克風: {apps}",
"screen-on": "螢幕分享: {apps}"
}
}

View File

@@ -1,12 +1,14 @@
{
"id": "privacy-indicator",
"name": "Privacy Indicator",
"version": "1.0.10",
"version": "1.0.13",
"minNoctaliaVersion": "3.6.0",
"author": "Noctalia Team <team@noctalia.dev>",
"author": "Noctalia Team",
"official": true,
"license": "MIT",
"repository": "https://github.com/noctalia-dev/noctalia-plugins",
"description": "A privacy indicator widget that shows when microphone, camera or screen sharing is active.",
"tags": ["Bar", "Privacy", "Indicator"],
"entryPoints": {
"barWidget": "BarWidget.qml",
"settings": "Settings.qml"