mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +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,6 +1,8 @@
|
|||
mod database;
|
||||
mod identity;
|
||||
mod primary_icon;
|
||||
|
||||
use adw::prelude::AdwDialogExt;
|
||||
use primary_icon::PrimaryIcon;
|
||||
|
||||
use super::{ItemAction, Profile};
|
||||
|
|
@ -71,8 +73,25 @@ impl Request for Entry {
|
|||
// Connect events
|
||||
entry.connect_icon_release({
|
||||
let item_action = item_action.clone();
|
||||
let profile = profile.clone();
|
||||
move |this, position| match position {
|
||||
EntryIconPosition::Primary => item_action.ident.activate(), // @TODO PrimaryIcon impl
|
||||
EntryIconPosition::Primary => {
|
||||
if let Some(request) = this.uri() {
|
||||
if ["gemini", "titan"].contains(&request.scheme().as_str()) {
|
||||
return identity::default(&profile, &request, {
|
||||
let item_action = item_action.clone();
|
||||
let profile = profile.clone();
|
||||
let this = this.clone();
|
||||
move || {
|
||||
this.update(&profile);
|
||||
item_action.load.activate(Some(&this.text()), false);
|
||||
} // on apply
|
||||
})
|
||||
.present(Some(this));
|
||||
}
|
||||
}
|
||||
identity::unsupported().present(Some(this));
|
||||
}
|
||||
EntryIconPosition::Secondary => item_action.load.activate(Some(&this.text()), true),
|
||||
_ => todo!(), // unexpected
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue