Qt: fixed another regression introduced with r43385 and r43386 #3af257647d

git-svn-id: trunk@43387 -
This commit is contained in:
zeljko 2013-11-07 10:20:22 +00:00
parent 3af257647d
commit b25aa3842e

View File

@ -421,19 +421,29 @@ procedure TQtThemeServices.DrawText(ACanvas: TPersistent;
var
AQColor, AOldColor: TQColor;
B: Boolean;
OldCanvasFontColor: TColor;
begin
B := False;
if (TCanvas(ACanvas).Font.Color <> clDefault) then
// issue #25253
if (Details.Element in [teButton, teComboBox]) then
begin
// issue #25253
B := True;
AOldColor := TQtDeviceContext(TCanvas(ACanvas).Handle).pen.getColor;
OldCanvasFontColor := TCanvas(ACanvas).Font.Color;
if TCanvas(ACanvas).Font.Color = clDefault then
TCanvas(ACanvas).Font.Color := clBtnText;
ColorRefToTQColor(ColorToRGB(TCanvas(ACanvas).Font.Color), AQColor);
TQtDeviceContext(TCanvas(ACanvas).Handle).pen.setColor(AQColor);
end;
DrawText(TCanvas(ACanvas).Handle, Details, S, R, Flags, Flags2);
if B then
begin
TQtDeviceContext(TCanvas(ACanvas).Handle).pen.setColor(AOldColor);
TCanvas(ACanvas).Font.Color := OldCanvasFontColor;
end;
end;
procedure TQtThemeServices.DrawText(DC: HDC; Details: TThemedElementDetails;
@ -556,7 +566,9 @@ begin
QApplication_palette(Palette);
end;
try
AQColor := TQtDeviceContext(DC).pen.getColor; // issue #25253
if Details.Element in [teButton, teComboBox] then
AQColor := TQtDeviceContext(DC).pen.getColor; // issue #25253
if Details.Element in [teEdit, teListView, teTreeView, teWindow] then
ATextPalette := QPaletteWindowText
else
@ -565,7 +577,8 @@ begin
else
ATextPalette := QPaletteText;
QPalette_setColor(Palette, ATextPalette, @AQColor); // issue #25253
if Details.Element in [teButton, teComboBox] then
QPalette_setColor(Palette, ATextPalette, @AQColor); // issue #25253
QStyle_drawItemText(Style, Context.Widget, @R,
DTFlagsToQtFlags(Flags), Palette,