enable identity selection for Titan protocol

This commit is contained in:
yggverse 2025-01-23 10:21:30 +02:00
parent b437a9d190
commit ed0172be68
3 changed files with 6 additions and 9 deletions

View file

@ -94,8 +94,9 @@ impl Item {
move || { move || {
// Request should match valid URI for all drivers supported // Request should match valid URI for all drivers supported
if let Some(uri) = page.navigation.request.uri() { if let Some(uri) = page.navigation.request.uri() {
// Rout by scheme // Route by scheme
if uri.scheme().to_lowercase() == "gemini" { let scheme = uri.scheme();
if scheme == "gemini" || scheme == "titan" {
return identity::new_gemini( return identity::new_gemini(
(&browser_action, &window_action), (&browser_action, &window_action),
&profile, &profile,

View file

@ -203,7 +203,7 @@ impl Widget {
self.entry.set_primary_icon_name(Some(name)); self.entry.set_primary_icon_name(Some(name));
self.entry.set_primary_icon_tooltip_text(Some(tooltip)); self.entry.set_primary_icon_tooltip_text(Some(tooltip));
} }
PrimaryIcon::Gemini { name, tooltip } => { PrimaryIcon::Gemini { name, tooltip } | PrimaryIcon::Titan { name, tooltip } => {
self.entry.set_primary_icon_activatable(true); self.entry.set_primary_icon_activatable(true);
self.entry.set_primary_icon_sensitive(true); self.entry.set_primary_icon_sensitive(true);
self.entry.set_primary_icon_name(Some(name)); self.entry.set_primary_icon_name(Some(name));
@ -222,10 +222,6 @@ impl Widget {
self.entry.set_primary_icon_name(Some(name)); self.entry.set_primary_icon_name(Some(name));
self.entry.set_primary_icon_tooltip_text(Some(tooltip)); self.entry.set_primary_icon_tooltip_text(Some(tooltip));
} }
PrimaryIcon::Titan { name, tooltip } => {
self.entry.set_primary_icon_name(Some(name));
self.entry.set_primary_icon_tooltip_text(Some(tooltip));
}
} }
// Update progress // Update progress

View file

@ -17,7 +17,7 @@ pub enum PrimaryIcon<'a> {
}, },
Titan { Titan {
name: &'a str, name: &'a str,
tooltip: &'a str, tooltip: (&'a str, &'a str),
}, },
} }
@ -46,7 +46,7 @@ pub fn from(request: &str) -> PrimaryIcon {
if request.starts_with("titan:") { if request.starts_with("titan:") {
return PrimaryIcon::Titan { return PrimaryIcon::Titan {
name: "document-send-symbolic", name: "document-send-symbolic",
tooltip: "Titan input", tooltip: ("Guest titan input", "User titan input"),
}; };
} }