Qt: bugfix for #13083

git-svn-id: trunk@19073 -
This commit is contained in:
zeljko 2009-03-23 13:00:08 +00:00
parent 45c85c3a98
commit 8c2e23e096
2 changed files with 100 additions and 86 deletions

View File

@ -1930,8 +1930,13 @@ begin
end;
if lineWidth > 1 then
q_DrawWinPanel(Widget, x, y, w, h, Palette, Sunken, FillBrush)
else
begin
if FillBrush = nil then
q_DrawShadePanel(Widget, x, y, w, h, Palette, Sunken, 1, QPalette_background(Palette))
else
q_DrawShadePanel(Widget, x, y, w, h, Palette, Sunken, 1, FillBrush);
end;
end;
{------------------------------------------------------------------------------

View File

@ -114,9 +114,17 @@ var
Element: TQtDrawElement;
Features: QStyleOptionButtonButtonFeatures;
Position: QStyleOptionHeaderSectionPosition;
Palette: QPaletteH;
begin
if (Context <> nil) then
begin
Context.save;
try
if Context.Parent <> nil then
begin
Palette := QWidget_palette(Context.Parent);
QPainter_setBackground(Context.Widget, QPalette_background(Palette));
end;
ARect := R;
Element := GetDrawElement(Details);
case Element.DrawVariant of
@ -155,7 +163,6 @@ begin
end;
qdvComplexControl:
begin
Context.save;
case Element.ComplexControl of
QStyleCC_ToolButton: opt := QStyleOptionToolButton_create();
@ -184,7 +191,6 @@ begin
QStyleOption_setRect(opt, @ARect);
QStyle_drawComplexControl(Style, Element.ComplexControl, QStyleOptionComplexH(opt), Context.Widget);
QStyleOption_Destroy(opt);
Context.restore;
end;
qdvPrimitive:
begin
@ -211,6 +217,9 @@ begin
QStyleOption_Destroy(opt);
end;
end;
finally
Context.restore;
end;
end;
end;