[evince/892-patch-fix-sensitiveness-of-delete-bookmark-button] sidebar-bookmarks: fix sensitiveness of remove bookmark button



commit 1a8bcd4bdc534afe4af4c937b74860c4f50fbd7d
Author: Nelson Benítez León <nbenitezl gmail com>
Date:   Sun Apr 29 11:33:24 2018 +0500

    sidebar-bookmarks: fix sensitiveness of remove bookmark button
    
    It was wrongly enabled when there was no bookmark selected in
    tree view (after deleting a bookmark).
    
    https://gitlab.gnome.org/GNOME/evince/issues/892

 shell/ev-sidebar-bookmarks.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/shell/ev-sidebar-bookmarks.c b/shell/ev-sidebar-bookmarks.c
index 7e68792c..2a93cf32 100644
--- a/shell/ev-sidebar-bookmarks.c
+++ b/shell/ev-sidebar-bookmarks.c
@@ -142,6 +142,8 @@ ev_bookmarks_popup_cmd_remove_bookmark (GtkAction          *action,
         bm.page = page;
         bm.title = NULL;
         ev_bookmarks_delete (priv->bookmarks, &bm);
+       if (gtk_widget_get_sensitive (priv->del_button))
+               gtk_widget_set_sensitive (priv->del_button, FALSE);
 }
 
 static const GtkActionEntry popup_entries[] = {
@@ -244,6 +246,8 @@ ev_sidebar_bookmarks_del_clicked (GtkWidget          *button,
         bm.page = page;
         bm.title = NULL;
         ev_bookmarks_delete (priv->bookmarks, &bm);
+       if (gtk_widget_get_sensitive (priv->del_button))
+               gtk_widget_set_sensitive (priv->del_button, FALSE);
 }
 
 static void
@@ -341,6 +345,8 @@ ev_sidebar_bookmarks_popup_menu_show (EvSidebarBookmarks *sidebar_bookmarks,
                 g_signal_handlers_unblock_by_func (selection,
                                                    ev_sidebar_bookmarks_selection_changed,
                                                    sidebar_bookmarks);
+               if (!gtk_widget_get_sensitive (priv->del_button))
+                       gtk_widget_set_sensitive (priv->del_button, TRUE);
                 gtk_tree_path_free (path);
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]