Browse Source

Better formatting of feature list on Interface page of Preferences dialog

Source commit: 9c0f6f26009f6c0edf9acfde77057c2bc1409539
Martin Prikryl 3 years ago
parent
commit
5814263e99
3 changed files with 19 additions and 0 deletions
  1. 1 0
      deployment/winscpsetup.iss
  2. 17 0
      source/forms/Preferences.cpp
  3. 1 0
      source/forms/Preferences.h

+ 1 - 0
deployment/winscpsetup.iss

@@ -816,6 +816,7 @@ begin
   Result := True;
 end;
 
+// Keep in sync with similar function on Preferences dialog
 function Bullet(S: string): string;
 begin
   if Copy(S, 1, 1) = '-' then S := #$2022'  ' + Trim(Copy(S, 2, Length(S) - 1));

+ 17 - 0
source/forms/Preferences.cpp

@@ -132,6 +132,9 @@ __fastcall TPreferencesDialog::TPreferencesDialog(
 
   QueueTransferLimitEdit->MaxValue = WinConfiguration->QueueTransferLimitMax;
 
+  CommanderDescriptionLabel2->Caption = Bullet(CommanderDescriptionLabel2->Caption);
+  ExplorerDescriptionLabel->Caption = Bullet(ExplorerDescriptionLabel->Caption);
+
   if (IsUWP())
   {
     UpdatesSheet->Caption = LoadStr(PREFERENCES_STATISTICS_CAPTION);
@@ -3235,3 +3238,17 @@ void __fastcall TPreferencesDialog::LocalPortNumberMaxEditExit(TObject *)
   }
 }
 //---------------------------------------------------------------------------
+UnicodeString TPreferencesDialog::Bullet(const UnicodeString & S)
+{
+  // Keep in sync with similar function in installer
+  UnicodeString Result = S;
+  UnicodeString Dash(L"-");
+  UnicodeString Bullet(L"\u2022 ");
+  if (StartsStr(Dash, Result))
+  {
+    Result = Bullet + Result.SubString(Dash.Length() + 1, Result.Length() - Dash.Length());
+  }
+  Result = ReplaceStr(Result, sLineBreak + Dash, sLineBreak + Bullet);
+  return Result;
+}
+//---------------------------------------------------------------------------

+ 1 - 0
source/forms/Preferences.h

@@ -529,6 +529,7 @@ protected:
   void __fastcall FileColorMove(int Source, int Dest);
   void __fastcall UpdateFileColorsView();
   void __fastcall AddEditFileColor(bool Edit);
+  UnicodeString Bullet(const UnicodeString & S);
 
   INTERFACE_HOOK;
 };