View Issue Details

IDProjectCategoryView StatusLast Update
0013577LazarusLCLpublic2011-12-01 11:25
ReporterGeoffray Levasseur Assigned ToPaul Ishenin  
Status closedResolutionfixed 
Product Version0.9.27 (SVN) 
Fixed in Version0.9.29 (SVN) 
Summary0013577: default colors with QT
DescriptionThe QT/KDE color scheme is not respected when using button color different of the form background color. All the form is using button color wich is not correct. Should be fixed by using TForm.Color := clForm instead of TForm.Color := clBtnFace.
Additional InformationIn the Lazarus IDE and default form color in new projects.
TagsNo tags attached.
Fixed in Revision28344 and others
WidgetsetGTK 2, Win32/Win64, WinCE, Carbon, QT
Attached Files


related to 0014270 closedVincent Snijders Selection of text in Edit TCombobox in Find dialogs do not work. 
related to 0014571 closedPaul Ishenin Text color for buttons,check boxes,group boxes etc. incorrect on GTK2 
related to 0012550 resolvedBart Broersma LCL doesn't adhere to Gnome theme colors 
related to 0017994 closedPaul Ishenin Background of IDE dialogs is BLACK 


Zeljan Rikalo

2009-04-24 17:52

developer   ~0027031

hm...why Qt is guilty here ? Doesn't LCL give default color ?

Zeljan Rikalo

2009-04-24 17:57

developer   ~0027032

This is not Qt related bug, please reopen as LCL if U think that it should be clForm/clBackground or whatever.

from forms.pp TCustomForm:

property Color default clBtnFace;

Felipe Monteiro de Carvalho

2009-04-24 21:29

developer   ~0027043

I think the claim is valid and makes sense. I would be in favor of making the change. What do other developers think?

Geoffray Levasseur

2009-05-30 15:54

reporter   ~0028151

Needed for valid integration in Qt environment (basically KDE). I can make the change if you want.

Vincent Snijders

2009-05-30 20:55

manager   ~0028155

Instead of using clForm, clDefault has been proposed.

Zeljan Rikalo

2009-06-01 08:22

developer   ~0028189

Why clDefault ? Why we have clForm ?

Graeme Geldenhuys

2009-06-01 09:40

reporter   ~0028191

I must agree. clForm seems the most logical choice. Why else do we have the clForm color definition?

Zeljan Rikalo

2009-06-01 09:57

developer   ~0028192

Thats clear with qt:
QPaletteButton = clBtnFace
QPaletteWindow = clForm
QPaletteBase = clWindow
but also with LCL winapi where we have

What's the problem with clForm as default for TCustomForm ? ParentColor for others or what ?

Geoffray Levasseur

2009-06-05 18:08

reporter   ~0028310

Default for TCustomForm is set to clBtnFace (just like Delphi if I remember). I don't think it should be a problem to change default value to clForm.

If there's parent control setting the color, we should not have the need to change it cause when I create my own form, simply changing myself the form color to clForm is solving the problem (just nearly unvisible bugs on some TPanel, not always). We just have to check TCustomForm descendant for unwanted color change.

Zeljan Rikalo

2009-06-05 18:25

developer   ~0028311

There are more controls which are clBackground colored but such controls are clBtnFace default. eg. TPanel, TGroupBox

Geoffray Levasseur

2009-06-09 09:37

reporter   ~0028383

Last edited: 2009-06-09 09:41

The only control that are using clBtnFace instead of clForm is TCustomForm.

These control is the one to be modified, and I did not find any others. Other control will be modified through their respective heritage (eg TForm herited from TCustomForm, etc...).

Controls using clBackground as default are automatically using the good color when form background is set manually, so this should not be a problem. I did many tests using QT 4.5.1 and Oxygen.

Zeljan Rikalo

2009-06-09 11:59

developer   ~0028388

This is targeted for 0.9.28 so it will be fixed in some reasonable time ...

Vincent Snijders

2009-06-09 13:02

manager   ~0028391

Zeljan, by who?

Zeljan Rikalo

2009-06-09 14:39

developer   ~0028395

@Vincent , this is LCL related, changing default property from clBtnFace to clForm for TCustomForm fixes that (I know someone proposed clDefault solution) ... anyway: I have svn write permissions only for lcl/interfaces/qt ... so someone else must do that :) eg. You ? :)

Paul Ishenin

2009-06-10 05:40

manager   ~0028415

The problem can't be fixed by changing form color to clForm. This will break many other controls. clDefault is a better solution but we need to implement it everywhere before. Currently it is only implemented for gtk/gtk2 and not too much tested.

Zeljan Rikalo

2009-06-10 10:57

developer   ~0028425

ok...then clDefault .. so proposal is to set clDefault as default color for each control and then widgetset should decide what color is it ?
...or I missed something ?
If it's so I can start qt implementation today (anyway I have to rework palette changes about InheritsFrom() and ClassType= usage)

Paul Ishenin

2009-06-10 17:05

manager   ~0028452

if clDefault is used then we need to undone our own color changes if it is possible (on gtk it is possible). If it is imposible we need to set a default color (request from library?).

Zeljan Rikalo

2009-06-11 10:09

developer   ~0028466

ok...seem that it's time to discuss about this on lazdevel ...

Zeljan Rikalo

2010-03-09 11:49

developer   ~0035076

Applied to all widgetsets.

Dmitry Shachnev

2010-06-08 17:23

reporter   ~0038401

Forms with color=clButtonFace also look ugly with default Ubuntu theme, so that's great that you fixed it in 0.9.29.
Will message dialogs (for example showmessage) also use clDefault/clForm? (if no, please fix)

Zeljan Rikalo

2010-06-08 17:42

developer   ~0038402

Yes, it will be fixed.

Dmitry Shachnev

2010-06-18 21:01

reporter   ~0038620

Last edited: 2010-06-18 21:30

For me it began working only when I also modified include/
But in Lazarus some components still have clBtnFace color: the left panel in source editor and object inspector (see the screenshot I attached). It's a minor issue, but it would be great if you look at it also.

2010-06-18 21:31


lazarus-screenshot.png (317,896 bytes)

Dmitry Shachnev

2010-06-19 11:42

reporter   ~0038629

One more issue:
Combo/Check Boxes and Groups now have parent color, but they should be always clBtnFace - so that they are colored when checked (before changing form color there was no problem).

Zeljan Rikalo

2010-07-23 11:22

developer   ~0039610

@Dmitry, you're wrong about Combos/Checkboxes/Groups color. It must not be clBtnFace (actually with some themes they are), so clDefault is best solution.

Paul Ishenin

2010-11-23 15:35

manager   ~0043420

Please test and close if ok.

Paul Ishenin

2010-11-23 15:35

manager   ~0043421

Please test and close if ok.

Issue History

Date Modified Username Field Change
2009-04-24 13:01 Geoffray Levasseur New Issue
2009-04-24 13:01 Geoffray Levasseur Widgetset => QT
2009-04-24 17:52 Zeljan Rikalo LazTarget => 0.9.28
2009-04-24 17:52 Zeljan Rikalo Note Added: 0027031
2009-04-24 17:52 Zeljan Rikalo Status new => acknowledged
2009-04-24 17:57 Zeljan Rikalo Status acknowledged => resolved
2009-04-24 17:57 Zeljan Rikalo Resolution open => no change required
2009-04-24 17:57 Zeljan Rikalo Assigned To => Zeljan Rikalo
2009-04-24 17:57 Zeljan Rikalo Note Added: 0027032
2009-04-24 21:29 Felipe Monteiro de Carvalho Note Added: 0027043
2009-04-24 21:29 Felipe Monteiro de Carvalho Assigned To Zeljan Rikalo =>
2009-04-24 21:29 Felipe Monteiro de Carvalho Status resolved => acknowledged
2009-04-24 21:29 Felipe Monteiro de Carvalho Resolution no change required => open
2009-04-24 21:29 Felipe Monteiro de Carvalho Category Widgetset => LCL
2009-05-30 15:54 Geoffray Levasseur Note Added: 0028151
2009-05-30 20:55 Vincent Snijders Note Added: 0028155
2009-06-01 08:22 Zeljan Rikalo Note Added: 0028189
2009-06-01 08:22 Zeljan Rikalo Status acknowledged => feedback
2009-06-01 09:40 Graeme Geldenhuys Note Added: 0028191
2009-06-01 09:57 Zeljan Rikalo Note Added: 0028192
2009-06-05 18:08 Geoffray Levasseur Note Added: 0028310
2009-06-05 18:25 Zeljan Rikalo Note Added: 0028311
2009-06-09 09:37 Geoffray Levasseur Note Added: 0028383
2009-06-09 09:41 Geoffray Levasseur Note Edited: 0028383
2009-06-09 11:59 Zeljan Rikalo Note Added: 0028388
2009-06-09 13:02 Vincent Snijders Note Added: 0028391
2009-06-09 14:39 Zeljan Rikalo Note Added: 0028395
2009-06-10 05:40 Paul Ishenin Note Added: 0028415
2009-06-10 10:57 Zeljan Rikalo Note Added: 0028425
2009-06-10 17:05 Paul Ishenin Note Added: 0028452
2009-06-11 10:09 Zeljan Rikalo Note Added: 0028466
2009-06-17 09:28 Vincent Snijders LazTarget 0.9.28 => 0.9.30
2009-06-17 09:28 Vincent Snijders Status feedback => acknowledged
2009-08-06 13:02 Vincent Snijders Relationship added related to 0014270
2009-12-14 08:16 Zeljan Rikalo Relationship added related to 0014571
2010-03-09 11:49 Zeljan Rikalo Widgetset QT => GTK 2, Win32/Win64, WinCE, Carbon, QT
2010-03-09 11:49 Zeljan Rikalo Note Added: 0035076
2010-06-08 17:23 Dmitry Shachnev Note Added: 0038401
2010-06-08 17:42 Zeljan Rikalo Note Added: 0038402
2010-06-18 21:01 Dmitry Shachnev Note Added: 0038620
2010-06-18 21:12 Dmitry Shachnev Note Edited: 0038620
2010-06-18 21:30 Dmitry Shachnev Note Edited: 0038620
2010-06-18 21:31 Dmitry Shachnev File Added: lazarus-screenshot.png
2010-06-19 11:42 Dmitry Shachnev Note Added: 0038629
2010-06-20 10:49 Zeljan Rikalo Relationship added related to 0012550
2010-07-23 11:22 Zeljan Rikalo Note Added: 0039610
2010-11-20 12:37 Zeljan Rikalo Relationship added related to 0017994
2010-11-23 15:35 Paul Ishenin Fixed in Revision => 28344 and others
2010-11-23 15:35 Paul Ishenin Status acknowledged => resolved
2010-11-23 15:35 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-11-23 15:35 Paul Ishenin Resolution open => fixed
2010-11-23 15:35 Paul Ishenin Assigned To => Paul Ishenin
2010-11-23 15:35 Paul Ishenin Note Added: 0043420
2010-11-23 15:35 Paul Ishenin Note Added: 0043421
2011-12-01 11:25 Marc Weustink Status resolved => closed