mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 10:00:26 +02:00
Qt: fixed another regression introduced with r43385 and r43386 #3af257647d
git-svn-id: trunk@43387 -
This commit is contained in:
parent
3af257647d
commit
b25aa3842e
@ -421,19 +421,29 @@ procedure TQtThemeServices.DrawText(ACanvas: TPersistent;
|
|||||||
var
|
var
|
||||||
AQColor, AOldColor: TQColor;
|
AQColor, AOldColor: TQColor;
|
||||||
B: Boolean;
|
B: Boolean;
|
||||||
|
OldCanvasFontColor: TColor;
|
||||||
begin
|
begin
|
||||||
B := False;
|
B := False;
|
||||||
if (TCanvas(ACanvas).Font.Color <> clDefault) then
|
|
||||||
|
// issue #25253
|
||||||
|
if (Details.Element in [teButton, teComboBox]) then
|
||||||
begin
|
begin
|
||||||
// issue #25253
|
|
||||||
B := True;
|
B := True;
|
||||||
AOldColor := TQtDeviceContext(TCanvas(ACanvas).Handle).pen.getColor;
|
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);
|
ColorRefToTQColor(ColorToRGB(TCanvas(ACanvas).Font.Color), AQColor);
|
||||||
TQtDeviceContext(TCanvas(ACanvas).Handle).pen.setColor(AQColor);
|
TQtDeviceContext(TCanvas(ACanvas).Handle).pen.setColor(AQColor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DrawText(TCanvas(ACanvas).Handle, Details, S, R, Flags, Flags2);
|
DrawText(TCanvas(ACanvas).Handle, Details, S, R, Flags, Flags2);
|
||||||
|
|
||||||
if B then
|
if B then
|
||||||
|
begin
|
||||||
TQtDeviceContext(TCanvas(ACanvas).Handle).pen.setColor(AOldColor);
|
TQtDeviceContext(TCanvas(ACanvas).Handle).pen.setColor(AOldColor);
|
||||||
|
TCanvas(ACanvas).Font.Color := OldCanvasFontColor;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TQtThemeServices.DrawText(DC: HDC; Details: TThemedElementDetails;
|
procedure TQtThemeServices.DrawText(DC: HDC; Details: TThemedElementDetails;
|
||||||
@ -556,7 +566,9 @@ begin
|
|||||||
QApplication_palette(Palette);
|
QApplication_palette(Palette);
|
||||||
end;
|
end;
|
||||||
try
|
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
|
if Details.Element in [teEdit, teListView, teTreeView, teWindow] then
|
||||||
ATextPalette := QPaletteWindowText
|
ATextPalette := QPaletteWindowText
|
||||||
else
|
else
|
||||||
@ -565,7 +577,8 @@ begin
|
|||||||
else
|
else
|
||||||
ATextPalette := QPaletteText;
|
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,
|
QStyle_drawItemText(Style, Context.Widget, @R,
|
||||||
DTFlagsToQtFlags(Flags), Palette,
|
DTFlagsToQtFlags(Flags), Palette,
|
||||||
|
Loading…
Reference in New Issue
Block a user