Icons: Brightness and battery

This commit is contained in:
LemmyCook 2025-09-08 15:53:50 -04:00
parent 404a1d3e8b
commit ea6b8e0c02
18 changed files with 36 additions and 66 deletions

View file

@ -39,7 +39,7 @@ Item {
// Test mode
readonly property bool testMode: false
readonly property int testPercent: 50
readonly property bool testCharging: true
readonly property bool testCharging: false
// Main properties
readonly property var battery: UPower.displayDevice
@ -87,8 +87,7 @@ Item {
rightOpen: BarWidgetRegistry.getNPillDirection(root)
icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent,
charging, isReady)
iconRotation: -90
text: ((isReady && battery.isLaptopBattery) || testMode) ? Math.round(percent) + "%" : "-"
text: (isReady || testMode) ? Math.round(percent) + "%" : "-"
textColor: charging ? Color.mPrimary : Color.mOnSurface
iconCircleColor: Color.mPrimary
collapsedIconColor: Color.mOnSurface

View file

@ -46,8 +46,7 @@ Item {
function getIcon() {
var monitor = getMonitor()
var brightness = monitor ? monitor.brightness : 0
return brightness <= 0 ? "brightness_1" : brightness < 0.33 ? "brightness_low" : brightness
< 0.66 ? "brightness_medium" : "brightness_high"
return brightness <= 0.5 ? FontService.icons["brightness_low"] : FontService.icons["brightness_high"]
}
// Connection used to open the pill when brightness changes

View file

@ -328,7 +328,7 @@ Loader {
width: 100 * scaling
height: 100 * scaling
imagePath: Settings.data.general.avatarImage
fallbackIcon: "person"
fallbackIcon: FontService.icons["person"]
}
MouseArea {

View file

@ -85,7 +85,7 @@ NBox {
}
NIconButton {
icon: "add"
icon: FontService.icons["add"]
colorBg: Color.mPrimary
colorFg: Color.mOnPrimary

View file

@ -120,7 +120,7 @@ Popup {
NButton {
text: "Apply"
icon: "check"
icon: FontService.icons["check"]
onClicked: {
if (settingsLoader.item && settingsLoader.item.saveSettings) {
var newSettings = settingsLoader.item.saveSettings()

View file

@ -59,7 +59,7 @@ ColumnLayout {
NToggle {
id: showMemoryAsPercent
Layout.fillWidth: true
label: "Show memory as percentage"
label: "Memory as percentage"
checked: valueShowMemoryAsPercent
onToggled: checked => valueShowMemoryAsPercent = checked
}

View file

@ -163,7 +163,7 @@ NPanel {
}, {
"id": SettingsPanel.Tab.ColorScheme,
"label": "Color Scheme",
"icon": "paint_bucket",
"icon": "paint_drop",
"source": colorSchemeTab
}, {
"id": SettingsPanel.Tab.Wallpaper,
@ -190,7 +190,7 @@ NPanel {
}, {
"id": SettingsPanel.Tab.Hooks,
"label": "Hooks",
"icon": "cable",
"icon": "link",
"source": hooksTab
}, {
"id": SettingsPanel.Tab.About,

View file

@ -172,7 +172,7 @@ ColumnLayout {
imagePath: modelData.avatar_url || ""
anchors.fill: parent
anchors.margins: Style.marginXS * scaling
fallbackIcon: "person"
fallbackIcon: FontService.icons["person"]
borderColor: contributorArea.containsMouse ? Color.mOnTertiary : Color.mPrimary
borderWidth: Math.max(1, Style.borderM * scaling)

View file

@ -272,7 +272,7 @@ ColumnLayout {
// Button aligned to the center of the actual input field
NIconButton {
icon: "add"
icon: FontService.icons["add"]
Layout.alignment: Qt.AlignBottom
Layout.bottomMargin: blacklistInput.description ? Style.marginS * scaling : 0
onClicked: {

View file

@ -19,7 +19,7 @@ ColumnLayout {
width: 108 * scaling
height: 108 * scaling
imagePath: Settings.data.general.avatarImage
fallbackIcon: "person"
fallbackIcon: FontService.icons["person"]
borderColor: Color.mPrimary
borderWidth: Math.max(1, Style.borderM * scaling)
Layout.alignment: Qt.AlignTop

View file

@ -59,7 +59,7 @@ ColumnLayout {
anchors.fill: parent
anchors.margins: Style.marginXS * scaling
imagePath: currentWallpaper
fallbackIcon: "image"
fallbackIcon: FontService.icons["image"]
imageRadius: Style.radiusM * scaling
borderColor: Color.mSecondary
borderWidth: Style.borderL * 2 * scaling

View file

@ -162,7 +162,7 @@ NBox {
anchors.fill: parent
anchors.margins: Style.marginXS * scaling
imagePath: MediaService.trackArtUrl
fallbackIcon: "music_note"
fallbackIcon: FontService.icons["vinyl"]
borderColor: Color.mOutline
borderWidth: Math.max(1, Style.borderS * scaling)
}
@ -307,7 +307,7 @@ NBox {
// Previous button
NIconButton {
icon: "skip_previous"
icon: FontService.icons["previous"]
tooltipText: "Previous Media"
visible: MediaService.canGoPrevious
onClicked: MediaService.canGoPrevious ? MediaService.previous() : {}
@ -323,7 +323,7 @@ NBox {
// Next button
NIconButton {
icon: "skip_next"
icon: FontService.icons["next"]
tooltipText: "Next media"
visible: MediaService.canGoNext
onClicked: MediaService.canGoNext ? MediaService.next() : {}

View file

@ -32,7 +32,7 @@ NBox {
width: Style.baseWidgetSize * 1.25 * scaling
height: Style.baseWidgetSize * 1.25 * scaling
imagePath: Settings.data.general.avatarImage
fallbackIcon: "person"
fallbackIcon: FontService.icons["person"]
borderColor: Color.mPrimary
borderWidth: Math.max(1, Style.borderM * scaling)
}