From f17bdd75600c180f1736252fa21b579eb6cc1f8a Mon Sep 17 00:00:00 2001 From: Daniel Chalmers Date: Wed, 4 Nov 2026 13:44:54 -0600 Subject: [PATCH] Add Fluent menu and tooltip styles with high contrast support - Port DesktopClock's Fluent styles for the context menu and tooltips - Move theme colors into Light, Dark and HighContrast palettes that ThemeService swaps - In Auto, use Windows' own accent shades: Light3 in Dark mode and Dark2 in Light mode - Use system colors while high contrast is on, and follow changes live --- Network Monitor/App.xaml | 10 +- Network Monitor/App.xaml.cs | 4 + Network Monitor/MainWindow.xaml | 47 +-- Network Monitor/MonitorView.xaml | 2 +- Network Monitor/Monitors/Monitor.cs | 29 +- Network Monitor/ThemeService.cs | 76 ++++- Network Monitor/Themes/DarkPalette.xaml | 26 ++ Network Monitor/Themes/FluentTheme.xaml | 304 ++++++++++++++++++ .../Themes/HighContrastPalette.xaml | 49 +++ Network Monitor/Themes/LightPalette.xaml | 26 ++ README.md | 1 + 11 files changed, 505 insertions(+), 69 deletions(-) create mode 100644 Network Monitor/Themes/DarkPalette.xaml create mode 100644 Network Monitor/Themes/FluentTheme.xaml create mode 100644 Network Monitor/Themes/HighContrastPalette.xaml create mode 100644 Network Monitor/Themes/LightPalette.xaml diff --git a/Network Monitor/App.xaml b/Network Monitor/App.xaml index 90b3aaa..0aee4de 100644 --- a/Network Monitor/App.xaml +++ b/Network Monitor/App.xaml @@ -1,5 +1,13 @@  - + + + + + + + + + \ No newline at end of file diff --git a/Network Monitor/App.xaml.cs b/Network Monitor/App.xaml.cs index 1fb8a8b..317c550 100644 --- a/Network Monitor/App.xaml.cs +++ b/Network Monitor/App.xaml.cs @@ -50,6 +50,10 @@ protected override void OnStartup(StartupEventArgs e) } SettingsSaver.Start(); + + // The palette for the theme goes in before the window is created, so the widget never shows the light one first. + _ = ThemeService.Instance; + RepairStartup(); var window = new MainWindow(); diff --git a/Network Monitor/MainWindow.xaml b/Network Monitor/MainWindow.xaml index d8bc83c..fed7013 100644 --- a/Network Monitor/MainWindow.xaml +++ b/Network Monitor/MainWindow.xaml @@ -18,6 +18,7 @@ Background="Transparent" UseLayoutRounding="True" FontFamily="Consolas" + Foreground="{DynamicResource WidgetTextBrush}" MouseDown="MainWindow_OnMouseDown" SizeChanged="Window_SizeChanged" ContentRendered="Window_ContentRendered" @@ -28,27 +29,6 @@ - - - @@ -139,29 +119,8 @@ - - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Network Monitor/Themes/HighContrastPalette.xaml b/Network Monitor/Themes/HighContrastPalette.xaml new file mode 100644 index 0000000..2435a88 --- /dev/null +++ b/Network Monitor/Themes/HighContrastPalette.xaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Network Monitor/Themes/LightPalette.xaml b/Network Monitor/Themes/LightPalette.xaml new file mode 100644 index 0000000..e381746 --- /dev/null +++ b/Network Monitor/Themes/LightPalette.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index c66c8eb..9bf3b00 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Hover for a 60-second sparkline and the stats behind it: min/avg/max, jitter, pa - **Bits or bytes:** switch between Mbps and MB/s; units auto-scale from K to T as traffic changes. - **Vertical or horizontal:** a slim column or a wide strip, so it fits any edge of your screen. - **Light, dark, or auto:** pick a theme, or let Auto follow the Windows light/dark mode and accent color. +- **Fits in on Windows 11:** Fluent menus and tooltips, readable accent shades, and high contrast support. - **Resize instantly:** drag the size slider, or hold **Ctrl** and scroll over the widget to scale it. - **Stays where you want:** keep it on top of other windows, drag it anywhere, and it remembers where you left it. - **Hides for fullscreen apps:** steps aside while a game, video, or slideshow fills its monitor (on by default).