Explorar el Código

FIX: Bug [0001128] Long file names in "Synchronize directories" window overlap "Date" columns (#147)

jack2m hace 4 años
padre
commit
51c3038ef9
Se han modificado 1 ficheros con 19 adiciones y 7 borrados
  1. 19 7
      src/fsyncdirsdlg.pas

+ 19 - 7
src/fsyncdirsdlg.pas

@@ -845,7 +845,9 @@ begin
       FillRect(aRect);
       FillRect(aRect);
       Font.Bold := True;
       Font.Bold := True;
       Font.Color := clWindowText;
       Font.Color := clWindowText;
-      TextOut(aRect.Left + 2, aRect.Top + 2, FVisibleItems[aRow]);
+      with hCols[0] do
+        TextRect(Rect(Left, aRect.Top, Left + Width, aRect.Bottom),
+          Left + 2, aRect.Top + 2, FVisibleItems[aRow]);
     end else begin
     end else begin
       case r.FState of
       case r.FState of
       srsNotEq:       Font.Color := gSyncUnknownColor;
       srsNotEq:       Font.Color := gSyncUnknownColor;
@@ -857,10 +859,15 @@ begin
       end;
       end;
       if Assigned(r.FFileL) then
       if Assigned(r.FFileL) then
       begin
       begin
-        TextOut(aRect.Left + 2, aRect.Top + 2, FVisibleItems[aRow]);
+        with hCols[0] do
+          TextRect(Rect(Left, aRect.Top, Left + Width, aRect.Bottom),
+            Left + 2, aRect.Top + 2, FVisibleItems[aRow]);
         s := IntToStr(r.FFileL.Size);
         s := IntToStr(r.FFileL.Size);
-        x := hCols[1].Left + hCols[1].Width - 2 - TextWidth(s);
-        TextOut(x, aRect.Top + 2, s);
+        with hCols[1] do begin
+          x := Left + Width - 8 - TextWidth(s);
+          TextRect(Rect(Left, aRect.Top, Left + Width, aRect.Bottom),
+            x, aRect.Top + 2, s);
+        end;
         s := DateTimeToStr(r.FFileL.ModificationTime);
         s := DateTimeToStr(r.FFileL.ModificationTime);
         with hCols[2] do
         with hCols[2] do
           TextRect(Rect(Left, aRect.Top, Left + Width, aRect.Bottom),
           TextRect(Rect(Left, aRect.Top, Left + Width, aRect.Bottom),
@@ -868,10 +875,15 @@ begin
       end;
       end;
       if Assigned(r.FFileR) then
       if Assigned(r.FFileR) then
       begin
       begin
-        TextOut(hCols[6].Left + 2, aRect.Top + 2, FVisibleItems[aRow]);
+        with hCols[6] do
+          TextRect(Rect(Left, aRect.Top, Left + Width, aRect.Bottom),
+            Left + 2, aRect.Top + 2, FVisibleItems[aRow]);
         s := IntToStr(r.FFileR.Size);
         s := IntToStr(r.FFileR.Size);
-        x := hCols[5].Left + hCols[5].Width - 2 - TextWidth(s);
-        TextOut(x, aRect.Top + 2, s);
+        with hCols[5] do begin
+          x := Left + Width - 8 - TextWidth(s);
+          TextRect(Rect(Left, aRect.Top, Left + Width, aRect.Bottom),
+            x, aRect.Top + 2, s);
+        end;
         s := DateTimeToStr(r.FFileR.ModificationTime);
         s := DateTimeToStr(r.FFileR.ModificationTime);
         with hCols[4] do
         with hCols[4] do
           TextRect(Rect(Left, aRect.Top, Left + Width, aRect.Bottom),
           TextRect(Rect(Left, aRect.Top, Left + Width, aRect.Bottom),