Recent

Author Topic: Colors in LCL  (Read 4735 times)

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Colors in LCL
« on: April 06, 2011, 04:13:44 pm »
Hello,

in TCustomPanel I found declaration:
Code: [Select]
property Color default {$ifdef UseCLDefault}clDefault{$else}clBtnFace{$endif};
My questions are:
Where is declared UseCLDefault and why or what it does?
What is clDefault, it is simply nothing or some default value? And if it is default value then where components take this value ?

Thanks
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

zeljko

  • Hero Member
  • *****
  • Posts: 1734
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Colors in LCL
« Reply #1 on: April 06, 2011, 06:38:30 pm »
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.

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Colors in LCL
« Reply #2 on: April 06, 2011, 06:52:56 pm »
Zeljko, thank you for explanation.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

 

TinyPortal © 2005-2018