From 4b62a1f29df15bae4605150b69b93879b49c5fd7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 04:48:28 +0000 Subject: [PATCH] Add battery percentage display next to clock and date - Add PowerStatus NuGet package (v1.0.3) - Add UseBattery setting to Settings.cs - Add BatteryText property and update periodic timer in MainViewModel - Add BatteryBox TextBlock to ClockPanel in MainWindow.xaml - Add BaseBatteryBox and BatteryBox styles to Base.xaml and all theme files - Add UseBattery toggle and preview to SettingsPaneTheme - Add Battery localization string to en.xaml Co-authored-by: Jack251970 <53996452+Jack251970@users.noreply.github.com> --- .../UserSettings/Settings.cs | 1 + Flow.Launcher/Flow.Launcher.csproj | 2 +- Flow.Launcher/Languages/en.xaml | 1 + Flow.Launcher/MainWindow.xaml | 5 +++++ .../ViewModels/SettingsPaneThemeViewModel.cs | 8 ++++++++ .../SettingPages/Views/SettingsPaneTheme.xaml | 17 +++++++++++++++++ Flow.Launcher/Themes/Base.xaml | 19 +++++++++++++++++++ Flow.Launcher/Themes/BlurBlack Darker.xaml | 7 +++++++ Flow.Launcher/Themes/BlurWhite.xaml | 7 +++++++ Flow.Launcher/Themes/Circle System.xaml | 6 ++++++ Flow.Launcher/Themes/Cyan Dark.xaml | 6 ++++++ Flow.Launcher/Themes/Darker Glass.xaml | 6 ++++++ Flow.Launcher/Themes/Discord Dark.xaml | 6 ++++++ Flow.Launcher/Themes/Dracula.xaml | 6 ++++++ Flow.Launcher/Themes/Gray.xaml | 6 ++++++ Flow.Launcher/Themes/League.xaml | 6 ++++++ Flow.Launcher/Themes/Midnight.xaml | 6 ++++++ Flow.Launcher/Themes/Nord Darker.xaml | 6 ++++++ Flow.Launcher/Themes/Pink.xaml | 7 +++++++ Flow.Launcher/Themes/SlimLight.xaml | 13 +++++++++++++ Flow.Launcher/Themes/Sublime.xaml | 6 ++++++ Flow.Launcher/Themes/Ubuntu.xaml | 6 ++++++ Flow.Launcher/Themes/Win10System.xaml | 6 ++++++ Flow.Launcher/Themes/Win11Light.xaml | 6 ++++++ Flow.Launcher/ViewModel/MainViewModel.cs | 11 +++++++++++ Flow.Launcher/packages.lock.json | 10 ++++++++-- 26 files changed, 183 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 7524d6c1a..b9f638957 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -165,6 +165,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool UseClock { get; set; } = true; public bool UseDate { get; set; } = false; + public bool UseBattery { get; set; } = false; public string TimeFormat { get; set; } = "hh:mm tt"; public string DateFormat { get; set; } = "MM'/'dd ddd"; public bool FirstLaunch { get; set; } = true; diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index a029128cb..244e61216 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -109,7 +109,7 @@ - + all diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 1b2b01ef8..e4a8d4fe7 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -328,6 +328,7 @@ Custom Clock Date + Battery Backdrop Type The backdrop effect is not applied in the preview. Backdrop supported starting from Windows 11 build 22000 and above diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 747975b2a..745e8f1ff 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -311,6 +311,11 @@ Style="{DynamicResource DateBox}" Text="{Binding DateText}" Visibility="{Binding Settings.UseDate, Converter={StaticResource BoolToVisibilityConverter}}" /> + diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index f69774e8e..0a7e65e70 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -296,6 +296,14 @@ public partial class SettingsPaneThemeViewModel : BaseModel set => Settings.UseDate = value; } + public bool UseBattery + { + get => Settings.UseBattery; + set => Settings.UseBattery = value; + } + + public string BatteryText => "75%"; + public FontFamily ClockPanelFont { get; } public Brush PreviewBackground diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index 20b8dfb9c..8eac1abe1 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -348,6 +348,12 @@ Style="{DynamicResource DateBox}" Text="{Binding DateText}" Visibility="{Binding UseDate, Converter={StaticResource BoolToVisibilityConverter}}" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + +