diff options
author | Pierre Ossman <ossman@cendio.se> | 2022-01-14 19:51:47 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-07-14 14:17:30 +0200 |
commit | 723715cb10cc66d0e3343c3bbe3f3d3cb6f15b34 (patch) | |
tree | 4d99bbf4deb4ca2149424eb27dc2a8146d1bf3a5 /vncviewer | |
parent | efbe273c11e0b236f03e095c7701172148d909e8 (diff) | |
download | tigervnc-723715cb10cc66d0e3343c3bbe3f3d3cb6f15b34.tar.gz tigervnc-723715cb10cc66d0e3343c3bbe3f3d3cb6f15b34.zip |
Use modern UI colors
Follow the colors that modern desktops use when it comes to background,
text and selections.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/fltk/theme.cxx | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/vncviewer/fltk/theme.cxx b/vncviewer/fltk/theme.cxx index 2c45c734..f89933a3 100644 --- a/vncviewer/fltk/theme.cxx +++ b/vncviewer/fltk/theme.cxx @@ -225,15 +225,43 @@ void init_theme() // Basic text size (10pt @ 96 dpi => 13px) FL_NORMAL_SIZE = 13; - // Select a background color that looks somewhat close to modern - // systems - Fl::background(220, 220, 220); + // Modern colors based on the default appearance of Windows 11, + // macOS 12 and GNOME 41 - // macOS has a slightly brighter default background though -#ifdef __APPLE__ - Fl::background(240, 240, 240); + // FIXME: Should get these from the system, + // Fl::get_system_colors() is unfortunately not very capable + // FIXME: Should also handle dark mode + +#if defined(WIN32) + // Windows 11 + Fl::foreground(26, 26, 26); + Fl::background(243, 243, 243); +#elif defined(__APPLE__) + // FIXME: Text is rendered slightly lighter than what we specify here + // for some odd reason. The target is (38, 38, 38). + Fl::foreground(28, 28, 28); + Fl::background(246, 246, 246); +#else + // GNOME + Fl::foreground(46, 52, 54); + Fl::background(246, 245, 244); #endif +#if defined(WIN32) + // Windows 11 default accent color + Fl::set_color(FL_SELECTION_COLOR, 0, 103, 192); +#elif defined(__APPLE__) + Fl::set_color(FL_SELECTION_COLOR, 0, 122, 255); +#else + // GNOME + Fl::set_color(FL_SELECTION_COLOR, 53, 132, 228); +#endif + + // The arrow on Fl_Return_Button gets a invisible, so let's adjust it + // to compensate for our lighter buttons + Fl::set_color(FL_LIGHT3, light_border(fl_color_average(FL_WHITE, FL_BACKGROUND_COLOR, 0.5))); + Fl::set_color(FL_DARK3, dark_border(fl_color_average(FL_WHITE, FL_BACKGROUND_COLOR, 0.5))); + // We will override the box types later, but changing scheme affects // more things than just those, so we still want to switch from the // default |