Skip to content

Commit

Permalink
right-click hint
Browse files Browse the repository at this point in the history
  • Loading branch information
mattia72 committed Jan 5, 2025
1 parent e45fb1a commit 8e3b118
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/UI/RipGrepper.UI.TopFrame.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ object RipGrepperTopFrame: TRipGrepperTopFrame
Top = 0
Width = 121
Height = 23
Hint = 'Replace Resulted Items'
Hint = 'Replace Matches (right-click to change)'
TabStop = False
Images = SvgImgLstTopFrame
ParentShowHint = False
Expand Down
18 changes: 13 additions & 5 deletions src/UI/RipGrepper.UI.TopFrame.pas
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ TRipGrepperTopFrame = class(TFrame, IFrameEvents)
procedure StartNewSearch;
procedure ToggleFilterMode(const _fm : EFilterMode);
procedure ToggleGuiReplaceMode(const _grm : EGuiReplaceMode);
procedure UpdateFilterMenu;
procedure UpdateFilterMenuAndHint;
procedure UpdateReplaceMenu;
property Settings : TRipGrepperSettings read GetSettings write FSettings;

Expand Down Expand Up @@ -411,7 +411,7 @@ procedure TRipGrepperTopFrame.ActionSetFileFilterModeExecute(Sender : TObject);
begin
SetFilterMode(EFilterMode.fmFilterText, True);
SetFilterMode(EFilterMode.fmFilterFile);
UpdateFilterMenu;
UpdateFilterMenuAndHint;
Settings.StoreViewSettings(TFilterSettings.SETTING_FILTERMODE);
end;

Expand All @@ -433,7 +433,7 @@ procedure TRipGrepperTopFrame.ActionSetTextFilterModeExecute(Sender : TObject);
begin
SetFilterMode(EFilterMode.fmFilterFile, True);
SetFilterMode(EFilterMode.fmFilterText);
UpdateFilterMenu;
UpdateFilterMenuAndHint;
Settings.StoreViewSettings(TFilterSettings.SETTING_FILTERMODE);
end;

Expand Down Expand Up @@ -682,7 +682,7 @@ function TRipGrepperTopFrame.GetToolBarWidth(_tb : TToolBar) : Integer;
procedure TRipGrepperTopFrame.Init;
begin
FFilterMode := Settings.NodeLookSettings.FilterSettings.FilterModes;
UpdateFilterMenu();
UpdateFilterMenuAndHint();
ActionExpandCollapseUpdate();
ActionShowRelativePathUpdate();
ActionAlternateRowColorsUpdate();
Expand Down Expand Up @@ -881,12 +881,20 @@ procedure TRipGrepperTopFrame.ToggleGuiReplaceMode(const _grm : EGuiReplaceMode)
// Settings.NodeLookSettings. := FFilterMode;
end;

procedure TRipGrepperTopFrame.UpdateFilterMenu;
procedure TRipGrepperTopFrame.UpdateFilterMenuAndHint;
begin
ActionSetFileFilterMode.Checked := EFilterMode.fmFilterFile in FFilterMode;
ActionSetTextFilterMode.Checked := EFilterMode.fmFilterText in FFilterMode;
ActionSetFilterModeCaseSensitive.Checked := EFilterMode.fmCaseSensitive in FFilterMode;
ActionSetFilterModeRegex.Checked := EFilterMode.fmUseRegex in FFilterMode;

if (ActionSetFileFilterMode.Checked) then begin
edtFilter.Hint := 'File Filter';
end else if ActionSetTextFilterMode.Checked then begin
edtFilter.Hint := 'Text Filter';
end;

edtFilter.Hint := edtFilter.Hint + ' (right-click to change)';
end;

procedure TRipGrepperTopFrame.UpdateReplaceMenu;
Expand Down

0 comments on commit 8e3b118

Please sign in to comment.