fix focus grab on response area

This commit is contained in:
yggverse 2024-10-16 18:15:06 +03:00
parent 42e91cdb7c
commit 5d63f49987
4 changed files with 6 additions and 18 deletions

View file

@ -11,6 +11,7 @@ use widget::Widget;
use gtk::{
gio::SimpleAction,
glib::{uuid_string_random, Uri, UriHideFlags},
prelude::WidgetExt,
Box,
};
use std::sync::Arc;
@ -23,7 +24,7 @@ pub struct Default {
impl Default {
// Construct
pub fn new_arc(base: Uri, title: Option<&str>, size_limit: Option<usize>) -> Arc<Self> {
// Init local action group
// Init local action
let action_update = Arc::new(SimpleAction::new(&uuid_string_random(), None));
// Init components
@ -51,6 +52,8 @@ impl Default {
}
});
widget.gobject().connect_realize(move |_| response.focus());
// Return activated struct
Arc::new(Self { widget })
}