mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
add request state
This commit is contained in:
parent
3a0deabc14
commit
7bc2d478d0
5 changed files with 72 additions and 23 deletions
|
|
@ -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,
|
||||
));
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue