Qt5, Qt6: allow background color of TTabSheet just like in win32,gtk2 and gtk3. Fixed setting font of TTabSheet.

This commit is contained in:
zeljan1 2025-02-25 14:53:46 +01:00
parent 3a75d77348
commit bfc45a589a
6 changed files with 18 additions and 4 deletions

View File

@ -88,7 +88,8 @@ class procedure TQtWSCustomPage.SetFont(const AWinControl: TWinControl;
begin
if not WSCheckHandleAllocated(AWinControl, 'SetFont') then
Exit;
inherited SetFont(AWinControl, AFont);
TQtWSWinControl.SetFont(AWinControl, AFont);
UpdateTabFontColor(TCustomPage(AWinControl), AFont);
end;

View File

@ -1920,6 +1920,7 @@ type
FIcon: QIconH;
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
public
function CanPaintBackground: Boolean; override;
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
function getIcon: QIconH;
function getIndex(const ATextChanging: Boolean = False): Integer;
@ -18803,6 +18804,11 @@ begin
Result := QWidget_create(Parent);
end;
function TQtPage.CanPaintBackground: Boolean;
begin
Result := CanSendLCLMessage and (LCLObject.Color <> clDefault);
end;
function TQtPage.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
var
ASize: TSize;

View File

@ -31,7 +31,7 @@ uses
ComCtrls, Controls, LCLType, Graphics, StdCtrls,
LCLIntf, Forms, ImgList,
// Widgetset
WSProc, WSComCtrls, WSLCLClasses;
WSProc, WSComCtrls, WSLCLClasses, QtWSControls;
type
{ TQtWSCustomPage }

View File

@ -88,7 +88,8 @@ class procedure TQtWSCustomPage.SetFont(const AWinControl: TWinControl;
begin
if not WSCheckHandleAllocated(AWinControl, 'SetFont') then
Exit;
inherited SetFont(AWinControl, AFont);
TQtWSWinControl.SetFont(AWinControl, AFont);
UpdateTabFontColor(TCustomPage(AWinControl), AFont);
end;

View File

@ -1920,6 +1920,7 @@ type
FIcon: QIconH;
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
public
function CanPaintBackground: Boolean; override;
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
function getIcon: QIconH;
function getIndex(const ATextChanging: Boolean = False): Integer;
@ -18720,6 +18721,11 @@ begin
Result := QWidget_create(Parent);
end;
function TQtPage.CanPaintBackground: Boolean;
begin
Result := CanSendLCLMessage and (LCLObject.Color <> clDefault);
end;
function TQtPage.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
var
ASize: TSize;

View File

@ -29,7 +29,7 @@ uses
SysUtils, Classes, Types, ComCtrls, Controls, LCLType, Graphics, StdCtrls,
LCLIntf, Forms, ImgList,
// Widgetset
WSProc, WSComCtrls, WSLCLClasses;
WSProc, WSComCtrls, WSLCLClasses, QtWSControls;
type
{ TQtWSCustomPage }