This is an automated email from the ASF dual-hosted git repository.

leginee pushed a commit to branch mac-vcl-button-contrast
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 42b516eca560342ce440a2d9e7b65663fa2e0eb8
Author: peter kovacs <[email protected]>
AuthorDate: Thu Sep 10 05:02:49 2026 +0200

    framework: give the Start Center its own dark image set
    
    The Start Center paints a white card as its background and only ever had a
    second image set for high contrast mode, so on a dark desktop theme it drew
    a white rectangle into an otherwise dark UI.
    
    Add RES_BACKING_IMAGES_DARK rather than reusing the high contrast set. The
    two are not the same thing: the HC card is pure black for maximum contrast,
    which sits badly next to a system window background that is not black. The
    new art is the same card retoned from #000000 to #1E1E1E, keeping the logo
    and leaving the drop shadow alone - the shadow is black with partial alpha,
    so retoning it as well would have turned it into a grey halo. The icons are
    shared with the HC set, being already light-on-dark.
    
    Note this is inert on macOS while the application is pinned to the light
    appearance; it applies to dark desktop themes on the other platforms, and to
    high contrast everywhere.
    
    The condition is a local face-colour luminance test, which is a placeholder:
    deciding what "dark" means belongs in a general theme concept in VCL, not
    here. When that lands this is the single call site to redirect.
    
    Adding artwork also needs a forced rebuild - packimages' images.zip rule
    depends only on commandimagelist.ilst, so a new image is otherwise packaged
    silently as nothing at all. See .agent/mac-silicon-port.md.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
---
 main/default_images/framework/res/backing_dark.png | Bin 0 -> 12729 bytes
 .../framework/res/backing_right_dark.png           | Bin 0 -> 6817 bytes
 .../framework/res/backing_rtl_left_dark.png        | Bin 0 -> 10963 bytes
 .../framework/res/backing_rtl_right_dark.png       | Bin 0 -> 6817 bytes
 .../framework/res/backing_space_dark.png           | Bin 0 -> 253 bytes
 main/framework/inc/framework.hrc                   |   1 +
 main/framework/source/services/backingwindow.cxx   |  18 ++++-
 main/framework/source/services/fwk_services.src    |  75 +++++++++++++++++++++
 8 files changed, 92 insertions(+), 2 deletions(-)

diff --git a/main/default_images/framework/res/backing_dark.png 
b/main/default_images/framework/res/backing_dark.png
new file mode 100644
index 0000000000..1531afdc89
Binary files /dev/null and b/main/default_images/framework/res/backing_dark.png 
differ
diff --git a/main/default_images/framework/res/backing_right_dark.png 
b/main/default_images/framework/res/backing_right_dark.png
new file mode 100644
index 0000000000..78d9d156f0
Binary files /dev/null and 
b/main/default_images/framework/res/backing_right_dark.png differ
diff --git a/main/default_images/framework/res/backing_rtl_left_dark.png 
b/main/default_images/framework/res/backing_rtl_left_dark.png
new file mode 100644
index 0000000000..2a5e52b886
Binary files /dev/null and 
b/main/default_images/framework/res/backing_rtl_left_dark.png differ
diff --git a/main/default_images/framework/res/backing_rtl_right_dark.png 
b/main/default_images/framework/res/backing_rtl_right_dark.png
new file mode 100644
index 0000000000..78d9d156f0
Binary files /dev/null and 
b/main/default_images/framework/res/backing_rtl_right_dark.png differ
diff --git a/main/default_images/framework/res/backing_space_dark.png 
b/main/default_images/framework/res/backing_space_dark.png
new file mode 100644
index 0000000000..04e6a7bbac
Binary files /dev/null and 
b/main/default_images/framework/res/backing_space_dark.png differ
diff --git a/main/framework/inc/framework.hrc b/main/framework/inc/framework.hrc
index f197eac6fd..bb5f30f786 100644
--- a/main/framework/inc/framework.hrc
+++ b/main/framework/inc/framework.hrc
@@ -54,6 +54,7 @@
 
 #define RES_BACKING_IMAGES                  (DLG_BACKING+1)
 #define RES_BACKING_IMAGES_HC               (DLG_BACKING+2)
+#define RES_BACKING_IMAGES_DARK             (DLG_BACKING+3)
 
 #define BMP_BACKING_BACKGROUND_LEFT         1
 #define BMP_BACKING_BACKGROUND_MIDDLE       2
diff --git a/main/framework/source/services/backingwindow.cxx 
b/main/framework/source/services/backingwindow.cxx
index d898ea2deb..b5333d7d01 100644
--- a/main/framework/source/services/backingwindow.cxx
+++ b/main/framework/source/services/backingwindow.cxx
@@ -350,7 +350,19 @@ void BackingWindow::initBackground()
 {
     SetBackground();
 
-    bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode();
+    // The dark image set was only ever reachable through high contrast mode, 
so
+    // on a dark desktop theme the Start Center painted its white card into an
+    // otherwise dark UI. Treat a dark face color the same way: the 
backing_*_hc
+    // images are a black version of the same card, which is what is wanted 
here
+    // even though nothing about the desktop is "high contrast".
+    const StyleSettings& rBackingStyle = GetSettings().GetStyleSettings();
+    const bool bHighContrast = rBackingStyle.GetHighContrastMode();
+    // A dark desktop theme is not high contrast, but the light card would be a
+    // white rectangle in an otherwise dark UI. It gets its own image set 
rather
+    // than borrowing the accessibility one, so the card tone can match the
+    // system window background.
+    const bool bDarkTheme = !bHighContrast && 
rBackingStyle.GetFaceColor().IsDark();
+    bool bDark = bHighContrast || bDarkTheme;
     if( bDark )
         maWelcomeTextColor = maLabelTextColor = Color( COL_WHITE );
     else if( mnLayoutStyle == 1 )
@@ -361,7 +373,9 @@ void BackingWindow::initBackground()
     Color aTextBGColor( bDark ? COL_BLACK : COL_WHITE );
 
     // select image set
-    ImageContainerRes aRes( FwkResId( bDark ? RES_BACKING_IMAGES_HC : 
RES_BACKING_IMAGES ) );
+    ImageContainerRes aRes( FwkResId( bHighContrast ? RES_BACKING_IMAGES_HC :
+                                      bDarkTheme    ? RES_BACKING_IMAGES_DARK :
+                                                      RES_BACKING_IMAGES ) );
 
     // scale middle segment
     Size aMiddleSize;
diff --git a/main/framework/source/services/fwk_services.src 
b/main/framework/source/services/fwk_services.src
index 698114368a..daec8d78a3 100644
--- a/main/framework/source/services/fwk_services.src
+++ b/main/framework/source/services/fwk_services.src
@@ -209,6 +209,81 @@ Resource RES_BACKING_IMAGES_HC
        };
 };
 
+// Dark (but not high contrast) desktop themes. Same artwork as the HC set with
+// the card body retoned from pure black to #1E1E1E so it sits correctly next 
to
+// a macOS dark window background; the icons are shared with the HC set.
+Resource RES_BACKING_IMAGES_DARK
+{
+       Bitmap BMP_BACKING_BACKGROUND_LEFT
+       {
+               File = "backing_dark.png" ;
+       };
+       Bitmap BMP_BACKING_BACKGROUND_MIDDLE
+       {
+               File = "backing_space_dark.png" ;
+       };
+       Bitmap BMP_BACKING_BACKGROUND_RIGHT
+       {
+               File = "backing_right_dark.png" ;
+       };
+       Bitmap BMP_BACKING_BACKGROUND_RTL_LEFT
+       {
+               File = "backing_rtl_left_dark.png" ;
+       };
+       Bitmap BMP_BACKING_BACKGROUND_RTL_RIGHT
+       {
+               File = "backing_rtl_right_dark.png" ;
+       };
+       Bitmap BMP_BACKING_EXT
+       {
+               File = "extension_32_hc.png" ;
+       };
+//     Bitmap BMP_BACKING_REG
+//     {
+//             File = "register_32_hc.png" ;
+//     };
+       Bitmap BMP_BACKING_INFO
+       {
+               File = "info_32_hc.png" ;
+       };
+       Bitmap BMP_BACKING_TPLREP
+       {
+               File = "addtemplate_32_hc.png" ;
+       };
+       Bitmap BMP_BACKING_WRITER
+       {
+               File = "odt_32_hc.png" ;
+       };
+       Bitmap BMP_BACKING_CALC
+       {
+               File = "ods_32_hc.png" ;
+       };
+       Bitmap BMP_BACKING_IMPRESS
+       {
+               File = "odp_32_hc.png" ;
+       };
+       Bitmap BMP_BACKING_DRAW
+       {
+               File = "odg_32_hc.png" ;
+       };
+       Bitmap BMP_BACKING_DATABASE
+       {
+               File = "odb_32_hc.png" ;
+       };
+       Bitmap BMP_BACKING_FORMULA
+       {
+               File = "odf_32_hc.png" ;
+       };
+       Bitmap BMP_BACKING_OPENFILE
+       {
+               File = "folder_32_hc.png" ;
+       };
+       Bitmap BMP_BACKING_OPENTEMPLATE
+       {
+               File = "templates_32_hc.png" ;
+       };
+};
+
 Window WIN_TABWINDOW
 {
        OutputSize = TRUE ;

Reply via email to