Forráskód Böngészése

fix volatile scrollbar background

johann 5 éve
szülő
commit
f296b2e540
1 módosított fájl, 7 hozzáadás és 1 törlés
  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