FIX: Workaround - missing arrows on the toolbar buttons under Qt6 (issue #2750)

This commit is contained in:
Alexander Koblov 2026-05-30 18:33:35 +03:00
commit 7af7de1d8a

View file

@ -5,7 +5,7 @@ unit Interfaces;
interface
uses
InterfaceBase, LCLType, Themes, QtInt, QtThemes, Types, uWayland;
InterfaceBase, LCLType, Themes, QtInt, QtThemes, Types, LCLVersion, uWayland;
type
@ -14,6 +14,9 @@ type
TQtThemeServicesEx = class(TQtThemeServices)
public
function GetStockImage(StockID: LongInt; out Image, Mask: HBitmap): Boolean; override;
{$if lcl_fullversion < 4990000}
procedure DrawElement(DC: HDC; Details: TThemedElementDetails; const R: TRect; ClipRect: PRect = nil); override;
{$endif}
end;
{ TQtWidgetSetEx }
@ -37,7 +40,11 @@ var
implementation
uses
SysUtils, Forms, Graphics, GraphUtil, qtobjects, qt6, DCStrUtils, DCUnix;
SysUtils, Forms, Graphics, GraphUtil, qtobjects, qt6, DCStrUtils, DCUnix
{$if lcl_fullversion < 4990000}
, LCLIntf, TmSchema
{$endif}
;
{ TQtThemeServicesEx }
@ -46,6 +53,21 @@ begin
Result:= False;
end;
{$if lcl_fullversion < 4990000}
procedure TQtThemeServicesEx.DrawElement(DC: HDC; Details: TThemedElementDetails; const R: TRect; ClipRect: PRect);
var
ARect: TRect;
begin
inherited DrawElement(DC, Details, R, ClipRect);
if (Details.Element = teToolBar) and (Details.Part = TP_SPLITBUTTONDROPDOWN) then
begin
ARect:= R;
DrawText(DC, Details, '▾', ARect, DT_CENTER or DT_VCENTER or DT_SINGLELINE, 0);
end;
end;
{$endif}
{ TQtWidgetSetEx }
function TQtWidgetSetEx.CreateThemeServices: TThemeServices;