Skip to content

Commit

Permalink
Исправил повторное событие поиска
Browse files Browse the repository at this point in the history
  • Loading branch information
HemulGM committed Dec 19, 2024
1 parent 61bb471 commit 3ff2a7b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Zona.Main.fmx
Original file line number Diff line number Diff line change
Expand Up @@ -53615,7 +53615,7 @@ object FormMain: TFormMain
Size.Height = 24.000000000000000000
Size.PlatformDefault = False
TabOrder = 1
OnClick = EditSearchChangeTracking
OnClick = SearchEditButtonSearchClick
end
object PopupSearch: TPopup
Position.Y = 36.000000000000000000
Expand Down
12 changes: 12 additions & 0 deletions Zona.Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ TFormMain = class(TWinUIForm)
procedure EditSearchEnter(Sender: TObject);
procedure EditSearchExit(Sender: TObject);
procedure VertScrollBoxViewResize(Sender: TObject);
procedure SearchEditButtonSearchClick(Sender: TObject);
private
FZonaAPI: TZonaAPI;
FIsSerial: Boolean;
FSearch: string;
FGenre: string;
FYear: string;
FOffset: Integer;
Expand Down Expand Up @@ -573,6 +575,7 @@ procedure TFormMain.OpenSerials;

procedure TFormMain.OpenSearch(const Text: string);
begin
FSearch := Text;
TabControlMain.ActiveTab := TabItemSearch;
ButtonBack.Visible := True;
LabelSearch.Text := 'Поиск: "' + Text + '"';
Expand Down Expand Up @@ -641,6 +644,8 @@ procedure TFormMain.EditSearchChangeTracking(Sender: TObject);
TimerSearch.Enabled := False;
if EditSearch.Text.IsEmpty then
Exit;
if EditSearch.Text = FSearch then
Exit;
TimerSearch.Enabled := True;
end;

Expand Down Expand Up @@ -931,6 +936,13 @@ procedure TFormMain.ReloadAll(Clear: Boolean);
end);
end;

procedure TFormMain.SearchEditButtonSearchClick(Sender: TObject);
begin
if EditSearch.Text.IsEmpty then
Exit;
OpenSearch(EditSearch.Text);
end;

procedure TFormMain.SkAnimatedImage1Click(Sender: TObject);
begin
SkAnimatedImage1.Animation.Start;
Expand Down

0 comments on commit 3ff2a7b

Please sign in to comment.