fade in/out for dynamic modules, fix tray icon theming

This commit is contained in:
Damocles 2026-04-12 17:28:03 +02:00
parent d0f7c0872a
commit 4109078a91
6 changed files with 17 additions and 7 deletions

View file

@ -5,7 +5,8 @@ import "." as M
M.BarSection { M.BarSection {
id: root id: root
spacing: M.Theme.moduleSpacing spacing: M.Theme.moduleSpacing
visible: M.Modules.backlight && percent > 0 opacity: M.Modules.backlight && percent > 0 ? 1 : 0
visible: opacity > 0
tooltip: "Brightness: " + root.percent + "%" tooltip: "Brightness: " + root.percent + "%"
property int percent: 0 property int percent: 0

View file

@ -8,6 +8,8 @@ Row {
property string tooltip: "" property string tooltip: ""
property bool _hovered: false property bool _hovered: false
Behavior on opacity { NumberAnimation { duration: 150 } }
layer.enabled: _hovered layer.enabled: _hovered
layer.effect: MultiEffect { layer.effect: MultiEffect {
shadowEnabled: true shadowEnabled: true

View file

@ -6,7 +6,8 @@ import "." as M
M.BarSection { M.BarSection {
id: root id: root
spacing: M.Theme.moduleSpacing spacing: M.Theme.moduleSpacing
visible: M.Modules.battery && (UPower.displayDevice?.isLaptopBattery ?? false) opacity: M.Modules.battery && (UPower.displayDevice?.isLaptopBattery ?? false) ? 1 : 0
visible: opacity > 0
tooltip: { tooltip: {
const state = root.charging ? "Charging" : "Discharging"; const state = root.charging ? "Charging" : "Discharging";
const t = root.charging ? root.dev?.timeToFull : root.dev?.timeToEmpty; const t = root.charging ? root.dev?.timeToFull : root.dev?.timeToEmpty;

View file

@ -5,7 +5,8 @@ import "." as M
M.BarSection { M.BarSection {
id: root id: root
spacing: M.Theme.moduleSpacing spacing: M.Theme.moduleSpacing
visible: M.Modules.bluetooth && root.state !== "unavailable" opacity: M.Modules.bluetooth && root.state !== "unavailable" ? 1 : 0
visible: opacity > 0
tooltip: { tooltip: {
if (root.state === "off") if (root.state === "off")
return "Bluetooth: off"; return "Bluetooth: off";

View file

@ -5,7 +5,8 @@ import "." as M
M.BarSection { M.BarSection {
id: root id: root
spacing: M.Theme.moduleSpacing spacing: M.Theme.moduleSpacing
visible: M.Modules.mpris && player !== null opacity: M.Modules.mpris && player !== null ? 1 : 0
visible: opacity > 0
tooltip: { tooltip: {
const p = root.player; const p = root.player;
if (!p) if (!p)

View file

@ -34,10 +34,8 @@ RowLayout {
onRunningChanged: if (!running) iconItem._pulseOpacity = 1 onRunningChanged: if (!running) iconItem._pulseOpacity = 1
} }
M.ThemedIcon { Item {
anchors.fill: parent anchors.fill: parent
source: iconItem.modelData.icon
tint: iconItem._needsAttention ? M.Theme.base08 : M.Theme.base0D
opacity: iconItem._pulseOpacity opacity: iconItem._pulseOpacity
layer.enabled: iconItem._needsAttention layer.enabled: iconItem._needsAttention
@ -48,6 +46,12 @@ RowLayout {
shadowVerticalOffset: 0 shadowVerticalOffset: 0
shadowHorizontalOffset: 0 shadowHorizontalOffset: 0
} }
M.ThemedIcon {
anchors.fill: parent
source: iconItem.modelData.icon
tint: iconItem._needsAttention ? M.Theme.base08 : M.Theme.base0D
}
} }
HoverHandler { HoverHandler {