update page info on download

This commit is contained in:
yggverse 2025-03-28 03:09:13 +02:00
parent 3ccf3d2e7e
commit d2a39f2770
2 changed files with 30 additions and 15 deletions

View file

@ -341,12 +341,6 @@ fn update_primary_icon(entry: &Entry, profile: &Profile) {
}
}
/// GTK `is_focus` / `has_focus` not an option here
/// also, this method requires from the `Entry`` to be not empty
fn is_focused(entry: &Entry) -> bool {
entry.text_length() > 0 && entry.focus_child().is_some_and(|child| child.has_focus())
}
/// Secondary icon has two modes:
/// * navigate to the location button (on the entry is focused / has edit mode)
/// * page info button with dialog window activation (on the entry is inactive)
@ -355,7 +349,7 @@ fn update_secondary_icon(entry: &Entry, info: &Info) {
entry.set_secondary_icon_name(Some("pan-end-symbolic"));
entry.set_secondary_icon_tooltip_text(Some("Go to the location"))
} else {
if info.matches(&entry.text()) {
if info.matches(&prefix_less(&entry)) {
entry.set_secondary_icon_name(Some("help-about-symbolic"));
entry.set_secondary_icon_tooltip_text(Some("Page info"));
} else {
@ -366,6 +360,12 @@ fn update_secondary_icon(entry: &Entry, info: &Info) {
}
}
/// GTK `is_focus` / `has_focus` not an option here
/// also, this method requires from the `Entry`` to be not empty
fn is_focused(entry: &Entry) -> bool {
entry.text_length() > 0 && entry.focus_child().is_some_and(|child| child.has_focus())
}
/// Present Identity [AlertDialog](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.AlertDialog.html) for `Self`
fn show_identity_dialog(entry: &Entry, profile: &Arc<Profile>) {
// connect identity traits