Lazarus

Programming => LCL => Topic started by: zamtmn on September 21, 2022, 12:07:05 am

Title: QT TTaskDialog musings
Post by: zamtmn on September 21, 2022, 12:07:05 am
Show how these dialogs will look in other widgesets. I'm afraid we will have a bad surprise((
Played with the LCL TaskDialog and tried to create an adapted version of the screenshot in reply #27. Here's my result for Win11, Linux-Mint-gtk2, mac Mojave, and for comparison Delphi XE 10.4 (on Win 11). They are all pretty much the same (except for Delphi which does not have the option tdiQuestion for the FooterIcon). (The order of the OK and Cancel buttons (or all buttons?) should be reworked in the non-Windows version of the LCL Taskdialog).
I am observing problems with dark qt
Title: Re: QT TTaskDialog musings
Post by: wp on September 21, 2022, 12:20:37 am
Found two fixed rgb colors in the code. Please open LCLTaskDialog.pas (in the lcl folder of your Lazarus installation), search for ".Color".

The first hit is near line 720, "result.Font.Color := $B00000" - which must be the blue of the title. Replace the color by clMenuHighlight, for example.

The second hit is at line 875, "panel.Color := clWhite" - which must be the background color. Replace the color by clWindow.
Title: Re: QT TTaskDialog musings
Post by: zamtmn on September 21, 2022, 12:25:22 am
Found two fixed rgb colors in the code. Please open LCLTaskDialog.pas (in the lcl folder of your Lazarus installation), search for ".Color".

The first hit is near line 720, "result.Font.Color := $B00000" - which must be the blue of the title. Replace the color by clMenuHighlight, for example.

The second hit is at line 875, "panel.Color := clWhite" - which must be the background color. Replace the color by clWindow.

Yes, it got better!
Title: Re: QT TTaskDialog musings
Post by: wp on September 21, 2022, 12:40:41 am
Well, the title's Font.Color is not good. What does the original value, $B00000, look like?
Title: Re: QT TTaskDialog musings
Post by: zamtmn on September 21, 2022, 01:05:04 am
Well, the title's Font.Color is not good. What does the original value, $B00000, look like?
Probably, but this is a coloring game, on some color scheme it will be bad
Title: Re: QT TTaskDialog musings
Post by: wp on September 21, 2022, 11:08:13 am
I guess the only option left is to extend the TTaskDialog by a new property TitleColor or, better, TitleFont which defaults to the current parameters, but may be changed in problematic cases such as dark mode.
Title: Re: QT TTaskDialog musings
Post by: Arioch on September 21, 2022, 11:29:57 am
to extend the TTaskDialog by a new property TitleColor or, better, TitleFont

Not sure it is good. Looks like a first step in a downhill road.

1) Would take some plumbing, like check if it is customized or not.  property XXXX ..... stored non-default-funciton;

For colour you at least can compare with special "virtual" values like clWindow, but comparing the whole TFont is more ocmplex.
And then developers would be obliged to make custom engine to apply Qt/GTK/FTK/whatever-toolkit color scheme? They would not. They would fix one color for default theme and make the dialog not response to user changes.

2) Also, what is special in the Title?  Can we be sure color themes might only make Title look bad and would neve harm other elements colors? We may end up exposing ALL the elemets colors, almost implement a theming for one special control?  From my Linux experience - choosing/making color themes separately for every toolkit out there was always a hassle, copared to Windows uniformity.

3) ...and then, those color properties would be ignored on Windows, which renders by its internal native ways.
TTaskDialog now tries to hide methods and properties, that are Windows-only, that are not re-implemented in pure LCL.
If you would expose UNIX-only properties, should we then add Windows-only properties too? And eventually made TTaskDialog into a mi of UIX-only and Windows-only properties?

Probably, but this is a coloring game, on some color scheme it will be bad

Can you look into any TColor protpety and check through "virtual" clXXXX values, like clText, clWindow, etc. With different themes.
Is there any special value that is consistently distinct from window background, so could be assumed for title text?


-----------

I am currently trying it on Windows, changing colour scheme, and it seems that TTaskDialog jsut ignores all those and has it's own fixed colours...

Title: Re: QT TTaskDialog musings
Post by: wp on September 21, 2022, 11:55:58 am
Then how would you solve this? A dialog type which can only be displayed with such flaws in some configurations in a central IDE job (like running a compiled application under a debugger) must not be used by the IDE.
Title: Re: QT TTaskDialog musings
Post by: Arioch on September 21, 2022, 12:05:03 pm
Granted, with Windows Aero introduced - the old "standard" colour theme became largely ignored. For example the Start menu does so.

and notoriously (for me at least) TPageControl ignores all the color properties - and is always rendereed in bright white on Win7+ VCL.

menu bar also outright ignores color, set for "menu" items now...

I wanted Windows to be some clue, but Microsoft seems did not invent some magic, but instead just fixed it in stone...

Okay... To me the colour, chosen for Windows TaskDialog bit title (and CommandButtons' big captions too)is very close (a bit darker) to hyperlink colours (clHyperlink ?)

meanwhile found yet another IDE rendering bug.... a real nasty one
told ya, i have a pervert knack. Whenever i take a new program i always do something no one thought ever would get done

So, maybe in his colour theme clHyperlink would do good enough?
Title: Re: QT TTaskDialog musings
Post by: wp on September 21, 2022, 12:11:43 pm
Okay... To me the colour, chosen for Windows TaskDialog bit title (and CommandButtons' big captions too)is very close (a bit darker) to hyperlink colours (clHyperlink ?)
clHyperlink? Never seen this one, at least it does not exist in the graphics unit.
Title: Re: QT TTaskDialog musings
Post by: Arioch on September 21, 2022, 12:13:54 pm
displayed with such flaws in some configurations

Make "white on white and nothing but white" coolour theme - and ALL the windows would be "rendered with flaws"

Like i said, Microsoft reported to it by de facto prohibiting theming.
I speculate Mac OS makes similar restrictions, and Microsoft is just copying their approach.
Either you want things beautiful or customizable.
If you give user ways to customize - those can be abused to "rendering with flaws".

----

I asked zamtmn to see other "standard" colours, starting with "hyperlink" ones.
And choose a colour that remains readable in MOST themes (it is never "all" but "most")

There can be one ugly approach though, heuristics. You calculate brightness of the colours, background and font. If the brightness is too close, you fallback font colour to all-black or all-white, oppositing the background.  But in the sense it is the same: you deny user their right at customizations, just on some ad hoc conditions, not always.
Title: Re: QT TTaskDialog musings
Post by: Arioch on September 21, 2022, 12:19:09 pm
Okay... To me the colour, chosen for Windows TaskDialog bit title (and CommandButtons' big captions too)is very close (a bit darker) to hyperlink colours (clHyperlink ?)
clHyperlink? Never seen this one, at least it does not exist in the graphics unit.

It exists in "Windows old" colors GUI, i think it was added in Microsoft Internet Explorer 4 - somewhere between Win95 and Win98, not sure.
....made some test, in Delphi that seems to be named clHotlight (and not clHighlight which is something yet different), those exist in LCL too,
TinyPortal © 2005-2018