mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
optimize identity dialog mod
This commit is contained in:
parent
fc8c967891
commit
a8008ad92c
4 changed files with 36 additions and 56 deletions
|
|
@ -2,7 +2,7 @@ mod database;
|
|||
mod identity;
|
||||
mod primary_icon;
|
||||
|
||||
use adw::prelude::AdwDialogExt;
|
||||
use adw::{prelude::AdwDialogExt, AlertDialog};
|
||||
use primary_icon::PrimaryIcon;
|
||||
|
||||
use super::{ItemAction, Profile};
|
||||
|
|
@ -244,10 +244,13 @@ impl Request for Entry {
|
|||
}
|
||||
}
|
||||
|
||||
/// Present identity [AlertDialog](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.AlertDialog.html) for `Self`
|
||||
fn identity(&self, profile: &Rc<Profile>) {
|
||||
// connect identity traits
|
||||
use identity::{Common, Unsupported};
|
||||
if let Some(uri) = self.uri() {
|
||||
if ["gemini", "titan"].contains(&uri.scheme().as_str()) {
|
||||
return identity::common(
|
||||
return AlertDialog::common(
|
||||
profile,
|
||||
&uri,
|
||||
&Rc::new({
|
||||
|
|
@ -264,7 +267,7 @@ impl Request for Entry {
|
|||
.present(Some(self));
|
||||
}
|
||||
}
|
||||
identity::unsupported().present(Some(self));
|
||||
AlertDialog::unsupported().present(Some(self));
|
||||
}
|
||||
|
||||
// Setters
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue