extract constants
This commit is contained in:
parent
bc3a85d18d
commit
b969f0824f
22 changed files with 106 additions and 63 deletions
|
|
@ -4,7 +4,7 @@ import "." as M
|
|||
|
||||
M.BarSection {
|
||||
id: root
|
||||
spacing: 4
|
||||
spacing: M.Theme.moduleSpacing
|
||||
visible: UPower.displayDevice?.isLaptopBattery ?? false
|
||||
tooltip: {
|
||||
const state = root.charging ? "Charging" : "Discharging";
|
||||
|
|
@ -20,7 +20,8 @@ M.BarSection {
|
|||
|
||||
M.BarIcon {
|
||||
icon: {
|
||||
if (root.charging) return "\uDB80\uDC84";
|
||||
if (root.charging)
|
||||
return "\uDB80\uDC84";
|
||||
const icons = ["\uDB80\uDC8E", "\uDB80\uDC7A", "\uDB80\uDC7B", "\uDB80\uDC7C", "\uDB80\uDC7D", "\uDB80\uDC7E", "\uDB80\uDC7F", "\uDB80\uDC80", "\uDB80\uDC81", "\uDB80\uDC82", "\uDB85\uDFE2"];
|
||||
return icons[Math.min(10, Math.floor(root.pct / 10))];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue