1
0
Эх сурвалжийг харах

Bug fix: When system theme changed path labels lost their background color

Source commit: dbd8ea776a0ec1d6aa6508c4773034b321262c6f
Martin Prikryl 7 жил өмнө
parent
commit
4dc8b78a55

+ 16 - 0
source/packages/my/PathLabel.pas

@@ -64,6 +64,7 @@ type
     procedure DoMaskClick;
     procedure DblClick; override;
     procedure DoContextPopup(MousePos: TPoint; var Handled: Boolean); override;
+    procedure CMStyleChanged(var Message: TMessage); message CM_STYLECHANGED;
 
   public
     constructor Create(AnOwner: TComponent); override;
@@ -933,4 +934,19 @@ begin
   inherited;
 end;
 
+procedure TCustomPathLabel.CMStyleChanged(var Message: TMessage);
+var
+  WasNotTransparent: Boolean;
+begin
+  // WORKAROUND for what seems like a bug in TCustomLabel.CMStyleChanged that unconditionally sets Transparent := True,
+  // when styling is enabled
+  WasNotTransparent := not Transparent;
+  inherited;
+  if WasNotTransparent then
+  begin
+    Transparent := False;
+    Invalidate;
+  end;
+end;
+
 end.