From 64143c9c50923b25677b056b93b289c83534709c Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 17 Dec 2024 03:04:29 +0200 Subject: [PATCH] rename methods --- src/app/browser/window/tab/item/page.rs | 6 +++--- src/app/browser/window/tab/item/page/search.rs | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index 29db8440..4ebf93e2 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -182,7 +182,7 @@ impl Page { self.window_action.find.simple_action.set_enabled(false); // Reset widgets - self.search.update(None); + self.search.unset(); self.input.unset(); // Prevent infinitive redirection @@ -570,8 +570,8 @@ impl Page { ) }; - // Update `find` model with new buffer - search.update(Some(text_widget.text_view)); + // Connect `TextView` widget, update `search` model + search.set(Some(text_widget.text_view)); // Update page meta meta.set_status(Status::Success) diff --git a/src/app/browser/window/tab/item/page/search.rs b/src/app/browser/window/tab/item/page/search.rs index 521e622f..8cfa8f8f 100644 --- a/src/app/browser/window/tab/item/page/search.rs +++ b/src/app/browser/window/tab/item/page/search.rs @@ -82,7 +82,12 @@ impl Search { } /// * currently supports [TextView](https://docs.gtk.org/gtk4/class.TextView.html) only - pub fn update(&self, text_view: Option) { + pub fn set(&self, text_view: Option) { self.subject.replace(text_view.map(Subject::new)); } + + pub fn unset(&self) { + self.subject.replace(None); + self.hide() // make sure widget not visible anymore + } }