mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 16:39:15 +02:00
Qt: workaround for Qt lib bug (QStyle) where disabled button doesn't have activated disabled colors palette. issue #24413
git-svn-id: trunk@41144 -
This commit is contained in:
parent
910bf5ba13
commit
8a5bc81356
@ -134,6 +134,7 @@ var
|
|||||||
ClipR: TRect; // fix branch indicators (treeviews)
|
ClipR: TRect; // fix branch indicators (treeviews)
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
dx, dy: integer;
|
dx, dy: integer;
|
||||||
|
APalette: QPaletteH;
|
||||||
begin
|
begin
|
||||||
if (Context <> nil) then
|
if (Context <> nil) then
|
||||||
begin
|
begin
|
||||||
@ -178,6 +179,21 @@ begin
|
|||||||
if Details.Element = teToolBar then
|
if Details.Element = teToolBar then
|
||||||
Features := Features or QStyleOptionButtonFlat;
|
Features := Features or QStyleOptionButtonFlat;
|
||||||
QStyleOptionButton_setFeatures(QStyleOptionButtonH(opt), Features);
|
QStyleOptionButton_setFeatures(QStyleOptionButtonH(opt), Features);
|
||||||
|
|
||||||
|
// workaround for qt QStyle bug. QStyle does not set disable flag (palette).
|
||||||
|
// see issue #24413
|
||||||
|
if Details.State in [TS_DISABLED] then
|
||||||
|
begin
|
||||||
|
APalette := QPalette_create();
|
||||||
|
try
|
||||||
|
QStyleOption_palette(opt, APalette);
|
||||||
|
QPalette_setCurrentColorGroup(APalette, QPaletteDisabled);
|
||||||
|
QStyleOption_setPalette(opt, APalette);
|
||||||
|
finally
|
||||||
|
QPalette_destroy(APalette);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (Element.ControlElement = QStyleCE_HeaderSection) then
|
if (Element.ControlElement = QStyleCE_HeaderSection) then
|
||||||
|
Loading…
Reference in New Issue
Block a user