Add bar spots beside the notch, and Caffeine and Night Light modules

Notch mode gets two more module lists, notch.innerLeft and
notch.innerRight: spots right beside the notch at the same distance on
both sides. They follow the notch's edges as it springs wider for media,
never draw pills (plugins and the tray drop theirs there), and fade out
while the notch is open or widened. Picking a module for one of the four
side spots in Settings -> Notch moves it there from the others.

Caffeine and Night Light are now bar modules too; Night Light polls its
state every 30 s while only the bar watches it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-29 23:27:01 +01:00
1 parent 3f0e31b116
commit bc197339fa
12 files changed
+169 -13

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
import QtQuick
import "../../components"
import "../../services"
// Caffeine on the bar: keeps the system awake while lit.
BarToggle {
property var entry: ({})
objectName: "caffeineModule"
tip: "Caffeine"
glyph: CaffeineService.active ? "󰅶" : "󰛊"
on: CaffeineService.active
bare: entry.bare === true
onClicked: CaffeineService.toggle()
}
@@ -0,0 +1,20 @@
import QtQuick
import "../../components"
import "../../services"
// Night Light on the bar. Shows the provider's acknowledged state; while
// only the bar watches, the state is polled slowly.
BarToggle {
property var entry: ({})
readonly property var info: SystemService.state.nightLight || ({
available: false
})
objectName: "nightLightModule"
tip: "Night Light"
glyph: "󰖔"
on: !!info.enabled
bare: entry.bare === true
enabled: !!info.available && !SystemService.acting
onClicked: SystemService.action("nightLight", !info.enabled, false)
Component.onCompleted: SystemService.nightLightWatchers++
Component.onDestruction: SystemService.nightLightWatchers--
}
+2 -1
View File
@@ -25,7 +25,8 @@ GlassPill {
readonly property bool shown: !!widget && (noctalia || widgetObject.hasVisualContent !== false) && widget.implicitWidth > 0
// A plugin can offer a "background" setting; "transparent" drops the
// pill so its widget sits straight on the bar, like the tray's option.
readonly property bool bare: settings.background === "transparent"
// The spots beside the notch drop it too.
readonly property bool bare: settings.background === "transparent" || entry.bare === true
color: bare ? "transparent" : Qt.alpha(Theme.surface, surfaceOpacity)
border.width: bare ? 0 : 1
plain: bare
+2 -1
View File
@@ -7,6 +7,7 @@ import "../../core"
Item {
id: root
property var barScreen
property var entry: ({})
readonly property bool shown: TrayService.options.enabled && TrayService.items.length > 0
implicitWidth: shown ? row.implicitWidth + 12 : 0
implicitHeight: shown ? ModuleRegistry.pillHeight : 0
@@ -14,7 +15,7 @@ Item {
// The whole pill is hover space: gaps between icons keep a hover menu open.
readonly property bool hovered: hover.hovered
HoverHandler { id: hover }
GlassPill { anchors.fill: parent; visible: TrayService.options.background === "pill" }
GlassPill { anchors.fill: parent; visible: TrayService.options.background === "pill" && root.entry.bare !== true }
Row {
id: row; anchors.centerIn: parent; spacing: TrayService.options.spacing
Repeater {