diff --git a/src/app/browser/window/tab/item.rs b/src/app/browser/window/tab/item.rs index 3e003c09..5495bbe7 100644 --- a/src/app/browser/window/tab/item.rs +++ b/src/app/browser/window/tab/item.rs @@ -94,7 +94,7 @@ impl Item { action.identity.connect_activate({ let page = page.clone(); - move |_, _| page.navigation.identity() + move |_, _| page.navigation.show_identity_dialog() }); action.reload.connect_activate({ diff --git a/src/app/browser/window/tab/item/page/navigation.rs b/src/app/browser/window/tab/item/page/navigation.rs index e25a4128..ff7517ce 100644 --- a/src/app/browser/window/tab/item/page/navigation.rs +++ b/src/app/browser/window/tab/item/page/navigation.rs @@ -131,8 +131,8 @@ impl Navigation { self.request.grab_focus() } - pub fn identity(&self) { - self.request.identity(&self.profile) + pub fn show_identity_dialog(&self) { + self.request.show_identity_dialog(&self.profile) } // Setters diff --git a/src/app/browser/window/tab/item/page/navigation/request.rs b/src/app/browser/window/tab/item/page/navigation/request.rs index 9029ed86..f8f1696f 100644 --- a/src/app/browser/window/tab/item/page/navigation/request.rs +++ b/src/app/browser/window/tab/item/page/navigation/request.rs @@ -42,8 +42,8 @@ pub trait Request { app_browser_window_tab_item_page_navigation_id: &i64, ) -> Result<(), String>; - fn update(&self, profile: &Profile); - fn identity(&self, profile: &Rc); + fn update_primary_icon(&self, profile: &Profile); + fn show_identity_dialog(&self, profile: &Rc); // Setters @@ -71,11 +71,14 @@ impl Request for Entry { .hexpand(true) .build(); + // Detect primary icon on construct + entry.update_primary_icon(profile); + // Connect events entry.connect_icon_release({ let profile = profile.clone(); move |this, position| match position { - EntryIconPosition::Primary => this.identity(&profile), + EntryIconPosition::Primary => this.show_identity_dialog(&profile), EntryIconPosition::Secondary => { this.activate(); } @@ -101,7 +104,7 @@ impl Request for Entry { item_action.home.set_enabled(this.home().is_some()); // Update primary icon - this.update(&profile) + this.update_primary_icon(&profile) } }); @@ -210,7 +213,7 @@ impl Request for Entry { Ok(()) } - fn update(&self, profile: &Profile) { + fn update_primary_icon(&self, profile: &Profile) { // Update primary icon self.first_child().unwrap().remove_css_class("success"); // @TODO handle @@ -245,7 +248,7 @@ 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) { + fn show_identity_dialog(&self, profile: &Rc) { // connect identity traits use identity::{Common, Unsupported}; if let Some(uri) = self.uri() { @@ -257,7 +260,7 @@ impl Request for Entry { let profile = profile.clone(); let this = self.clone(); move |is_reload| { - this.update(&profile); + this.update_primary_icon(&profile); if is_reload { this.emit_activate(); }