Bug 118320 - Add support for Windows 10/11 dark mode
Summary: Add support for Windows 10/11 dark mode
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All Windows (All)
: high enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0 target:7.5.0
Keywords: needsDevAdvice, needsDevEval
: 85373 118607 120725 120841 124302 127776 129131 130002 134697 135293 137411 141199 143981 144704 148898 150521 155653 (view as bug list)
Depends on: 122514 148085
Blocks: Windows-Dark-Mode
  Show dependency treegraph
 
Reported: 2018-06-22 12:51 UTC by Pedro
Modified: 2023-10-13 13:27 UTC (History)
36 users (show)

See Also:
Crash report or crash signature:


Attachments
Windows 10 settings location to enable dark mode (245.88 KB, image/png)
2018-06-22 12:51 UTC, Pedro
Details
Libre Office 6.2Dev with firefox Persona Adwaita Dark (40.12 KB, image/png)
2018-06-22 13:03 UTC, Pedro
Details
Sidebar does not adopt Firefox theme color so it doesn't become dark like it does in dark modes in Linux. (44.39 KB, image/png)
2018-06-22 13:03 UTC, Pedro
Details
Tabbed bar does not adopt a dark mode. It is still in development though. (32.71 KB, image/png)
2018-06-22 13:04 UTC, Pedro
Details
Groupedbar adopts Firefox themes. (40.92 KB, image/png)
2018-06-22 13:05 UTC, Pedro
Details
Microsoft Word Dark mode (57.28 KB, image/png)
2018-06-22 13:06 UTC, Pedro
Details
Krita(https://krita.org/en/)(Please copy "Krita" directly, because "Krita" is "free software.") (181.58 KB, image/png)
2019-02-19 08:13 UTC, 00
Details
science source of short sightedness is white background (3.54 MB, application/pdf)
2019-08-23 23:04 UTC, paulystefan
Details
german pdf print of geo article against short sightedness (deleted)
2020-04-02 09:35 UTC, paulystefan
Details
some partial effect (148.64 KB, image/png)
2022-03-12 21:46 UTC, Caolán McNamara
Details
screenshot of that approach (137.38 KB, image/png)
2022-03-15 17:39 UTC, Caolán McNamara
Details
Bullets and numbering dialog (14.62 KB, image/png)
2022-03-19 18:36 UTC, Pedro
Details
Paragraph dialog (47.61 KB, image/png)
2022-03-19 18:39 UTC, Pedro
Details
Arrows to increase and decrease numbers (77.92 KB, image/png)
2022-03-19 19:01 UTC, Pedro
Details
Make background of Tab body and Tab title same color and make Tab body border transparent (or give it same color as the other two) (961.06 KB, image/png)
2022-03-20 10:07 UTC, Pedro
Details
Tabs with latest commit (76.42 KB, image/png)
2022-03-22 13:23 UTC, Pedro
Details
White background on Slide background drop-down (1.23 MB, image/png)
2022-03-22 13:56 UTC, Pedro
Details
White background on display views Edit Modes (1.25 MB, image/png)
2022-03-22 13:59 UTC, Pedro
Details
Column x Line numbers are still black (on black background) (250.28 KB, image/png)
2022-03-22 14:03 UTC, Pedro
Details
There's white area in document recovery (11.17 KB, image/png)
2022-04-03 04:47 UTC, Rizal Muttaqin
Details
In windows 11 color highlight is too light and up and down buttons still not themed. (94.12 KB, image/jpeg)
2022-08-19 10:17 UTC, Pedro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro 2018-06-22 12:51:45 UTC
Created attachment 143034 [details]
Windows 10 settings location to enable dark mode

Currently, LibreOffice adopts an amazing dark mode when in Linux DE's.
However, Microsoft is adding a dark mode to Windows 10. So it would be nice if LibreOffice could have a dark mode that would be turned on when enabling dark mode in Windows 10.

Granted Windows 10 dark mode is still a work in progress and is limited to Microsoft native apps and UWP apps.
A Microsoft blog post talking about Dark mode and how to enable it for UWP apps.
https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/set-dark-mode

A howtoGeek post talking about it and the new MacOS Mojave dark mode:
https://www.howtogeek.com/354933/macos-mojaves-dark-mode-puts-windows-10s-to-shame/

However, Office 2016 has a great dark mode as well and it would be nice to see LO also having a dark mode.

Right now there are several issues with dark mode in Windows 10. I added a few in the attachment
Comment 1 Pedro 2018-06-22 13:03:11 UTC
Created attachment 143036 [details]
Libre Office 6.2Dev with firefox Persona Adwaita Dark

Things that do not adopt a dark color:
1 - The Sidebar,
2 - The menus,
3 - The Tabbed bar,
4 - The toolbars,
5 - The application background.

The only way to have a semblance of a dark mode in LibreOffice right now is:
Select a Firefox theme. Adwaita Dark works best with the Colibre icons.
This skins the toolbars, but not anything else as I'll show in the attachments.
Comment 2 Pedro 2018-06-22 13:03:57 UTC
Created attachment 143037 [details]
Sidebar does not adopt Firefox theme color so it doesn't become dark like it does in dark modes in Linux.
Comment 3 Pedro 2018-06-22 13:04:41 UTC
Created attachment 143038 [details]
Tabbed bar does not adopt a dark mode. It is still in development though.
Comment 4 Pedro 2018-06-22 13:05:22 UTC
Created attachment 143039 [details]
Groupedbar adopts Firefox themes.
Comment 5 Pedro 2018-06-22 13:06:35 UTC
Created attachment 143040 [details]
Microsoft Word Dark mode

This is Microsoft Word 2016 dark mode. Notice how it adopts a not so dark grey in the Ribbon so that they don't have to change icon set. Same goes for Powerpoint and Excel.
Comment 6 V Stuart Foote 2018-06-24 14:43:39 UTC
This needs attention, but will depend on MS publishing API for accessing the theme colors for Desktop (i.e. non UWP use), likewise for Apple providing details for accessing them colors for Mojave builds.

With those details, beleive we could map os theme details to LO GUI. Until then, this should just sit on a back burner as any implementation effort is premature.
Comment 7 Pedro 2018-06-25 09:49:34 UTC
I agree that this is lower on the priority list right now. 
However, this should be looked at for 6.2. In Build 2018 Microsoft revealed a lot of stuff.

And Fluent Design support is coming for win32 apps, this means for LO as well. So I'm just drawing attention to this right now... Hopefully we don't have to select the dark colors of W10 because they really don't know how to design a proper dark theme.

https://www.microsoft.com/en-us/microsoft-365/blog/2018/05/07/microsoft-365-empowers-developers-to-build-intelligent-apps-for-where-and-how-the-world-works/?irgwc=1&OCID=AID681541_aff_7593_159229&tduid=(ir_QRd0L-WqqUDI2QA1u1VxfxhfUkjTD3RT2ygWS80)(7593)(159229)()(UUwpUdUnU55829YYwYg)&irclickid=QRd0L-WqqUDI2QA1u1VxfxhfUkjTD3RT2ygWS80

This post details what's coming. It mentions the Fluent Design support. Furthermore, LO should add support for Sets (the OS-level tab system that Microsoft is implementing) immediately when it launches.
Comment 8 Pedro 2018-06-25 09:53:19 UTC
The Redstone 5 update will come in the Fall. Right when 6.2 development is occurring. If we react swiftly to this LibreOffice will draw a lot of attention from users. :)

If we provide a dark theme and Set support in 6.2 a lot of people will want to try LO.
Comment 9 Pedro 2018-06-25 10:16:51 UTC
So, here's more information:

UWP apps use XAML, a markup-based language that makes it easier to create user interfaces. 

XAML example:
<Grid BorderBrush="Blue" BorderThickness="4">
    <TextBox Text="Design with XAML" Margin="20" Padding="24,16"/>
</Grid>

https://docs.microsoft.com/en-us/windows/uwp/design/fluent-design-system/

UWP apps can use a light or dark color scheme:
https://docs.microsoft.com/en-us/windows/uwp/design/style/color

Theme can be changed by changing the requested theme property in the App.xaml file:
<Application
    x:Class="App9.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App9"
    RequestedTheme="Dark">
</Application>

https://docs.microsoft.com/en-us/windows/uwp/design/style/color

There's a loooot of stuff to fine tune there.

This is relevant because, in Build 2018 they announced XAML islands for legay software like win32 apps, WPF and WinForms:

https://developer.microsoft.com/en-us/events/build/content/announcing-uwp-xaml-islands?playlist=80d147e8-f3b0-4ca0-a96f-cfc8e80bec20

https://www.windowscentral.com/microsoft-giving-developers-access-fluent-design-win32-apps-and-more
Comment 10 V Stuart Foote 2018-06-26 04:49:20 UTC
(In reply to Pedro from comment #9)
> ...
> 
> This is relevant because, in Build 2018 they announced XAML islands for
> legay software like win32 apps, WPF and WinForms:
> 
> https://developer.microsoft.com/en-us/events/build/content/announcing-uwp-
> xaml-islands?playlist=80d147e8-f3b0-4ca0-a96f-cfc8e80bec20
> 
> https://www.windowscentral.com/microsoft-giving-developers-access-fluent-
> design-win32-apps-and-more

That may be, but LibreOffice being cross platform we can not jump on every MS SDK twist. Do you somehow think Windows 7, Windows 8|8.1, or Windows 10 will support the XAML?  I seriously doubt it...

Meaning, if MS publishes a valid API for C++ development of win32 Desktop apps--only then can we adopt changes to MS theming to our internal handling of theme colors. And support all our Windows targets.

This is a valid goal, but a lot remains to be seen with how MS implements.
Comment 11 Pedro 2018-06-26 09:37:40 UTC
(In reply to V Stuart Foote from comment #10)
 
> That may be, but LibreOffice being cross platform we can not jump on every
> MS SDK twist. Do you somehow think Windows 7, Windows 8|8.1, or Windows 10
> will support the XAML?  I seriously doubt it...
> 
> Meaning, if MS publishes a valid API for C++ development of win32 Desktop
> apps--only then can we adopt changes to MS theming to our internal handling
> of theme colors. And support all our Windows targets.
> 
> This is a valid goal, but a lot remains to be seen with how MS implements.

Agreed. I was just already gathering information for anyone that might be interested already. 
When I notice that there's more info about when this will be available for win32 desktop apps I'll immediately add it here.
Comment 12 Heiko Tietze 2018-07-07 12:26:59 UTC
*** Bug 118607 has been marked as a duplicate of this bug. ***
Comment 13 Adolfo Jayme Barrientos 2018-10-20 09:08:14 UTC
*** Bug 120725 has been marked as a duplicate of this bug. ***
Comment 14 V Stuart Foote 2018-10-23 19:30:10 UTC
*** Bug 120841 has been marked as a duplicate of this bug. ***
Comment 15 Heiko Tietze 2018-11-09 11:35:09 UTC
Don't think this topic needs more attention from UX. And besides, you need to CC needsUXEval to the ux-advice ML.
Comment 16 Adolfo Jayme Barrientos 2019-02-19 02:14:55 UTC
Chromium has managed to find the Registry key to parse for dark mode from a non-UWP program, although it’s a flaky method: https://chromium.googlesource.com/chromium/src/+/63e92830db63d5b7d03c245dda083cb4e7f33ea8%5E%21/
Comment 17 00 2019-02-19 07:49:59 UTC
Complete the following article, you can do "dark mode."
https://bugs.documentfoundation.org/show_bug.cgi?id=123544
Comment 18 00 2019-02-19 08:13:55 UTC Comment hidden (off-topic)
Comment 19 00 2019-02-20 06:19:33 UTC
"Dark mode", please do "black 100%".
Comment 20 Pedro 2019-03-15 09:41:18 UTC
Microsoft open-sourced their UWP calculator with an MIT license (it's based on their win32 calc.exe).
https://www.zdnet.com/article/microsoft-is-open-sourcing-windows-calculator-on-github/
https://blogs.windows.com/buildingapps/2019/03/06/announcing-the-open-sourcing-of-windows-calculator/

Now it's possible to look at its code to see how to adopt Dark Mode for LibreOffice.

https://github.com/Microsoft/calculator
Comment 21 V Stuart Foote 2019-03-25 12:41:04 UTC
*** Bug 124302 has been marked as a duplicate of this bug. ***
Comment 22 V Stuart Foote 2019-04-26 12:19:21 UTC
*** Bug 124969 has been marked as a duplicate of this bug. ***
Comment 23 paulystefan 2019-08-23 23:04:23 UTC Comment hidden (no-value)
Comment 24 Heiko Tietze 2019-08-26 07:21:27 UTC Comment hidden (off-topic)
Comment 25 Roman Kuznetsov 2019-12-01 16:53:55 UTC
*** Bug 129131 has been marked as a duplicate of this bug. ***
Comment 26 Prabesh432@gmail.com 2019-12-02 06:25:58 UTC
what I do not understand is why this enhancement request title is for Windows-specific only?

I want this on my Ubuntu 19.19 too. Basically all Linux distros.

Writing documents in white background suck my eyes ball.

Changing the document property to mimic Windows-like Dark mode is painful especially when u have to share that document with your friends.

I wonder, why this simple concept is not even implemented yet. I heard people use VS Code to write and last paste that document in LO Writer. That's sucks.

There should be an option to makes things more comfortable. Like MS Word introduced.
Comment 27 Mike Kaganski 2019-12-02 06:32:05 UTC
(In reply to Prabesh432@gmail.com from comment #26)
> what I do not understand is why this enhancement request title is for
> Windows-specific only?
> 
> I want this on my Ubuntu 19.19 too. Basically all Linux distros.

Because for Ubuntu, another enhancement request would be titled "Add support for Ubuntu ... mode". And implementing that request would need other code changes (surprise, implementing platform-specific modes need platform-specific changes). And tracking those different goals in one issue is unreasonable (since bug tracker is a tool *for developers* to enable to track what is done and what needs to be done yet in a specific limited issue). And the only relation between those issues would be a "see also" link, and/or blocking a common meta bug.
Comment 28 Heiko Tietze 2019-12-02 07:46:39 UTC
(In reply to Mike Kaganski from comment #27)
> Because for Ubuntu, another enhancement request...

...was created by Prabesh in bug 124969. Point is that "dark mode" means to more or less automatically adjust the configuration. You can make the app dark as hell manually, check tools > options > app colors (and tools > options > view > icon style for "breeze (dark)").

Consider also to save and share your dark app colors as extension (not sure if possible).
Comment 29 Xisco Faulí 2019-12-02 13:19:36 UTC
it seems like an enhancement to me.
Changing priority to 'high' since the number of duplicates is higher than 5 or the number of people in CC higher than 20
Comment 30 kramerv 2020-01-15 17:42:36 UTC
*** Bug 130002 has been marked as a duplicate of this bug. ***
Comment 31 Roman Kuznetsov 2020-02-01 23:24:00 UTC
*** Bug 130335 has been marked as a duplicate of this bug. ***
Comment 32 paulystefan 2020-04-02 09:35:14 UTC Comment hidden (obsolete)
Comment 33 paulystefan 2020-04-02 09:53:39 UTC Comment hidden (obsolete)
Comment 34 Heiko Tietze 2020-04-02 11:04:34 UTC Comment hidden (off-topic)
Comment 35 Buovjaga 2020-04-02 14:31:04 UTC Comment hidden (off-topic)
Comment 36 Buovjaga 2020-04-24 18:26:54 UTC
*** Bug 127776 has been marked as a duplicate of this bug. ***
Comment 37 Buovjaga 2020-07-09 18:42:41 UTC
*** Bug 134697 has been marked as a duplicate of this bug. ***
Comment 38 V Stuart Foote 2020-08-02 22:50:28 UTC
*** Bug 135293 has been marked as a duplicate of this bug. ***
Comment 39 V Stuart Foote 2020-09-29 23:05:49 UTC
*** Bug 85373 has been marked as a duplicate of this bug. ***
Comment 40 V Stuart Foote 2020-10-11 16:44:04 UTC
@Mike, Tomaž, *

In comment 16, Adolfo had mentioned the 'AppsUseLightTheme' registry detection that the Chromium project had adopted. That looks to still be valid--but does not directly read the Windows UI theme.

One of the other suggestions in a Stack Overflow thread [1] is that the Windows RT API does support use on normal win32 desktop programs.

Looking at winrt API [2], example suggests with

#include <winrt/Windows.UI.ViewManagement.h>
using namespace winrt::Windows::UI::ViewManagement;

calls to the winrt UISettings namespace expose the UWP and Desktop UI to c++ calls for normal win32 desktop apps.

It would be Windows 10 only, but if not too problematic for building, it might expose the full Windows UI theming for LO to parse?

Win7, Win8.1 would remain unsupported--and issues with HC mode toggle like bug 99116 would remain.


=-ref-=
[1] https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-application

[2] https://docs.microsoft.com/en-us/uwp/api/Windows.UI.ViewManagement.UISettings?view=winrt-19041
Comment 41 V Stuart Foote 2020-10-12 17:51:10 UTC
*** Bug 137411 has been marked as a duplicate of this bug. ***
Comment 42 V Stuart Foote 2020-10-12 17:51:33 UTC
*** Bug 137414 has been marked as a duplicate of this bug. ***
Comment 43 jacksmith 2020-11-07 08:08:28 UTC Comment hidden (spam)
Comment 44 Timur 2021-03-23 17:49:30 UTC
*** Bug 141199 has been marked as a duplicate of this bug. ***
Comment 45 ifrozenphoenix 2021-06-16 11:29:33 UTC
As far as I see, there are 2 issues.
The first is that it is currently not possible to enable or manually set the settings in LO to achieve nearly the same dark mode experience as on Linux.
The second one would be to set these settings automaticly if windows dark mode is enabled.

So wouldn't it make sense in a first step to allow to set colors for the currently not themable objects like tabbed ribon, title bar, sidebar, .., so that the users can manually setup the app to achieve a dark mode experience?

If I am missing something, i.e. that this can allready be achieved, please correct me.
Comment 46 Copro 2021-06-29 12:58:37 UTC Comment hidden (abusive)
Comment 47 Copro 2021-06-29 13:25:44 UTC Comment hidden (off-topic)
Comment 48 Copro 2021-06-29 13:27:29 UTC Comment hidden (off-topic)
Comment 49 jahollan 2021-07-03 17:54:09 UTC Comment hidden (me-too)
Comment 50 Heiko Tietze 2021-09-17 06:51:25 UTC
*** Bug 143981 has been marked as a duplicate of this bug. ***
Comment 51 Buovjaga 2021-10-04 18:44:20 UTC
*** Bug 144704 has been marked as a duplicate of this bug. ***
Comment 52 Heiko Tietze 2021-10-13 18:13:40 UTC
I started with a patch that exposes the systems colors under Tools > Options > Application Colors. It's kind of a workaround to the incorrectly read system colors. The idea is to be able to configure manually a dark mode - and eventually to make it customizable per extension.

Now the discussion comes up whether this will be assumed as a solution given that users might expect an automatic switch from day to night, which wont be done with the patch. It does nothing but to list the system colors like menu color, dialog background etc. with the default values taken from whatever source (so the actual issue can be fixed by real developers).

What do you think?
Comment 53 V Stuart Foote 2021-10-13 18:55:15 UTC
(In reply to Heiko Tietze from comment #52)
> I started with a patch that exposes the systems colors under Tools > Options
> > Application Colors. It's kind of a workaround to the incorrectly read
> system colors. The idea is to be able to configure manually a dark mode -
> and eventually to make it customizable per extension.
> 
> Now the discussion comes up whether this will be assumed as a solution given
> that users might expect an automatic switch from day to night, which wont be
> done with the patch. It does nothing but to list the system colors like menu
> color, dialog background etc. with the default values taken from whatever
> source (so the actual issue can be fixed by real developers).
> 
> What do you think?

actually you did more with your work of defining a default "LibreOffice Dark" Application colors --> Color Scheme for bug 141986

And as noted there: https://bugs.documentfoundation.org/show_bug.cgi?id=141986#c14

"Either of two ways to address. One would be to implement support for UWP theming mechanism--a lot of native Windows code." 

Only that would "solve" the incorrectly read UWP system colors, though we'll need to keep track of HC mode behavior as well.

"The other is to provide a full set of application colors touching all widgets of the UI."

The problem remains (even with your https://gerrit.libreoffice.org/c/core/+/123548 patch) that too much of the UI is not exposed in the Application Colors color scheme to set our own LibreOffice managed defaults, and to block os/DE provided theme that overlays the "automatic" values.
Comment 54 V Stuart Foote 2021-10-13 19:25:44 UTC
(In reply to V Stuart Foote from comment #53)
> 
> "Either of two ways to address. One would be to implement support for UWP
> theming mechanism--a lot of native Windows code." 
> 
> Only that would "solve" the incorrectly read UWP system colors, though we'll
> need to keep track of HC mode behavior as well.
> 

Though another approach, as in comment 40, avoids the unsupportable UWP framework and uses winrt.UI.ViewManagement UIsettings for win32 calls to pickup the os/DE (XAML) theme support. Seems like this provides a functional alternative API providing full os/DE theme. But just of use for Windows 10 onward. [1]

I think we can agree there will never be a win32 API for passing Windows WPF color theming.

=-ref-=
[1] https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/using-the-xaml-hosting-api
Comment 55 Pedro 2022-02-16 10:53:22 UTC
(In reply to V Stuart Foote from comment #54)
> (In reply to V Stuart Foote from comment #53)
> > 
> > "Either of two ways to address. One would be to implement support for UWP
> > theming mechanism--a lot of native Windows code." 
> > 
> > Only that would "solve" the incorrectly read UWP system colors, though we'll
> > need to keep track of HC mode behavior as well.
> > 
> 
> Though another approach, as in comment 40, avoids the unsupportable UWP
> framework and uses winrt.UI.ViewManagement UIsettings for win32 calls to
> pickup the os/DE (XAML) theme support. Seems like this provides a functional
> alternative API providing full os/DE theme. But just of use for Windows 10
> onward. [1]
> 
> I think we can agree there will never be a win32 API for passing Windows WPF
> color theming.
> 
> =-ref-=
> [1]
> https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/using-the-
> xaml-hosting-api

I think focusing on Windows 10 onwards for this is what makes sense. OS level support for dark themes was only introduced in W10. So it should be offered to W10 forward. 
Previous Windows versions are not supported by Microsoft anymore.
Comment 56 Jahin Z. 2022-02-25 09:57:19 UTC
(In reply to V Stuart Foote from comment #54)
> (In reply to V Stuart Foote from comment #53)
> > 
> > "Either of two ways to address. One would be to implement support for UWP
> > theming mechanism--a lot of native Windows code." 
> > 
> > Only that would "solve" the incorrectly read UWP system colors, though we'll
> > need to keep track of HC mode behavior as well.
> > 
> 
> Though another approach, as in comment 40, avoids the unsupportable UWP
> framework and uses winrt.UI.ViewManagement UIsettings for win32 calls to
> pickup the os/DE (XAML) theme support. Seems like this provides a functional
> alternative API providing full os/DE theme. But just of use for Windows 10
> onward. [1]
> 
> I think we can agree there will never be a win32 API for passing Windows WPF
> color theming.
> 
> =-ref-=
> [1]
> https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/using-the-
> xaml-hosting-api

I can list about 5 or so non-UWP apps on my computer that support auto-dark mode from the system: Discord, Chrome, Firefox, MS Office, Paint.NET, Adobe Acrobat, and probably more I can't recall. I really cannot understand why you guys are making a big deal out of this.
Comment 57 Pedro 2022-03-12 13:55:23 UTC
Another non-UWP app that supports automatic dark mode in Windows 10 is the ftp client open source client WinSCP (GPLv3).
Maybe it would be a good idea to get in contact with other open source software that managed to add this support to ask for pointers. Furthermore WinSCP is written in C++ so they might be able to help even.
Comment 58 Pedro 2022-03-12 13:56:49 UTC
Github repo of WinSCP

https://github.com/winscp/winscp

https://winscp.net/eng/index.php
Comment 59 Pedro 2022-03-12 14:38:09 UTC
Trying to read their code in Github. Is this the relevant bit?

https://github.com/winscp/winscp/blob/master/source/windows/UserInterface.cpp

line 376:
void __fastcall ConfigureInterface()
{
  int BidiModeFlag =
    AdjustLocaleFlag(LoadStr(BIDI_MODE), WinConfiguration->BidiModeOverride, false, bdRightToLeft, bdLeftToRight);
  Application->BiDiMode = static_cast<TBiDiMode>(BidiModeFlag);
  SetTBXSysParam(TSP_XPVISUALSTYLE, XPVS_AUTOMATIC);
  if (WinConfiguration != NULL)
  {
    UnicodeString Theme = WinConfiguration->UseDarkTheme() ? L"DarkOfficeXP" : L"OfficeXP";
    if (!SameText(TBXCurrentTheme(), Theme))
    {
      TBXSetTheme(Theme);
    }
  }

And maybe in these next pages?
https://github.com/winscp/winscp/blob/master/source/components/ThemePageControl.cpp

https://github.com/winscp/winscp/blob/master/source/components/ThemePageControl.h
Comment 60 Caolán McNamara 2022-03-12 14:56:19 UTC
(In reply to Pedro from comment #59)
> Trying to read their code in Github. Is this the relevant bit?
> 
> https://github.com/winscp/winscp/blob/master/source/windows/UserInterface.cpp

following that example would suggest that the relevant piece is:
static int __fastcall SysDarkTheme(HKEY RootKey)
at
https://github.com/winscp/winscp/blob/master/source/windows/WinConfiguration.cpp#L2123
Comment 61 John Mills 2022-03-12 16:50:29 UTC
As Microsoft Windows users are an order of magnitude larger than Linux and MacOS combined in LibreOffice there should be feature parity in the desktop feature set mode between OS versions. As a primarily Windows user who donates on releases of LibreOffice I feel that my contributions are less valued than other OS users. 

The dark mode is also a usability feature as highlighted above and an expected feature in modern desktop applications. Emphasis should be made to remove this disparity for Windows users and improve the LibreOffice experience for >90% of the user base.
Comment 62 Caolán McNamara 2022-03-12 21:46:44 UTC
Created attachment 178847 [details]
some partial effect

With the experimental https://gerrit.libreoffice.org/c/core/+/131453 I get this screenshot. Menus are in dark mode too. So perhaps worth exploring further as there are some partial useful effects.
Comment 63 Pedro 2022-03-13 14:08:32 UTC
Wow, those are good news indeed. So it's possible to detect dark theme from Windows 10 and it changes elements?
Comment 64 Caolán McNamara 2022-03-15 17:39:50 UTC
Created attachment 178901 [details]
screenshot of that approach

Its not totally hopeless to go down a route like https://gerrit.libreoffice.org/c/core/+/131453 but it is not totally satisfactory either on trying to use the private windows apis and then bodge around with SetWindowTheme to get the handful of windows theme items that seem to work in that mode.
Comment 65 Pedro 2022-03-16 09:37:46 UTC
That seems perfect to me Caolan.
Is it available on Master? How to enable it? I can test it out and provide you feedback.
Comment 66 Pedro 2022-03-16 09:39:32 UTC
There might be another issue though: the Tabbed bar. I doubt it will use the dark theme in Windows. That would probably need another set of patches to fix.
Comment 67 Pedro 2022-03-16 09:59:41 UTC
https://bugs.documentfoundation.org/show_bug.cgi?id=121877
Tabbed UIs do not use theme color - keeps the default application color

This might be a challenge for dark mode support in Tabbed bar Caolan.
Comment 68 Telesto 2022-03-16 10:01:13 UTC
(In reply to Pedro from comment #65)
> That seems perfect to me Caolan.
> Is it available on Master? How to enable it? I can test it out and provide
> you feedback.

There isn't a pre-build. You can build it yourself with commit in question (but lot of work if you don't build LibreOffice on daily basis). 
I don't think there is no point of having this in Master already looking at the (current) commit message of https://gerrit.libreoffice.org/c/core/+/131453

Quote
"Toggling from dark to light mode is detected, and getting some
suitable colors for dark mode works.

The titlebar will toggle into dark/light mode successfully.

DrawThemeBackground does something sensible for buttons and scrollbar at
least, comboboxes can be forced to work. SpinButtons are less
successful. Menubar and toolbar just bodged to draw a solid backcolor."

----
It's simply not good enough at this point.
Comment 69 Pedro 2022-03-16 10:06:27 UTC
Yes, I understand. Don't want to push for something that is still not working properly to be included. I don't build on a daily basis, no...
Comment 70 Rizal Muttaqin 2022-03-16 10:22:13 UTC
(In reply to Telesto from comment #68)

> 
> Quote
> "Toggling from dark to light mode is detected, and getting some
> suitable colors for dark mode works.
> 
> The titlebar will toggle into dark/light mode successfully.
> 
> DrawThemeBackground does something sensible for buttons and scrollbar at
> least, comboboxes can be forced to work. SpinButtons are less
> successful. Menubar and toolbar just bodged to draw a solid backcolor."
> 
> ----
> It's simply not good enough at this point.

I am sorry I don't get the point. If some UI elements have issues so why it prevent to be just experimental one? What kind of blocker is that? Should we wait for API change for Microsoft or should any further reengineering from LibO side?
Comment 71 Pedro 2022-03-16 11:31:25 UTC
Implementing this behind experimental mode would be a great way to gather more feedback and eve help from other devs, true.
Comment 72 Commit Notification 2022-03-16 21:16:57 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#118320 enable some windows dark theme support

It will be available in 7.4.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 73 Caolán McNamara 2022-03-16 21:24:31 UTC
With "tools, options, advanced, enable experimental features" enabled this partial very experimental "demo" is available with the caveats mentioned in the above commit message. Maybe it can help point people the right way towards a full solution and illustrate some of the code involved in how we do the windows themeing and color selection
Comment 74 Pedro 2022-03-17 18:54:18 UTC
Caolán, quite frankly this looks amazing already.
The only real blocker I see is the Tabbed UI.
There a couple of other minor issues that I'll open bug reports and append here.
Another couple of suggestion can be done as enhancements:
- Change Application color automatically to LibreOffice Dark when it toggles to Dark mode.
- Change to Dark version of icon sets when Dark mode is activated.
- Create option in the menu for the users to select Light or Dark mode by themselves (ex. user with light theme that wants dark mode in LibO or vice-versa)
Comment 75 V Stuart Foote 2022-03-17 19:45:42 UTC
(In reply to Caolán McNamara from comment #73)
> With "tools, options, advanced, enable experimental features" enabled this
> partial very experimental "demo" is available with the caveats mentioned in
> the above commit message. Maybe it can help point people the right way
> towards a full solution and illustrate some of the code involved in how we
> do the windows themeing and color selection

Yep, looking very promising. Setting Rizal's new Colibre Dark icons, and setting Application colors to the 'LibreOffice Dark' this last piece is doing a nice job of rendering in a Dark mode. 

With this configuration toolbars, menus and the SB deck all look great. And of the MUFFIN assemplages, every thing is pretty presentable except the 'Tabbed' and the 'Tabbed Compact', which have bg color issues for the UI area fills.

This is a lot better than we were able to achieve using the os/DE passed theme details when an Assistive Technology 'HighContrast' theme is set; e.g. GreyEve and the forced Sifr icon theme.

Looks like weere on the right track for Windows 10+, shame about the Tabbed UI--I know some folks will fuss.

Thanks Caolán!
Comment 76 Pedro 2022-03-19 09:24:05 UTC Comment hidden (off-topic)
Comment 77 Commit Notification 2022-03-19 10:41:05 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#118320 darkmode DrawThemeBackground doesn't work for tab bodies

It will be available in 7.4.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 78 V Stuart Foote 2022-03-19 16:58:29 UTC
As Caolán notes:

"Its possible it makes more sense to not try and use the windows control
drawings apis and just set some dark colors and draw with the old
built-in vcl widget rendering or alternative."

The uxtheme.dll ShouldAppsUseDarkMode() and SetPreferredAppMode() mechanism is functional if not the best documented API [1] for Win32 WDM development, but much better than other suggested approach of reading a DWORD value from the Windows Registry. 

But as the APIs are structured it means we can only provide DarkMode to Win 10 build 1904 (18362) or later (with things still settling out for changes in Win 11). It can not support Win 7.1, 8, 8.1 or earlier builds of Win 10. How much of an issue is that? And as Caolán suggests are we better served to round out the VCL based "Application Colors" dialog with the additional widgets that need UI color assignment?

[1] https://github.com/microsoft/WindowsAppSDK/issues/41


=-off-topic-=

Given that the vaunted "Tabbed UI" MUFFIN assemblages for the Notebook Bar are not native MS "Ribbon framework" code it remains wrong to put that forward as a work alike, especially as the standard UI toolbars, menus and dialogs supplemented with the Sidebar deck are the documented (and fully supported) LibreOffice work flows cfross-platform. Absent a major refactoring there, we do a disservice to users by steering them to the Tabbed UI--but that is off topic.
Comment 79 Pedro 2022-03-19 18:36:01 UTC
Created attachment 178972 [details]
Bullets and numbering dialog

Apparently the issue with the Tabbed UI is not restricted to the Tabbed UI itself but with tabbed dialogs themselves.
Comment 80 Pedro 2022-03-19 18:39:43 UTC
Created attachment 178973 [details]
Paragraph dialog

Mike Kaganski screenshot in LibreOffice Design Telegram channel showing Paragraph dialog after commit https://git.libreoffice.org/core/+/c43c4a00089b1965c7ef69ef40c9e645dffc2e43
Comment 81 Pedro 2022-03-19 18:49:24 UTC Comment hidden (off-topic)
Comment 82 Pedro 2022-03-19 19:01:04 UTC
Created attachment 178974 [details]
Arrows to increase and decrease numbers

The arrows highlighted in the red box do not obtain dark theme.
This is minor compared to the issue with tabs in dialogs and the Tabbed UI.
Comment 83 Commit Notification 2022-03-19 20:52:43 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/348407dfdf5fd41b99f5998463eb032128799555

Related: tdf#118320 tabitems appear as light in darkmode

It will be available in 7.4.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 84 Commit Notification 2022-03-19 21:11:03 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/892ef6e8b6888b3029041ab150b409f81a5c31b0

Related: tdf#118320 let windows icon theme know when a dark theme is preferred

It will be available in 7.4.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 85 Pedro 2022-03-20 10:07:58 UTC
Created attachment 178993 [details]
Make background of Tab body and Tab title same color and make Tab body border transparent (or give it same color as the other two)

I would say these two things would clear up the Dark mode from Experimental to being supported:

- Make background of Tab body and Tab title same color. 
- make Tab body border transparent (or give it same color as the other two).

This would make the selected Tab body and Tab title seem continuous like the tabs look in Light mode.
Comment 86 Pedro 2022-03-20 10:09:20 UTC
It is just a matter of changing Tab body selected background color from #202020 to #666666. And to use also #666666 for the Tab body border color so that it disappears.
Comment 87 Commit Notification 2022-03-21 12:02:22 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#118320 swap TILES_SELECTED and TILES_FOCUSED

It will be available in 7.4.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 88 Commit Notification 2022-03-21 12:51:10 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/29c4d47161dab81971029717ce358de59f52f8c3

Related: tdf#118320 tabpane is too white in darkmode

It will be available in 7.4.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 89 V Stuart Foote 2022-03-21 16:00:52 UTC
@Caolán, had a test drive of today's
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: a997bd0e77d9721d55311dcfbd50fea802d801bd
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

Dark icon theme toggle [1] is functioning.

Can we do similar to toggle over to the "LibreOffice Dark" color scheme in 'Application Colors'?  

Although might need an expert config to be able to suppress for folks who still want a White canvas while in dark mode.

Other than that, just the fg/bg colors on the MUFFIN NB Paragraph style previews for the Tabbed NB look to need a tweak for dark mode. But looks like you already got that [2].

This can probably come out of Experimental...

=-ref-=
[1] https://gerrit.libreoffice.org/c/core/+/131843

[2] https://gerrit.libreoffice.org/c/core/+/131902
Comment 90 Heiko Tietze 2022-03-22 07:37:17 UTC
(In reply to V Stuart Foote from comment #89)
> Can we do similar to toggle over to the "LibreOffice Dark" color scheme in
> 'Application Colors'?  

The LibreOffice Dark might follow Breeze Dark but could also be some random pink colors. I don't see the system colors and the application colors being on the same level.

Same idea coincidentally on Twitter https://twitter.com/nekohayo/status/1505374769176358914
Comment 91 Mike Kaganski 2022-03-22 08:10:43 UTC
(In reply to Heiko Tietze from comment #90)

We need some change in how "automatic" colors are treated in the color schemes, trying hard to get some meaningful colors from system, including taking dark mode into account.
Comment 92 Pedro 2022-03-22 13:09:15 UTC
(In reply to V Stuart Foote from comment #89)
> @Caolán, had a test drive of today's
> Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: a997bd0e77d9721d55311dcfbd50fea802d801bd
> CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL:
> win
> Locale: en-US (en_US); UI: en-US
> Calc: CL
> 
> Dark icon theme toggle [1] is functioning.
> 
> Can we do similar to toggle over to the "LibreOffice Dark" color scheme in
> 'Application Colors'?  
> 
> Although might need an expert config to be able to suppress for folks who
> still want a White canvas while in dark mode.
> 
> Other than that, just the fg/bg colors on the MUFFIN NB Paragraph style
> previews for the Tabbed NB look to need a tweak for dark mode. But looks
> like you already got that [2].
> 
> This can probably come out of Experimental...
> 
> =-ref-=
> [1] https://gerrit.libreoffice.org/c/core/+/131843
> 
> [2] https://gerrit.libreoffice.org/c/core/+/131902

Where is the dark theme toggle located? Can't find it.
Comment 93 Pedro 2022-03-22 13:23:44 UTC
Created attachment 179033 [details]
Tabs with latest commit

These are the tabs after Caolán's latest commits.
The white border surrounding the Tab body is gone. That immensely improved the visual of the dark mode and in itself to me, makes it suitable to be moved out of experimental. So I give my +1 to V Stuart Foote proposal.

There's still no connection between Tab title and tab body, But I like the floating Tab titles and I kind of like highlight of the active Tab title?
I'm conflicted. It looks good, but it's different from the look with Light mode so I would say consistency would be necessary. But I like this mode, so maybe change the Light mode to look like this.

It reminds me of the tabs of the new Firefox UI. If they had rounded corners they would look awesome.
Comment 94 Pedro 2022-03-22 13:30:14 UTC
So active Tab title background is the same as inactive tab background. It's different from Tab body background.
This seems like a conscious design decision from Caolán that might be dictated by limitations on what he can do or by a personal decision. Either way, I like it even if it's not the same as the Light tabbed UI.
Comment 95 John Mills 2022-03-22 13:46:23 UTC
Hi all,hi Caolán,

This is starting to look really good,I would definitely use this now!

Would the new tabs also be possible to implement in the Light mode? If it is possible then it would resolve the issue that I created in Bugzilla in 2018.

https://bugs.documentfoundation.org/show_bug.cgi?id=122361

Thanks and very best regards,

John
Comment 96 John Mills 2022-03-22 13:55:20 UTC
On a semi related note could I also ask is the header bar colour (in this case black)is an option that can be changed, I ask this because I think it would be really nice to see this reflect the colours of the constituent application, e.g. Blue for Witer, Green for Calc, red for Impress etc.

Some colour would improve the look of what is a very grey application and make identification easier when you have many windows open at once.

Cheers,

John
Comment 97 Pedro 2022-03-22 13:56:21 UTC
Created attachment 179034 [details]
White background on Slide background drop-down

The background on Slide background drop-down in Standard toolbar view in Impress is light.
Comment 98 Pedro 2022-03-22 13:59:40 UTC
Created attachment 179035 [details]
White background on display views Edit Modes

White background also visible in Edit Modes of Display Views drop-down menu.
Comment 99 Pedro 2022-03-22 14:03:33 UTC
Created attachment 179036 [details]
Column x Line numbers are still black (on black background)

Column x Line numbers are still black (on black background) in Insert Table drop-down menu (both Impress and Writer). They should be White so that the numbers are readable (in the example the numbers should be 6*8).
Comment 100 V Stuart Foote 2022-03-22 15:48:31 UTC
(In reply to Pedro from comment #92)

> Where is the dark theme toggle located? Can't find it.

Not a manual action, the toggle is detected by Win10+ API called from dwmapi.dll and uxtheme.dll--ShouldAppsUseDarkMode() and SetPreferredAppMode()--mechanisms that Caolán picked up responding to how we set the Win10 Settings -> Colors -> "Choose your color" list box 'Light', 'Dark', or 'Custom'.

Unfortunately we have no framework to consume a full XAML based UWP theme from the WDM. The old legacy GetSysColor() calls no longer suffice and were never parsed for UI color theme on the Windows builds.

So while we now auto toggle the icon theme to Colibre Dark (thank you Caolán) we must still select the Tools -> Options -> Application Colors "LibreOffice Dark" color scheme--where a subset of the VCL widgets have colors set with defaults that appear OK in a Windows 10+ dark mode--but are not taken from the theme. 

Application color widgets set 'Automatic' are intended to pick up a color from os/DE theme, but those are not delivered to Windows builds, so they get set with defaults.

User can customize either the LibreOffice or the LibreOffice Dark--or build/save their own UI color scheme. We just can't read it in automatically from any of the Windows builds.
Comment 101 Pedro 2022-03-22 19:15:10 UTC
Ah got it. Yes I noticed that it detects the theme option selected in Windows. I thought your comment referred to change the UI color from inside LibreOffice. My mistake then. 

Thank you for clarifying Stuart. :)
Comment 102 Rizal Muttaqin 2022-04-03 04:47:22 UTC
Created attachment 179282 [details]
There's white area in document recovery

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 52ef78f4923283e6e52d575bec81985b031cb30b
CPU threads: 8; OS: Windows 10.0 Build 22000; UI render: Skia/Vulkan; VCL: win
Locale: id-ID (id_ID); UI: en-US
Calc: CL
Comment 103 ifrozenphoenix 2022-04-13 15:42:01 UTC
I've tested this feature with the daily master build of today (7.4 alpha) on Windows 11 22000.613 and it looks really good to me. Ok, it looks perfect :-).
I haven't found any issues so far.

Tested it with:
Writer
Calc
Impress

Thanks for the hard and long work on this issue.
Comment 104 Timur 2022-04-23 14:08:32 UTC
Please make a wrap-up or rather close this one and open new ones for what's missing, unless already open. 
We have Meta for many issues, this one also deserved meta.
Comment 105 Pedro 2022-04-25 11:53:46 UTC
Agreed. And move it out of experimental.
Comment 106 John Mills 2022-04-25 13:47:37 UTC
I agree with Pedro here, what is remaining for this to be moved out of experimental now? What would be expected in a 'meta' ticket? Something like selectable light/dark or follow system theme?
Comment 107 V Stuart Foote 2022-05-03 13:36:24 UTC
*** Bug 148898 has been marked as a duplicate of this bug. ***
Comment 108 Commit Notification 2022-08-17 10:40:39 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#118320 don't require experimental to be set anymore

It will be available in 7.5.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 109 Pedro 2022-08-19 10:12:29 UTC
I would wait to remove it out of experimental because there's those multiple minor issues that were reported by me and Ryzal that should be addressed before the 7.5.0 release.
Unless those are worked on before the release?
Comment 110 Mike Kaganski 2022-08-19 10:14:31 UTC
(In reply to Pedro from comment #109)

Moving out of experimental early enough in the release cycle is fine; it's always possible to undo that, but this way, it gets more testing.
Comment 111 Pedro 2022-08-19 10:17:00 UTC
Created attachment 181883 [details]
In windows 11 color highlight is too light and up and down buttons still not themed.

Additional issues in Windows 11 that should be addressed before 7.5.0 move out of experimental.
Comment 112 Pedro 2022-08-19 10:56:47 UTC
Thank you for clarifying this for me Mike. :)
Comment 113 V Stuart Foote 2022-08-20 18:47:42 UTC
*** Bug 150521 has been marked as a duplicate of this bug. ***
Comment 114 Timur 2022-09-12 09:52:25 UTC
I'm adding Windows Dark Mode meta as bug 150915.
I kindly ask reporters of duplicate bugs to verify that their requests were resolved, if not please set bug from duplicate to Unconfirmed and to block bug 150915. 
Stuart, you are welcome to write a wrarp up there. 
I think it's safe to close this one now with huge thanks to Caolán.
Comment 115 Mike Kaganski 2023-06-02 19:06:11 UTC
*** Bug 155653 has been marked as a duplicate of this bug. ***