Browse Source

fix volatile scrollbar background

johann 5 năm trước cách đây
mục cha
commit
f296b2e540
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      lazpaint/uvolatilescrollbar.pas

+ 7 - 1
lazpaint/uvolatilescrollbar.pas

@@ -185,8 +185,14 @@ end;
 
 procedure TVolatileScrollBar.Draw(ADest: TBGRABitmap);
 var lThumb: TRect; h: integer;
+  c: TBGRAPixel;
 begin
-  ADest.FillRect(FBounds,ColorToBGRA(ColorToRGB(clBtnFace),192),dmDrawWithTransparency);
+  if GetLightness(ColorToBGRA(clWindow)) >= 32768 then
+    c := ColorToBGRA(clBlack,48)
+  else
+    c := ColorToBGRA(clWhite,48);
+
+  ADest.FillRect(FBounds,c,dmDrawWithTransparency);
   lThumb := GetScrollThumbBounds;
   if FScrollThumbDown then
     h := -3