Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-04

clDefault propagation

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

I've got a form F, at the top of which is a status bar T. At the bottom is a panel B containing status bars B1 and B2. The status bars and panel are all set to clDefault.

On 0.9.28, the status bars are all grey.

On 0.9.30, the top status bar T is grey, while the bottom status bars B1 and B2 inherit their colour from B which in turn inherits it from the form F (which is, unfortunately, black).

Is this to be expected?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Howard Page-Clark
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 12 lines
I've got a form F, at the top of which is a status bar T. At the bottom is a panel B containing status bars B1 and B2. The status bars and panel are all set to clDefault. On 0.9.28, the status bars are all grey. On 0.9.30, the top status bar T is grey, while the bottom status bars B1 and B2 inherit their colour from B which in turn inherits it from the form F (which is, unfortunately, black). Is this to be expected?

In a forum reply Zeljko recently wrote:
"clDefault is default color of wincontrol provided by widgetset theme. Look at qt implementation (TQtWidget.Palette).
TQtWidget.Palette is initialized before LCL changed any color to handle and it contains default QPalette for
that widget under it's current QStyle.
We decided to introduce clDefault to get all mighty color themes work, before that eg. TCustomPanel default color was clBtnFace, but when you look that from Qt side , that's wrong since clBackground is correct color for TCustomPanel, same for TCustomForm, it was clBtnFace, but clForm is color which should be there. To avoid problems with ParentColor property (if we change wincontrol default color as ws proposed), clDefault is here - default color for all wincontrols is clDefault and that's it."

So I think you're seeing the difference between clBtnFace (earlier) and clDefault (now).

Howard

Reply by email

Mark Morgan Lloyd
to Howard Page-Clark
Howard Page-Clark wrote 30 lines
On 26/4/11 8:35, Mark Morgan Lloyd wrote: > I've got a form F, at the top of which is a status bar T. At the bottom > is a panel B containing status bars B1 and B2. The status bars and panel > are all set to clDefault. > > On 0.9.28, the status bars are all grey. > > On 0.9.30, the top status bar T is grey, while the bottom status bars B1 > and B2 inherit their colour from B which in turn inherits it from the > form F (which is, unfortunately, black). > > Is this to be expected? > In a forum reply Zeljko recently wrote: "clDefault is default color of wincontrol provided by widgetset theme. Look at qt implementation (TQtWidget.Palette). TQtWidget.Palette is initialized before LCL changed any color to handle and it contains default QPalette for that widget under it's current QStyle. We decided to introduce clDefault to get all mighty color themes work, before that eg. TCustomPanel default color was clBtnFace, but when you look that from Qt side , that's wrong since clBackground is correct color for TCustomPanel, same for TCustomForm, it was clBtnFace, but clForm is color which should be there. To avoid problems with ParentColor property (if we change wincontrol default color as ws proposed), clDefault is here - default color for all wincontrols is clDefault and that's it." So I think you're seeing the difference between clBtnFace (earlier) and clDefault (now).

In that case, why is the status bar at the top of the form grey and the ones at the bottom black (as dictated by their grandparent)? They're all set to clDefault and other relevant properties are the same, so I'd expect them to look the same.

Looking at this from the point of view of sorting the problem rather than understanding the behaviour, what colour should a status bar be set to so that it adopts the colour of the main menu background?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Paul Ishenin
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 5 lines
In that case, why is the status bar at the top of the form grey and the ones at the bottom black (as dictated by their grandparent)? They're all set to clDefault and other relevant properties are the same, so I'd expect them to look the same.

If the default color is not defined by the theme it inherits from the parent. Probably in your case you are using win32 widgetset which does not define paticular color for statusbar and as result it asks about default color from its parent.

Looking at this from the point of view of sorting the problem rather than understanding the behaviour, what colour should a status bar be set to so that it adopts the colour of the main menu background?

Set it to clBtnFace.

Best regards,
Paul Ishenin

Reply by email

Mark Morgan Lloyd
to Paul Ishenin
Paul Ishenin wrote 10 lines
27.04.2011 5:16, Mark Morgan Lloyd wrote: > > In that case, why is the status bar at the top of the form grey and > the ones at the bottom black (as dictated by their grandparent)? > They're all set to clDefault and other relevant properties are the > same, so I'd expect them to look the same. If the default color is not defined by the theme it inherits from the parent. Probably in your case you are using win32 widgetset which does not define paticular color for statusbar and as result it asks about default color from its parent.

Debian x86 GTK2.

Show quoted text 5 lines
> Looking at this from the point of view of sorting the problem rather > than understanding the behaviour, what colour should a status bar be > set to so that it adopts the colour of the main menu background? Set it to clBtnFace.

Thanks Paul, noted.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email