Bug 167476 - The button selection for the border presets are 'invisible' in Dark-Mode
Summary: The button selection for the border presets are 'invisible' in Dark-Mode
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium enhancement
Assignee: Michael Weghorn
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: Vertical-Tab-dialogs
  Show dependency treegraph
 
Reported: 2025-07-12 12:16 UTC by Telesto
Modified: 2025-07-31 08:32 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot (6.78 KB, image/jpeg)
2025-07-12 12:16 UTC, Telesto
Details
on 2025-07-12 nightly, Win11 in 'Dark' color sense. LO appearance theme not enabled. (60.98 KB, image/png)
2025-07-12 13:13 UTC, V Stuart Foote
Details
Screenshot (10.92 KB, image/jpeg)
2025-07-12 14:13 UTC, Telesto
Details
Screenshot with gtk3 VCL plugin on Linux and dark mode (49.27 KB, image/png)
2025-07-21 09:38 UTC, Michael Weghorn
Details
Screenshot with gtk3 VCL plugin, dark mode, with https://gerrit.libreoffice.org/c/core/+/188138 (PS1) (49.52 KB, image/png)
2025-07-22 07:23 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2025-07-12 12:16:14 UTC
Description:
The borders in the border presets are 'invisible' in Dark-Mode

Steps to Reproduce:
1. Open Writer in 'Dark-Mode'
2. Format -> Page Style -> Borders Tab 

Actual Results:
The borders in can't be seen in the border presets

Expected Results:
You should be able to see the borders, instead of relying on the label. Compare Light-Mode


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bd339e1937d12cf7f62276e537bca96e01ef8ae4
CPU threads: 4; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 1 Telesto 2025-07-12 12:16:57 UTC
Created attachment 201765 [details]
Screenshot
Comment 2 Jussi Suominen 2025-07-12 12:51:15 UTC
Thank you for reporting the bug. I can confirm that the bug is present in the master build: 

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 10850b9ea91807c4f8464e42fee7f33b7c389a77
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: CL threaded

However I was unable to reproduce the bug in the stable build:

Version: 25.2.4.3 (X86_64) / LibreOffice Community
Build ID: 33e196637044ead23f5c3226cde09b47731f7e27
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Vulkan; VCL: win
Locale: fi-FI (fi_FI); UI: en-GB
Calc: CL threaded
Comment 3 V Stuart Foote 2025-07-12 13:13:01 UTC
Created attachment 201771 [details]
on 2025-07-12 nightly, Win11 in 'Dark' color sense. LO appearance theme not enabled.

Can't reproduce this either

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e38d4e8cf2b1a1b5c146acbe325d31f84da676b0
CPU threads: 28; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 4 V Stuart Foote 2025-07-12 13:17:13 UTC
Specific preset selected is not highlighted, but the actual borders applied are visible. In attachment 201771 [details] the 'All borders' button had been selected.

Is the issue that you can't identify the selected border preset? I see condition of attachment 201765 [details] when I've selected 'No borders' (the first preset button).
Comment 5 Telesto 2025-07-12 14:13:37 UTC
Created attachment 201772 [details]
Screenshot

The preset buttons itself show which borders will be activated. It's easy to see in Light Mode. Nearly impossible in Dark-Mode

So I'm not talking about the large preview after selecting preset.
Comment 6 V Stuart Foote 2025-07-12 15:23:37 UTC
(In reply to Telesto from comment #5)
> Created attachment 201772 [details]
> Screenshot
> 
> The preset buttons itself show which borders will be activated. It's easy to
> see in Light Mode. Nearly impossible in Dark-Mode
> 
> So I'm not talking about the large preview after selecting preset.

OK, so agree there is a UX design issue with the Line Arrangement 'Presets:' widgets. For bug 167279 an accessible event focus was recently tweaked.

With os/DE Automatic theme in a Dark sense, it is difficult to identify the preset button that has been selected. The selected button does get an outline border when selected, but very thin and in Dark sense almost invisible.

Not sure it can be done, but on the same Page Style panel the 'Shadow Style' gets a button outline. And when Tools -> Options -> Appearance 'Enable application theming' is checked enabled the button outline will respond to the application theme's Accent Color as set (rather than os/DE provided color).

So an enhancement might be to use the same button outline for the preset button with active selection. It might be a problem as the presets now trigger change in the border preview widget, don't think that feature should be dropped.
Comment 7 V Stuart Foote 2025-07-12 15:25:24 UTC
(In reply to V Stuart Foote from comment #6)

Should have noted that this is an existing UI issue, and was not caused in anyway by work on bug 167279
Comment 8 Michael Weghorn 2025-07-21 09:38:23 UTC
Created attachment 201917 [details]
Screenshot with gtk3 VCL plugin on Linux and dark mode
Comment 9 Michael Weghorn 2025-07-21 09:48:54 UTC
(In reply to V Stuart Foote from comment #6)
> Not sure it can be done, but on the same Page Style panel the 'Shadow Style'
> gets a button outline. And when Tools -> Options -> Appearance 'Enable
> application theming' is checked enabled the button outline will respond to
> the application theme's Accent Color as set (rather than os/DE provided
> color).
> 
> So an enhancement might be to use the same button outline for the preset
> button with active selection. It might be a problem as the presets now
> trigger change in the border preview widget, don't think that feature should
> be dropped.

As far as I understand it from looking into the code a bit, the current logic for the "Presets" control (a ValueSet, like the "Position" one in the "Shadow Style" section) is that it doesn't have a real permanent selection state beyond the point in time when it has focus. I.e. it is (currently) primarily meant to be used to allow a one-time selection of borders that can then be tweaked later on, by clicking in the "User-defined" control below. But the preset used to initialize those borders is then (more or less) discarded and the borders shown in the "User-defined" control are used from that point on to manage state. (Adding or removing a border in that "User-defined" control would invalidate any preset previously selected.)

There is an explicit call to `m_xWndPresets->SetNoSelection();` in order to *not* show a blue (in my case, gtk3 VCL plugin on Linux) selection border for the currently selected preset, as opposed to what that the "Position" control in the "Shadow style" section has.

Is the problem discussed here that the currently selected preset isn't clearly visible while the control has focus (in which case showing the selection border during that stage might be a solution) or when it doesn't have focus?
(The latter seems to be intentional, at least unless the plan is to change the general logic.)

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0cada4591d1f7dedbc158ad514adfa2ebaf9ec02
CPU threads: 32; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: CL threaded
Comment 10 V Stuart Foote 2025-07-21 11:07:06 UTC
(In reply to Michael Weghorn from comment #9)

"...the problem discussed here that the currently selected preset isn't clearly visible while the control has focus (in which case showing the selection border during that stage might be a solution)..."

That is the gist of it.

Is it as simple as removing the "m_xWndPresets->SetNoSelection()" to allow the border preset buttons to show which is active when the button bar has focus?
Comment 11 Michael Weghorn 2025-07-22 06:22:57 UTC
(In reply to V Stuart Foote from comment #10)
> "...the problem discussed here that the currently selected preset isn't
> clearly visible while the control has focus (in which case showing the
> selection border during that stage might be a solution)..."
> 
> That is the gist of it.
> 
> Is it as simple as removing the "m_xWndPresets->SetNoSelection()" to allow
> the border preset buttons to show which is active when the button bar has
> focus?

Probably something along these lines, but might still have to clear the selection when losing focus.

Note that in the context of tdf#167536, these controls were just switched to use different widgets (IconView instead of ValueSet) yesterday, which makes this look a little different, but I'd say the overall situation hasn't changed significantly.

With gtk3, the selection/focus isn't visible at all any more now even with light theme, but hopefully an approach similar to the one for ValueSet will work there, too.

I plan to take a closer look later.
Comment 12 Michael Weghorn 2025-07-22 07:23:51 UTC
Created attachment 201937 [details]
Screenshot with gtk3 VCL plugin, dark mode, with https://gerrit.libreoffice.org/c/core/+/188138 (PS1)

Pending change: https://gerrit.libreoffice.org/c/core/+/188138

Screenshot for gtk3 with dark mode is attached. Retest and feedback for other platforms once the change is in would be appreciated.
Comment 13 Michael Weghorn 2025-07-22 07:26:02 UTC
(In reply to Michael Weghorn from comment #12)
> Screenshot for gtk3 with dark mode is attached. Retest and feedback for
> other platforms once the change is in would be appreciated.

PS: Note that changes to the layout (not the color) are likely due to the work done in tdf#167536 and not this change, see tdf#167536 comment 5.
Comment 14 Commit Notification 2025-07-22 08:27:58 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e8ee0651f64b49ebad4f31541a4d68d943201c65

tdf#167476 cui a11y: Show border preset selection while focused

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Michael Weghorn 2025-07-22 08:28:58 UTC
(In reply to Michael Weghorn from comment #12)
> Pending change: https://gerrit.libreoffice.org/c/core/+/188138
> 
> Screenshot for gtk3 with dark mode is attached. Retest and feedback for
> other platforms once the change is in would be appreciated.

Closing as fixed, please reopen and add more details if there's any platform/setup where it doesn't work as expected.