Selaa lähdekoodia

Book dialog UI polish: align buttons, add 'Change Cover' button, and improve affordance

- Align Save/Cancel to bottom-right and anchor them\n- Fix ClientWidth mismatch\n- Add 'Change Cover...' button under the cover preview\n- Make cover image show hand cursor and hint to indicate clickability\n- Align runtime 'Lookup' button with ISBN field height/position
Codex CLI 4 kuukautta sitten
vanhempi
sitoutus
82845bf124
2 muutettua tiedostoa jossa 25 lisäystä ja 5 poistoa
  1. 17 3
      src/unitbookdialog.lfm
  2. 8 2
      src/unitbookdialog.pas

+ 17 - 3
src/unitbookdialog.lfm

@@ -7,7 +7,7 @@ object BookEditDialog: TBookEditDialog
   BorderStyle = bsDialog
   Caption = 'Edit Book Info'
   ClientHeight = 347
-  ClientWidth = 856
+  ClientWidth = 806
   FormStyle = fsStayOnTop
   OnCreate = FormCreate
   LCLVersion = '1.6.4.0'
@@ -45,21 +45,23 @@ object BookEditDialog: TBookEditDialog
     Text = 'File Path'
   end
   object ButtonSave: TBitBtn
-    Left = 298
+    Left = 636
     Height = 30
     Top = 296
     Width = 75
     Caption = '&Save'
     OnClick = ButtonSaveClick
+    Anchors = [akRight, akBottom]
     TabOrder = 4
   end
   object ButtonCancel: TBitBtn
-    Left = 434
+    Left = 716
     Height = 30
     Top = 296
     Width = 75
     Caption = '&Cancel'
     OnClick = ButtonCancelClick
+    Anchors = [akRight, akBottom]
     TabOrder = 5
   end
   object Panel1: TPanel
@@ -78,9 +80,21 @@ object BookEditDialog: TBookEditDialog
       Top = 0
       Width = 182
       OnClick = ImageBookCoverClick
+      Cursor = crHandPoint
+      ShowHint = True
+      Hint = 'Click to change cover'
       Stretch = True
     end
   end
+  object ButtonChangeCover: TButton
+    Left = 24
+    Height = 28
+    Top = 264
+    Width = 182
+    Caption = 'Change Cover...'
+    OnClick = ImageBookCoverClick
+    TabOrder = 8
+  end
   object EditImagePath: TEdit
     Left = 329
     Height = 29

+ 8 - 2
src/unitbookdialog.pas

@@ -65,9 +65,16 @@ begin
   ButtonLookup := TButton.Create(Self);
   ButtonLookup.Parent := Self;
   ButtonLookup.Caption := 'Lookup';
-  ButtonLookup.Top := EditISBN.Top - 2;
+  ButtonLookup.Top := EditISBN.Top;
   ButtonLookup.Left := EditISBN.Left + EditISBN.Width + 8;
+  ButtonLookup.Height := EditISBN.Height;
+  ButtonLookup.Anchors := [akTop, akRight];
   ButtonLookup.OnClick := @ButtonLookupClick;
+
+  // Make it obvious the cover can be changed
+  ImageBookCover.Cursor := crHandPoint;
+  ImageBookCover.ShowHint := True;
+  ImageBookCover.Hint := 'Click to change cover';
 End;
 
 procedure TBookEditDialog.ButtonLookupClick(Sender: TObject);
@@ -273,4 +280,3 @@ begin
 end;
 
 end.
-