[epiphany/mcatanzaro/progress-bar] Hide progress bar on most internal pages
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/progress-bar] Hide progress bar on most internal pages
- Date: Sun, 18 Nov 2018 21:38:16 +0000 (UTC)
commit c4750c5636c0706f99569cdb4849d672fbd095d0
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Nov 18 15:20:51 2018 -0600
Hide progress bar on most internal pages
Some users might get confused by showing the progress bar on e.g.
about:overview or about:incognito so let's just not show it.
Fixes #574
lib/widgets/ephy-location-entry.c | 9 ++++++++-
src/ephy-window.c | 6 +++++-
2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index d58ed0708..1e14ed870 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -1205,13 +1205,20 @@ ephy_location_entry_set_progress (EphyLocationEntry *entry,
gdouble fraction,
gboolean loading)
{
+ gdouble current_progress;
+
if (entry->progress_timeout) {
g_source_remove (entry->progress_timeout);
entry->progress_timeout = 0;
}
if (!loading) {
- gtk_entry_set_progress_fraction (GTK_ENTRY (entry->url_entry), 0);
+ /* Setting progress to 0 when it is already 0 can actually cause the
+ * progress bar to be shown. Yikes....
+ */
+ current_progress = gtk_entry_get_progress_fraction (GTK_ENTRY (entry->url_entry));
+ if (current_progress != 0.0)
+ gtk_entry_set_progress_fraction (GTK_ENTRY (entry->url_entry), 0.0);
return;
}
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 4bd09baa7..365e12933 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2109,12 +2109,16 @@ progress_update (WebKitWebView *web_view,
EphyTitleWidget *title_widget;
gdouble progress;
gboolean loading;
+ const char *address;
progress = webkit_web_view_get_estimated_load_progress (web_view);
loading = ephy_web_view_is_loading (EPHY_WEB_VIEW (web_view));
- title_widget = ephy_header_bar_get_title_widget (EPHY_HEADER_BAR (window->header_bar));
+ address = ephy_web_view_get_address (EPHY_WEB_VIEW (web_view));
+ if (ephy_embed_utils_is_no_show_address (address))
+ loading = FALSE;
+ title_widget = ephy_header_bar_get_title_widget (EPHY_HEADER_BAR (window->header_bar));
ephy_location_entry_set_progress (EPHY_LOCATION_ENTRY (title_widget), progress, loading);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]