View Issue Details

IDProjectCategoryView StatusLast Update
0026586LazarusWidgetsetpublic2014-09-12 13:58
ReporterGabor BorosAssigned ToZeljan Rikalo 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinux x86_64OSUbuntuOS Version14.04.1
Product Version1.3 (SVN)Product Build46039 
Target Version1.4Fixed in Version1.3 (SVN) 
Summary0026586: ThemeServices return wrong state images for checkbox
DescriptionThemeServices return wrong images for tbCheckBoxCheckedDisabled and tbCheckBoxMixedDisabled with KDE. Tried GNOME and Win32 (Qt and native) too and those works like a charm.
Steps To Reproduceuses Themes, Types;

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);

 procedure DrawThemedButton(in_ThemedButton:TThemedButton;in_Pos:Integer);
 var
   Details:TThemedElementDetails;
   R:TRect;
   S:TSize;

 begin
   Details:=ThemeServices.GetElementDetails(in_ThemedButton);

   S:=ThemeServices.GetDetailSize(Details);

   R.Left:=in_Pos;
   R.Right:=R.Left+S.cx;
   R.Top:=0;
   R.Bottom:=S.cy;

   ThemeServices.DrawElement(Image1.Canvas.Handle,Details,R);
 end;

var
  i:TThemedButton;
  tmpPos:Integer;

begin
  Image1.Canvas.FillRect(Image1.ClientRect);

  tmpPos:=0;
  for i:=tbCheckBoxUncheckedNormal to tbCheckBoxMixedDisabled do
   begin
     DrawThemedButton(i,tmpPos);
     Inc(tmpPos,25);
   end;
end;
TagsNo tags attached.
Fixed in Revision46198
LazTarget1.4
WidgetsetQT
Attached Files

Relationships

related to 0024413 closedZeljan Rikalo Qt does not paint tbPushButtonDisabled 

Activities

Gabor Boros

2014-08-13 20:08

reporter  

Check_Qt_KDE.png (3,866 bytes)
Check_Qt_KDE.png (3,866 bytes)

Gabor Boros

2014-08-13 20:09

reporter  

Check_Qt_GNOME.png (2,032 bytes)
Check_Qt_GNOME.png (2,032 bytes)

Gabor Boros

2014-08-13 20:09

reporter  

Check_Qt_XP.png (1,740 bytes)
Check_Qt_XP.png (1,740 bytes)

Zeljan Rikalo

2014-08-27 13:46

developer   ~0076741

Please attach complete example project instead of pasting it here.

Gabor Boros

2014-08-31 12:32

reporter  

example.tar.gz (127,758 bytes)

Gabor Boros

2014-08-31 12:33

reporter  

example_results.zip (59,933 bytes)

Gabor Boros

2014-08-31 12:35

reporter   ~0076800

Example project and results uploaded.

Gabor Boros

2014-09-06 09:35

reporter   ~0076920

Last edited: 2014-09-06 09:36

View 2 revisions

Tried with Kubuntu 14.04.1 i386 and got same result.

Zeljan Rikalo

2014-09-06 11:25

developer   ~0076925

Indeed it looks wrong with oxygen (KDE 4 default theme) and plastique (KDE 3 default theme), but other themes are ok, so this could be Qt lib bug.
Must create pure Qt C++ application to check if it's true.

Gabor Boros

2014-09-10 20:32

reporter   ~0077068

If comment out line 210 in QtThemes.pas got all states disabled (disabled_states.png). So I think it is a Lazarus bug.

Gabor Boros

2014-09-10 20:32

reporter  

disabled_states.png (20,715 bytes)
disabled_states.png (20,715 bytes)

Gabor Boros

2014-09-11 12:24

reporter   ~0077082

The fix is:

Replace line 210 "if Details.State in [TS_DISABLED] then" in QtThemes.pas with "if Details.State in [CBS_UNCHECKEDDISABLED,CBS_CHECKEDDISABLED,CBS_MIXEDDISABLED] then"

Also needed PBS_DISABLED for QStyleCE_PushButton and CBS_UNCHECKEDDISABLED,RBS_CHECKEDDISABLED for QStyleCE_RadioButton but values are equal with CBS_ constants.

QStyleCE_CheckBox have two other states CBS_IMPLICITDISABLED, CBS_EXCLUDEDDISABLED. I don't know what importance this states.

Zeljan Rikalo

2014-09-12 08:57

developer   ~0077124

Please test and close if ok.

Gabor Boros

2014-09-12 13:58

reporter   ~0077147

Tested with trunk 46199.

Issue History

Date Modified Username Field Change
2014-08-13 20:08 Gabor Boros New Issue
2014-08-13 20:08 Gabor Boros File Added: Check_Qt_KDE.png
2014-08-13 20:09 Gabor Boros File Added: Check_Qt_GNOME.png
2014-08-13 20:09 Gabor Boros File Added: Check_Qt_XP.png
2014-08-17 18:38 Zeljan Rikalo Assigned To => Zeljan Rikalo
2014-08-17 18:38 Zeljan Rikalo Status new => assigned
2014-08-27 13:46 Zeljan Rikalo LazTarget => -
2014-08-27 13:46 Zeljan Rikalo Note Added: 0076741
2014-08-27 13:46 Zeljan Rikalo Status assigned => feedback
2014-08-31 12:32 Gabor Boros File Added: example.tar.gz
2014-08-31 12:33 Gabor Boros File Added: example_results.zip
2014-08-31 12:35 Gabor Boros Note Added: 0076800
2014-08-31 12:35 Gabor Boros Status feedback => assigned
2014-09-06 09:35 Gabor Boros Note Added: 0076920
2014-09-06 09:36 Gabor Boros Note Edited: 0076920 View Revisions
2014-09-06 11:25 Zeljan Rikalo Note Added: 0076925
2014-09-06 11:25 Zeljan Rikalo Status assigned => confirmed
2014-09-10 20:32 Gabor Boros Note Added: 0077068
2014-09-10 20:32 Gabor Boros File Added: disabled_states.png
2014-09-11 12:24 Gabor Boros Note Added: 0077082
2014-09-12 08:54 Zeljan Rikalo Relationship added related to 0024413
2014-09-12 08:57 Zeljan Rikalo Fixed in Revision => 46198
2014-09-12 08:57 Zeljan Rikalo LazTarget - => 1.4
2014-09-12 08:57 Zeljan Rikalo Note Added: 0077124
2014-09-12 08:57 Zeljan Rikalo Status confirmed => resolved
2014-09-12 08:57 Zeljan Rikalo Fixed in Version => 1.3 (SVN)
2014-09-12 08:57 Zeljan Rikalo Resolution open => fixed
2014-09-12 08:57 Zeljan Rikalo Target Version => 1.4
2014-09-12 13:58 Gabor Boros Note Added: 0077147
2014-09-12 13:58 Gabor Boros Status resolved => closed