connect search widget

This commit is contained in:
yggverse 2024-12-16 12:57:46 +02:00
parent 441bbc504f
commit 93602322a4
2 changed files with 8 additions and 5 deletions

View File

@ -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);
}
});

View File

@ -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);