mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:59:17 +02:00
Qt5: fixed drawing of TSpeedButton.Flat=true when mouse over. issue #38356
git-svn-id: trunk@64716 -
This commit is contained in:
parent
1ff32ae62f
commit
0f32d7c396
@ -137,6 +137,8 @@ var
|
|||||||
dx, dy: integer;
|
dx, dy: integer;
|
||||||
APalette: QPaletteH;
|
APalette: QPaletteH;
|
||||||
W: WideString;
|
W: WideString;
|
||||||
|
ABgColor: TQColor;
|
||||||
|
Alpha: Word;
|
||||||
|
|
||||||
procedure DrawSplitterInternal;
|
procedure DrawSplitterInternal;
|
||||||
var
|
var
|
||||||
@ -442,6 +444,27 @@ begin
|
|||||||
begin
|
begin
|
||||||
opt := QStyleOptionFrame_create();
|
opt := QStyleOptionFrame_create();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
QStylePE_PanelButtonTool:
|
||||||
|
begin
|
||||||
|
opt := QStyleOption_create(Ord(QStyleOptionVersion), Ord(QStyleOptionSO_Default));
|
||||||
|
//issue #38356 - when button is in hot state bg color should be same as parent color.
|
||||||
|
if Assigned(Context.Parent) and
|
||||||
|
(StyleState and QStyleState_MouseOver <> 0) and (StyleState and QStyleState_AutoRaise = 0) then
|
||||||
|
begin
|
||||||
|
ABgColor := QBrush_color(QPainter_brush(Context.Widget))^;
|
||||||
|
Alpha := ABgColor.Alpha;
|
||||||
|
APalette := QPalette_Create(QWidget_palette(Context.Parent));
|
||||||
|
ColorRefToTQColor(ColorToRGB(Context.GetBkColor), ABgColor);
|
||||||
|
ABgColor.Alpha := Alpha;
|
||||||
|
ABrush := QBrush_create(PQColor(@ABgColor));
|
||||||
|
QPalette_setBrush(APalette, QPaletteAll, QPaletteButton, ABrush);
|
||||||
|
QStyleOption_setPalette(opt, APalette);
|
||||||
|
QBrush_destroy(ABrush);
|
||||||
|
QPalette_destroy(APalette);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
QStylePE_IndicatorBranch:
|
QStylePE_IndicatorBranch:
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user