Qt5: fixed themed text draw of selected treeview item.

This commit is contained in:
zeljan1 2025-01-12 15:28:36 +01:00
parent b348ac054c
commit 395b854b3c

View File

@ -695,7 +695,17 @@ begin
QPainter_fillRect(Context.Widget, @TextRect, QtSolidPattern);
end;
end;
{$IFDEF MSWINDOWS}
if StyleName = 'windowsvista' then // fix for text of selected treeitem.
begin
if (Palette <> nil) and (QPalette_currentColorGroup(Palette) = QPaletteActive) then
begin
AQColor := Default(TQColor);
ColorRefToTQColor(ColorToRGB(clWindowText), AQColor);
QPalette_setColor(Palette, QPaletteHighlightedText, PQColor(@AQColor));
end;
end;
{$ENDIF}
QStyle_drawItemText(Style, Context.Widget, @R,
DTFlagsToQtFlags(Flags), Palette,
not IsDisabled(Details), @W, QPaletteHighlightedText)