diff options
author | infirit <[email protected]> | 2014-07-25 15:03:58 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2014-07-25 15:03:58 +0200 |
commit | fa13dcadb1c4a47be4b9caf9edcd4cd3833bd1a5 (patch) | |
tree | 913bc80d763fe6e01cf47bf7fc869c9c10318473 /src | |
parent | d153aebdb32dd193beec476e8f1bec919b33f18c (diff) | |
download | eom-fa13dcadb1c4a47be4b9caf9edcd4cd3833bd1a5.tar.bz2 eom-fa13dcadb1c4a47be4b9caf9edcd4cd3833bd1a5.tar.xz |
Clear status + titlebar when deleting last image in collection
Eog bug http://bugzilla.gnome.org/show_bug.cgi?id=632458
Based on eog commit 7a6ea9ee0e5e8a2d89fd16f241a693c5a56f3b78
From Felix Riemann <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/eom-statusbar.c | 6 | ||||
-rw-r--r-- | src/eom-window.c | 21 |
2 files changed, 20 insertions, 7 deletions
diff --git a/src/eom-statusbar.c b/src/eom-statusbar.c index c791701..b4d6f08 100644 --- a/src/eom-statusbar.c +++ b/src/eom-statusbar.c @@ -116,6 +116,10 @@ eom_statusbar_set_image_number (EomStatusbar *statusbar, gtk_statusbar_pop (GTK_STATUSBAR (statusbar->priv->img_num_statusbar), 0); + /* Hide number display if values don't make sense */ + if (G_UNLIKELY (num <= 0 || tot <= 0)) + return; + /* Translators: This string is displayed in the statusbar. * The first token is the image number, the second is total image * count. @@ -160,4 +164,4 @@ eom_statusbar_set_has_resize_grip (EomStatusbar *statusbar, gboolean has_resize_ gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), has_resize_grip); } -#endif
\ No newline at end of file +#endif diff --git a/src/eom-window.c b/src/eom-window.c index 34b28b1..b2925df 100644 --- a/src/eom-window.c +++ b/src/eom-window.c @@ -680,7 +680,7 @@ static void update_image_pos (EomWindow *window) { EomWindowPrivate *priv; - gint pos, n_images; + gint pos = -1, n_images = 0; priv = window->priv; @@ -689,12 +689,12 @@ update_image_pos (EomWindow *window) if (n_images > 0) { pos = eom_list_store_get_pos_by_image (EOM_LIST_STORE (priv->store), priv->image); - - /* Images: (image pos) / (n_total_images) */ - eom_statusbar_set_image_number (EOM_STATUSBAR (priv->statusbar), - pos + 1, - n_images); } + /* Images: (image pos) / (n_total_images) */ + eom_statusbar_set_image_number (EOM_STATUSBAR (priv->statusbar), + pos + 1, + n_images); + } static void @@ -1643,6 +1643,15 @@ handle_image_selection_changed_cb (EomThumbView *thumbview, EomWindow *window) priv = window->priv; + if (eom_list_store_length (EOM_LIST_STORE (priv->store)) == 0) { + gtk_window_set_title (GTK_WINDOW (window), + g_get_application_name()); + gtk_statusbar_remove_all (GTK_STATUSBAR (priv->statusbar), + priv->image_info_message_cid); + eom_scroll_view_set_image (EOM_SCROLL_VIEW (priv->view), + NULL); +} + if (eom_thumb_view_get_n_selected (EOM_THUMB_VIEW (priv->thumbview)) == 0) return; |