implement nex protocol driver

This commit is contained in:
yggverse 2025-06-26 17:02:18 +03:00
parent aafd3b5db3
commit 02eb8e4a71
7 changed files with 311 additions and 15 deletions

View file

@ -309,7 +309,10 @@ fn update_primary_icon(entry: &Entry, profile: &Profile) {
entry.first_child().unwrap().remove_css_class("success"); // @TODO handle
match primary_icon::from(&entry.text()) {
PrimaryIcon::Download { name, tooltip } | PrimaryIcon::File { name, tooltip } => {
PrimaryIcon::Download { name, tooltip }
| PrimaryIcon::File { name, tooltip }
| PrimaryIcon::Source { name, tooltip }
| PrimaryIcon::Nex { name, tooltip } => {
entry.set_primary_icon_activatable(false);
entry.set_primary_icon_sensitive(false);
entry.set_primary_icon_name(Some(name));
@ -332,12 +335,6 @@ fn update_primary_icon(entry: &Entry, profile: &Profile) {
entry.set_primary_icon_name(Some(name));
entry.set_primary_icon_tooltip_text(Some(tooltip));
}
PrimaryIcon::Source { name, tooltip } => {
entry.set_primary_icon_activatable(false);
entry.set_primary_icon_sensitive(false);
entry.set_primary_icon_name(Some(name));
entry.set_primary_icon_tooltip_text(Some(tooltip));
}
}
}
@ -415,10 +412,7 @@ fn prefix_less(entry: &Entry) -> GString {
/// Try get current request value as [Uri](https://docs.gtk.org/glib/struct.Uri.html)
/// * `strip_prefix` on parse
fn uri(entry: &Entry) -> Option<Uri> {
match Uri::parse(&prefix_less(entry), UriFlags::NONE) {
Ok(uri) => Some(uri),
_ => None,
}
Uri::parse(&prefix_less(entry), UriFlags::NONE).ok()
}
/// Try build home [Uri](https://docs.gtk.org/glib/struct.Uri.html) for `Self`