diff --git a/src/app/browser/window/tab/item/page/content/text.rs b/src/app/browser/window/tab/item/page/content/text.rs index bf483d4b..8fb84bd6 100644 --- a/src/app/browser/window/tab/item/page/content/text.rs +++ b/src/app/browser/window/tab/item/page/content/text.rs @@ -9,7 +9,7 @@ use source::Source; use super::{TabAction, WindowAction}; use gtk::{ glib::Uri, - prelude::{BoxExt, ButtonExt, TextViewExt,WidgetExt}, + prelude::{BoxExt, ButtonExt, TextViewExt, WidgetExt}, Box, Orientation, ScrolledWindow, }; use std::rc::Rc; @@ -37,18 +37,20 @@ impl Text { // Init main widget let g_box = Box::builder().orientation(Orientation::Vertical).build(); + g_box.append( &ScrolledWindow::builder() .child(&gemini.widget.clamp_scrollable) .build(), ); + g_box.append(&search.g_box); + // Connect events window_action.find.connect_activate({ let search = search.clone(); - let text_view = gemini.reader.widget.text_view.clone(); move |_| { - // @TODO show + search.g_box.set_visible(true); search.input.entry.grab_focus(); } }); @@ -74,9 +76,9 @@ impl Text { }); search.close.connect_clicked({ - let text_view = gemini.reader.widget.text_view.clone(); + let search = search.clone(); move |_| { - // @TODO hide + search.g_box.set_visible(false); } }); diff --git a/src/app/browser/window/tab/item/page/content/text/search.rs b/src/app/browser/window/tab/item/page/content/text/search.rs index bf939779..fe81868f 100644 --- a/src/app/browser/window/tab/item/page/content/text/search.rs +++ b/src/app/browser/window/tab/item/page/content/text/search.rs @@ -35,6 +35,7 @@ impl Search { let g_box = Box::builder() // .css_classes(["app-notification"]) .orientation(Orientation::Horizontal) + .visible(false) .build(); g_box.append(&input.entry);