feat(battery): add option to show charge percentage next to the icon (#994)

* feat(battery): add option to show charge percentage next to the icon

* feat: proper padding and text sizing

* chore: use from_vec instead of from_children

* chore: remove battery percentage setting from applet dropdown

* chore: move config config definition to cosmic-applets-config

* feat: add subscription for config

* chore: revert unnecessary config module change

* fix: correctly scale battery icon size

* chore: change battery applet id

* feat: better battery text sizing

---------

Co-authored-by: Levi Portenier <levi@system76.com>
This commit is contained in:
Ilya Zlobintsev 2026-02-02 23:47:38 +02:00 committed by GitHub
parent fe2ebe7a89
commit a1a6caf5e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 106 additions and 10 deletions

View file

@ -0,0 +1,11 @@
// Copyright 2026 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only
use cosmic_config::{CosmicConfigEntry, cosmic_config_derive::CosmicConfigEntry};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, CosmicConfigEntry, Default)]
#[version = 1]
pub struct BatteryAppletConfig {
pub show_percentage: bool,
}

View file

@ -1 +1,2 @@
pub mod battery;
pub mod time;