update indication icon on page handle

This commit is contained in:
yggverse 2025-03-23 04:26:28 +02:00
parent abb9de617d
commit 556a1eba89
2 changed files with 46 additions and 54 deletions

View file

@ -188,22 +188,11 @@ impl Request {
}
// Actions
pub fn escape(&self) {
self.suggestion.hide()
}
/// Try build home [Uri](https://docs.gtk.org/glib/struct.Uri.html) for `Self`
/// * return `None` if current request already match home or Uri not parsable
pub fn home(&self) -> Option<Uri> {
home(&self.entry)
}
/// Try get current request value as [Uri](https://docs.gtk.org/glib/struct.Uri.html)
/// * `strip_prefix` on parse
pub fn uri(&self) -> Option<Uri> {
uri(&self.entry)
}
pub fn show_identity_dialog(&self) {
show_identity_dialog(&self.entry, &self.profile)
}
@ -258,6 +247,10 @@ impl Request {
Ok(())
}
pub fn update_secondary_icon(&self, info: &Info) {
update_secondary_icon(&self.entry, info);
}
// Setters
pub fn to_download(&self) {
@ -270,6 +263,18 @@ impl Request {
// Getters
/// Try build home [Uri](https://docs.gtk.org/glib/struct.Uri.html) for `Self`
/// * return `None` if current request already match home or Uri not parsable
pub fn home(&self) -> Option<Uri> {
home(&self.entry)
}
/// Try get current request value as [Uri](https://docs.gtk.org/glib/struct.Uri.html)
/// * `strip_prefix` on parse
pub fn uri(&self) -> Option<Uri> {
uri(&self.entry)
}
pub fn is_file(&self) -> bool {
self.entry.text().starts_with("file://")
}