mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 06:28:28 +02:00
Qt,Qt5,Qt6: Fixed result of TQtWidgetSet.DrawFrameControl. Issue #40380
This commit is contained in:
parent
c7cef13c39
commit
0878535faa
@ -1212,13 +1212,14 @@ var
|
||||
//DFCS_MONO = 32768;
|
||||
end;
|
||||
|
||||
procedure DrawButton;
|
||||
function DrawButton: boolean;
|
||||
var
|
||||
Opt: QStyleOptionButtonH;
|
||||
Element: QStyleControlElement;
|
||||
State: QStyleState;
|
||||
Features: QStyleOptionButtonButtonFeatures;
|
||||
begin
|
||||
Result := False;
|
||||
State := uStatetoQStyleState;
|
||||
if uState and DFCS_FLAT <> 0 then
|
||||
Features := QStyleOptionButtonFlat
|
||||
@ -1248,14 +1249,16 @@ var
|
||||
QStyleOption_setState(Opt, State);
|
||||
QStyle_drawControl(QApplication_style(), Element, Opt, Painter, Widget);
|
||||
QStyleOptionButton_destroy(Opt);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
procedure DrawScrollBarArrows;
|
||||
function DrawScrollBarArrows: boolean;
|
||||
var
|
||||
Opt: QStyleOptionH;
|
||||
Element: QStylePrimitiveElement;
|
||||
State: QStyleState;
|
||||
begin
|
||||
Result := False;
|
||||
//TODO: DFCS_SCROLLCOMBOBOX and DFCS_SCROLLSIZEGRIP
|
||||
State := uStatetoQStyleState;
|
||||
Element := QStylePE_CustomBase;
|
||||
@ -1278,6 +1281,7 @@ var
|
||||
QStyleOption_setState(Opt, State);
|
||||
QStyle_drawPrimitive(QApplication_style(), Element, Opt, Painter, Widget);
|
||||
QStyleOption_destroy(Opt);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
begin
|
||||
@ -1288,10 +1292,10 @@ begin
|
||||
Painter := QtDC.Widget;
|
||||
Widget := QtDC.Parent;
|
||||
case uType of
|
||||
DFC_BUTTON: DrawButton;
|
||||
DFC_BUTTON: Result := DrawButton;
|
||||
DFC_CAPTION: ; // title bar captions
|
||||
DFC_MENU: ; // menu
|
||||
DFC_SCROLL: DrawScrollBarArrows;
|
||||
DFC_SCROLL: Result := DrawScrollBarArrows;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1205,13 +1205,14 @@ var
|
||||
//DFCS_MONO = 32768;
|
||||
end;
|
||||
|
||||
procedure DrawButton;
|
||||
function DrawButton: boolean;
|
||||
var
|
||||
Opt: QStyleOptionButtonH;
|
||||
Element: QStyleControlElement;
|
||||
State: QStyleState;
|
||||
Features: QStyleOptionButtonButtonFeatures;
|
||||
begin
|
||||
Result := False;
|
||||
State := uStatetoQStyleState;
|
||||
if uState and DFCS_FLAT <> 0 then
|
||||
Features := QStyleOptionButtonFlat
|
||||
@ -1241,14 +1242,16 @@ var
|
||||
QStyleOption_setState(Opt, State);
|
||||
QStyle_drawControl(QApplication_style(), Element, Opt, Painter, Widget);
|
||||
QStyleOptionButton_destroy(Opt);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
procedure DrawScrollBarArrows;
|
||||
function DrawScrollBarArrows: boolean;
|
||||
var
|
||||
Opt: QStyleOptionH;
|
||||
Element: QStylePrimitiveElement;
|
||||
State: QStyleState;
|
||||
begin
|
||||
Result := False;
|
||||
//TODO: DFCS_SCROLLCOMBOBOX and DFCS_SCROLLSIZEGRIP
|
||||
State := uStatetoQStyleState;
|
||||
Element := QStylePE_CustomBase;
|
||||
@ -1271,6 +1274,7 @@ var
|
||||
QStyleOption_setState(Opt, State);
|
||||
QStyle_drawPrimitive(QApplication_style(), Element, Opt, Painter, Widget);
|
||||
QStyleOption_destroy(Opt);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
begin
|
||||
@ -1281,10 +1285,10 @@ begin
|
||||
Painter := QtDC.Widget;
|
||||
Widget := QtDC.Parent;
|
||||
case uType of
|
||||
DFC_BUTTON: DrawButton;
|
||||
DFC_BUTTON: Result := DrawButton;
|
||||
DFC_CAPTION: ; // title bar captions
|
||||
DFC_MENU: ; // menu
|
||||
DFC_SCROLL: DrawScrollBarArrows;
|
||||
DFC_SCROLL: Result := DrawScrollBarArrows;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1207,13 +1207,14 @@ var
|
||||
//DFCS_MONO = 32768;
|
||||
end;
|
||||
|
||||
procedure DrawButton;
|
||||
function DrawButton: boolean;
|
||||
var
|
||||
Opt: QStyleOptionButtonH;
|
||||
Element: QStyleControlElement;
|
||||
State: QStyleState;
|
||||
Features: QStyleOptionButtonButtonFeatures;
|
||||
begin
|
||||
Result := False;
|
||||
State := uStatetoQStyleState;
|
||||
if uState and DFCS_FLAT <> 0 then
|
||||
Features := QStyleOptionButtonFlat
|
||||
@ -1243,14 +1244,16 @@ var
|
||||
QStyleOption_setState(Opt, State);
|
||||
QStyle_drawControl(QApplication_style(), Element, Opt, Painter, Widget);
|
||||
QStyleOptionButton_destroy(Opt);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
procedure DrawScrollBarArrows;
|
||||
function DrawScrollBarArrows: boolean;
|
||||
var
|
||||
Opt: QStyleOptionH;
|
||||
Element: QStylePrimitiveElement;
|
||||
State: QStyleState;
|
||||
begin
|
||||
Result := False;
|
||||
//TODO: DFCS_SCROLLCOMBOBOX and DFCS_SCROLLSIZEGRIP
|
||||
State := uStatetoQStyleState;
|
||||
Element := QStylePE_CustomBase;
|
||||
@ -1273,6 +1276,7 @@ var
|
||||
QStyleOption_setState(Opt, State);
|
||||
QStyle_drawPrimitive(QApplication_style(), Element, Opt, Painter, Widget);
|
||||
QStyleOption_destroy(Opt);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
begin
|
||||
@ -1283,10 +1287,10 @@ begin
|
||||
Painter := QtDC.Widget;
|
||||
Widget := QtDC.Parent;
|
||||
case uType of
|
||||
DFC_BUTTON: DrawButton;
|
||||
DFC_BUTTON: Result := DrawButton;
|
||||
DFC_CAPTION: ; // title bar captions
|
||||
DFC_MENU: ; // menu
|
||||
DFC_SCROLL: DrawScrollBarArrows;
|
||||
DFC_SCROLL: Result := DrawScrollBarArrows;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user