LCL: fixed TSpeedButton positioning of glyphs if widgetset has ContentRect

git-svn-id: trunk@29172 -
This commit is contained in:
mattias 2011-01-23 15:40:43 +00:00
parent b0ba957d32
commit 75d084a8ed

View File

@ -514,8 +514,6 @@ begin
DrawDetails := GetDrawDetails;
ClientSize.cx:= PaintRect.Right - PaintRect.Left;
ClientSize.cy:= PaintRect.Bottom - PaintRect.Top;
PreferredWidth:=0;
PreferredHeight:=0;
@ -528,7 +526,9 @@ begin
FixedWidth:=WidthIsAnchored;
FixedHeight:=HeightIsAnchored;
end;
ClientSize.cx:= PaintRect.Right - PaintRect.Left;
ClientSize.cy:= PaintRect.Bottom - PaintRect.Top;
//debugln(['TCustomSpeedButton.MeasureDraw AAA1 ',DbgSName(Self),' PaintRect=',dbgs(PaintRect)]);
// compute size of glyph
GlyphSize := GetGlyphSize(Draw,PaintRect);
GlyphWidth := GlyphSize.CX;
@ -536,10 +536,11 @@ begin
GlyphWidth:=GlyphWidth div NumGlyphs;
GlyphHeight := GlyphSize.CY;
HasGlyph:=(GlyphWidth<>0) and (GlyphHeight<>0);
//debugln(['TCustomSpeedButton.MeasureDraw AAA2 ',DbgSName(Self),' PaintRect=',dbgs(PaintRect),' GlyphSize=',GlyphWidth,'x',GlyphHeight]);
// compute size of text
CurLayout:=BidiAdjustButtonLayout(UseRightToLeftReading, Layout);
if Caption<>'' then begin
if ShowCaption and (Caption<>'') then begin
TextRect:=PaintRect;
// for wordbreak compute the maximum size for the text
if Margin>0 then
@ -628,6 +629,8 @@ begin
end;
end;
//debugln(['TCustomSpeedButton.MeasureDraw AAA3 ',DbgSName(Self),' PaintRect=',dbgs(PaintRect),' GlyphSize=',GlyphWidth,'x',GlyphHeight,' TextSize=',TextSize.cx,'x',TextSize.cy,' S=',S,' M=',M]);
if Draw then
begin
case CurLayout of