extract constants

This commit is contained in:
Damocles 2026-04-12 10:57:48 +02:00
parent bc3a85d18d
commit b969f0824f
22 changed files with 106 additions and 63 deletions

View file

@ -4,11 +4,13 @@ import "." as M
M.BarSection {
id: root
spacing: 4
spacing: M.Theme.moduleSpacing
tooltip: {
const parts = [root.count + " notification" + (root.count !== 1 ? "s" : "")];
if (root.dnd) parts.push("Do not disturb");
if (root.inhibited) parts.push("Inhibited");
if (root.dnd)
parts.push("Do not disturb");
if (root.inhibited)
parts.push("Inhibited");
return parts.join("\n");
}
@ -36,8 +38,10 @@ M.BarSection {
M.BarIcon {
icon: {
if (root.inhibited) return root.count > 0 ? "\uDB80\uDC9B" : "\uDB82\uDE91";
if (root.dnd) return root.count > 0 ? "\uDB80\uDCA0" : "\uDB82\uDE93";
if (root.inhibited)
return root.count > 0 ? "\uDB80\uDC9B" : "\uDB82\uDE91";
if (root.dnd)
return root.count > 0 ? "\uDB80\uDCA0" : "\uDB82\uDE93";
return root.count > 0 ? "\uDB84\uDD6B" : "\uDB80\uDC9C";
}
anchors.verticalCenter: parent.verticalCenter
@ -61,5 +65,7 @@ M.BarSection {
clicker.running = true;
}
}
Process { id: clicker }
Process {
id: clicker
}
}