add request state

This commit is contained in:
yggverse 2024-11-11 12:52:46 +02:00
parent 3a0deabc14
commit 7bc2d478d0
5 changed files with 72 additions and 23 deletions

View file

@ -36,6 +36,7 @@ impl Item {
window_action: Rc<WindowAction>,
// Options
position: Option<i32>,
request: Option<String>,
is_pinned: bool,
is_selected: bool,
) -> Self {
@ -65,6 +66,15 @@ impl Item {
// Init events
if let Some(text) = request {
page.navigation()
.request()
.widget()
.gobject()
.set_text(&text);
page.load(true);
} // @TODO load optionally
action.load().connect_activate({
let page = page.clone();
move |request| {
@ -144,6 +154,7 @@ impl Item {
window_action.clone(),
// Options
None,
None,
record.is_pinned,
record.is_selected,
));

View file

@ -288,9 +288,12 @@ impl Reader {
return match uri.scheme().as_str() {
"gemini" => {
// Open new page in browser
window_action
.append()
.activate_stateful_once(None, false, false);
window_action.append().activate_stateful_once(
None,
Some(uri.to_string()),
false,
false,
); // @TODO
}
// Scheme not supported, delegate
_ => UriLauncher::new(&uri.to_str()).launch(