Page 1 of 1

Dark Title Bar

Posted: Sun Nov 07, 2021 4:21 am
by Painless
Is there any way to change the colour of the title bar so that it fits with dark mode?

Windows 10 has the ability to use dark mode to change this feature globally and in the file explorer but it does not seem to apply to other programs.

Second image down shows what I mean, only difference is that I'm using View mode in windowed.
viewtopic.php?f=82&t=42012&p=170440#p170440

Re: Dark Title Bar

Posted: Mon Nov 08, 2021 9:00 am
by xnview
XnView Classic?

Re: Dark Title Bar

Posted: Mon Nov 08, 2021 4:00 pm
by XnTriq

No unfocused dark title bar

Posted: Wed Jul 19, 2023 7:03 am
by DarkDarkEverything
The titlebar still turns white when the XNView MP window isn't in focus.

Screenshots taken with Win10, dark mode on, accent color grey, titlebar checkbox on.

XNView MP in focus YES:
https://imgur.com/a/nocEMqB
Result: Windows Explorer is dark, XNView MP is dark

XNView MP in focus NO:
https://imgur.com/a/UB4mj9G
Result: Windows Explorer is dark, XNView MP is light

How should it be?
The unfocused XNView MP title bar should be dark grey (which isn't - just to clarify - my choosen accent color in the screenshots), independent of the accent color and the proposed checkbox in windows color settings.

PS: leaving the checkbox off, makes (native) focused windows have plain black titlebars (instead of accent color).
That may be a personal taste thingy, but it's even more dark, soooo I think it's even better 8)

Re: Dark Title Bar

Posted: Mon Sep 25, 2023 12:22 pm
by DelphiErik
Creating a dark title bar for win32 applications like XnView in Windows 10/11 during dark theme is quit simple to do (dark when the window is not active). Just use the function DwmSetWindowAttribute. In Delphi/Lazarus/Pascal it is like:

Code: Select all

DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19;
DWMWA_USE_IMMERSIVE_DARK_MODE = 20;

TDwmSetWindowAttribute = function(hwnd: HWND; dwAttribute: DWORD; pvAttribute: Pointer; cbAttribute: DWORD): HRESULT; stdcall; // dwmapi.dll
 
if IsWindows10OrGreater(17763) then
  begin
    attr := DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1;
    if IsWindows10OrGreater(18985) then attr := DWMWA_USE_IMMERSIVE_DARK_MODE;
    DwmSetWindowAttribute(AForm.Handle, attr, @AValue, SizeOf(AValue));
  end;
See code/examples:
https://forum.lazarus.freepascal.org/in ... ic=59351.0
https://stackoverflow.com/questions/571 ... windows-10
https://github.com/godotengine/godot-pr ... ssues/1868

Regards, Erik

Re: Dark Title Bar

Posted: Sun Oct 20, 2024 5:54 pm
by rbclass
Has anyone resolved the dark title bar "issue"?