View Issue Details

IDProjectCategoryView StatusLast Update
0022901LazarusIDEpublic2014-01-04 20:37
ReporterStephano Assigned ToZeljan Rikalo  
Status feedbackResolutionreopened 
Product Version1.1 (SVN) 
Summary0022901: TSpeedButton color issue
DescriptionA TSpeedButton on a red form will have clBtnFace color which is OK.
However, the same speedbutton on a red panel will show red despite its color=clBtnFace
The transparent property is by default true (shouldn't it be false?), but has no effect whatsoever.

Lazarus 1.1 r38698M FPC 2.6.1 i386-linux-gtk 2
TagsNo tags attached.
Fixed in Revision38762
WidgetsetGTK 2
Attached Files


related to 0025491 resolvedJuha Manninen GTK2 missing transparency (with patch for common cases) 


Zeljan Rikalo

2012-09-20 10:38

developer   ~0062514

Please test and close if ok.


2012-09-20 11:42

developer   ~0062516

The main problem seems to be solved. However, there is still an artifact in the speedbutton's background when transparent is false (although there should be no difference as long as Flat is false). In the attached screenshot, the left buttons have color=clButtonFace, and the right ones color=clRed.

The bottom ones have a border that should not be there.

2012-09-20 11:43


SpeedButtonArtifact.jpg (95,600 bytes)   
SpeedButtonArtifact.jpg (95,600 bytes)   

Zeljan Rikalo

2012-09-20 16:45

developer   ~0062525

TSpeedButton.Color will be unpublished. TSpeedButton is painted by themes , so no change of color will be possible. Red frame around is visible because of FillRect() inside TSpeedButton paint proc.

Zeljan Rikalo

2012-09-20 16:54

developer   ~0062526

Also, that border comes from TSpeedButton.Color.
-> fills rect with red color Canvas.FillRect(RectofbuttonWithColor);
-> theme draws button with button color from theme Themes.DrawMyButton()


2012-09-20 18:15

developer   ~0062527

TSpeedButton.Color should be unpublished indeed if it can't be used.

Zeljan Rikalo

2012-09-21 06:00

developer   ~0062530

Yes, I'll do that. Note that same behaviour with clRed we have under qtlcl too.
Under LCL "transparent" for SpeedButton means almost nothing.
eg. we have Form.Color = clBlack and speedbutton on it (speedButton.Transparent = False).
SpeedButton fills it's own FillRect() with parent color (clBlack) and then it draws button (theme does that with color of button setted up in theme).
When SpeedButton.Transparent = True, then SpeedButton does not call FillRect() but theme completely draws button without filling rect (it's brush is bsClear on all ws).


2012-09-21 09:02

developer   ~0062533

True. According to the Delphi docs, Transparent should not have any effect while Flat is False. However, in the attached screenshot, the 2 buttons at the left are slightly different (despite that.their color property is left at its default). Therefore some fine tuning may be needed.

The additional thing I'd like to have preserved (or improved if possible) is the separation of background and foreground drawing so that colored TSpeedButton descendents can be easily implemented by overriding the respective painting methods.

Issue History

Date Modified Username Field Change
2012-09-16 19:52 Stephano New Issue
2012-09-16 19:52 Stephano Widgetset => GTK 2
2012-09-20 10:38 Zeljan Rikalo Fixed in Revision => 38762
2012-09-20 10:38 Zeljan Rikalo LazTarget => -
2012-09-20 10:38 Zeljan Rikalo Status new => resolved
2012-09-20 10:38 Zeljan Rikalo Resolution open => fixed
2012-09-20 10:38 Zeljan Rikalo Assigned To => Zeljan Rikalo
2012-09-20 10:38 Zeljan Rikalo Note Added: 0062514
2012-09-20 11:42 Stephano Note Added: 0062516
2012-09-20 11:43 Stephano File Added: SpeedButtonArtifact.jpg
2012-09-20 13:20 Stephano Status resolved => assigned
2012-09-20 13:20 Stephano Resolution fixed => reopened
2012-09-20 16:45 Zeljan Rikalo Note Added: 0062525
2012-09-20 16:45 Zeljan Rikalo Status assigned => feedback
2012-09-20 16:54 Zeljan Rikalo Note Added: 0062526
2012-09-20 18:15 Stephano Note Added: 0062527
2012-09-21 06:00 Zeljan Rikalo Note Added: 0062530
2012-09-21 09:02 Stephano Note Added: 0062533
2014-01-04 20:37 Juha Manninen Relationship added related to 0025491