mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
connect search widget
This commit is contained in:
parent
441bbc504f
commit
93602322a4
@ -37,18 +37,20 @@ impl Text {
|
|||||||
|
|
||||||
// Init main widget
|
// Init main widget
|
||||||
let g_box = Box::builder().orientation(Orientation::Vertical).build();
|
let g_box = Box::builder().orientation(Orientation::Vertical).build();
|
||||||
|
|
||||||
g_box.append(
|
g_box.append(
|
||||||
&ScrolledWindow::builder()
|
&ScrolledWindow::builder()
|
||||||
.child(&gemini.widget.clamp_scrollable)
|
.child(&gemini.widget.clamp_scrollable)
|
||||||
.build(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
g_box.append(&search.g_box);
|
||||||
|
|
||||||
// Connect events
|
// Connect events
|
||||||
window_action.find.connect_activate({
|
window_action.find.connect_activate({
|
||||||
let search = search.clone();
|
let search = search.clone();
|
||||||
let text_view = gemini.reader.widget.text_view.clone();
|
|
||||||
move |_| {
|
move |_| {
|
||||||
// @TODO show
|
search.g_box.set_visible(true);
|
||||||
search.input.entry.grab_focus();
|
search.input.entry.grab_focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -74,9 +76,9 @@ impl Text {
|
|||||||
});
|
});
|
||||||
|
|
||||||
search.close.connect_clicked({
|
search.close.connect_clicked({
|
||||||
let text_view = gemini.reader.widget.text_view.clone();
|
let search = search.clone();
|
||||||
move |_| {
|
move |_| {
|
||||||
// @TODO hide
|
search.g_box.set_visible(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ impl Search {
|
|||||||
let g_box = Box::builder()
|
let g_box = Box::builder()
|
||||||
// .css_classes(["app-notification"])
|
// .css_classes(["app-notification"])
|
||||||
.orientation(Orientation::Horizontal)
|
.orientation(Orientation::Horizontal)
|
||||||
|
.visible(false)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
g_box.append(&input.entry);
|
g_box.append(&input.entry);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user