瀏覽代碼

fix focus rect

Johann ELSASS 5 年之前
父節點
當前提交
2aff519119
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      bgrasvgtheme.pas

+ 11 - 2
bgrasvgtheme.pas

@@ -522,6 +522,7 @@ var
   Style: TTextStyle;
   Style: TTextStyle;
   svg: TBGRASVG;
   svg: TBGRASVG;
   color: string;
   color: string;
+  r: TRect;
 begin
 begin
   with ASurface do
   with ASurface do
   begin
   begin
@@ -546,8 +547,16 @@ begin
 
 
     if Focused then
     if Focused then
     begin
     begin
-      DestCanvas.Pen.Color := clBlack;
-      DestCanvas.Rectangle(ARect);
+      DestCanvas.Pen.Color := Canvas.Font.Color;
+      DestCanvas.Pen.Style := psDash;
+      DestCanvas.Brush.Style := bsClear;
+      r := ARect;
+      r.Inflate(-ScaleForCanvas(FButtonSliceScalingLeft),
+        -ScaleForCanvas(FButtonSliceScalingTop),
+        -ScaleForCanvas(FButtonSliceScalingRight),
+        -ScaleForCanvas(FButtonSliceScalingBottom));
+      DestCanvas.Rectangle(r);
+      DestCanvas.Pen.Style := psSolid;
     end;
     end;
 
 
     if Caption <> '' then
     if Caption <> '' then