mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
move identity feature to request area
This commit is contained in:
parent
78957ff85b
commit
2dc6154d54
32 changed files with 59 additions and 84 deletions
|
|
@ -1,15 +1,14 @@
|
|||
mod action;
|
||||
mod client;
|
||||
mod database;
|
||||
mod identity;
|
||||
mod page;
|
||||
|
||||
use super::{Action as TabAction, BrowserAction, Position, WindowAction};
|
||||
use crate::Profile;
|
||||
use action::Action;
|
||||
use adw::{prelude::AdwDialogExt, TabView};
|
||||
use adw::TabView;
|
||||
use client::Client;
|
||||
use gtk::prelude::{ActionMapExt, Cast};
|
||||
use gtk::prelude::ActionMapExt;
|
||||
use page::Page;
|
||||
use sqlite::Transaction;
|
||||
use std::rc::Rc;
|
||||
|
|
@ -81,29 +80,6 @@ impl Item {
|
|||
}
|
||||
});
|
||||
|
||||
action.ident.connect_activate({
|
||||
let client = client.clone();
|
||||
let page = page.clone();
|
||||
let parent = tab_view.clone().upcast::<gtk::Widget>();
|
||||
let profile = profile.clone();
|
||||
move || {
|
||||
if let Some(request) = page.navigation.uri() {
|
||||
if ["gemini", "titan"].contains(&request.scheme().as_str()) {
|
||||
return identity::default(&profile, &request, {
|
||||
let client = client.clone();
|
||||
let page = page.clone();
|
||||
move || {
|
||||
page.navigation.update(); // update indicators immediately
|
||||
client.handle(&page.navigation.request(), false);
|
||||
} // on apply
|
||||
})
|
||||
.present(Some(&parent));
|
||||
}
|
||||
}
|
||||
identity::unsupported().present(Some(&parent));
|
||||
}
|
||||
});
|
||||
|
||||
action.load.connect_activate({
|
||||
let page = page.clone();
|
||||
let client = client.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue