[evince] sidebar: allow to shrink the sidebar more



commit 93164eb52bc51b4cef9d476f1de9419b8a035e1c
Author: Nelson Benítez León <nbenitezl+gnome gmail com>
Date:   Fri Dec 1 15:26:51 2017 +0500

    sidebar: allow to shrink the sidebar more
    
    so we can give more space to the document view, and
    also because sidebar minimum width was too much in
    verbose locales (because of bookmark button labels)
    which was almost causing it to switch to a two
    columns layout.
    
    Fixed by:
    
     - Switching the bookmarks section button labels
       from "Add" and "Remove" to be "+" and "-" along
       with corresponding tooltip and accesible names.
    
     - Set the label of the main sidebar toggle button
       to be ellipsizable, so the sidebar can be resized
       to reduce width even more.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778000

 shell/ev-sidebar-bookmarks.c |   13 ++++++++-----
 shell/ev-sidebar.c           |    1 +
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/shell/ev-sidebar-bookmarks.c b/shell/ev-sidebar-bookmarks.c
index b2535b6..7e68792 100644
--- a/shell/ev-sidebar-bookmarks.c
+++ b/shell/ev-sidebar-bookmarks.c
@@ -456,22 +456,25 @@ ev_sidebar_bookmarks_init (EvSidebarBookmarks *sidebar_bookmarks)
         gtk_container_add (GTK_CONTAINER (swindow), priv->tree_view);
         gtk_widget_show (priv->tree_view);
 
-        hbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
         gtk_widget_set_margin_top (hbox, 2);
         gtk_widget_set_margin_bottom (hbox, 2);
         gtk_widget_set_margin_start (hbox, 2);
         gtk_widget_set_margin_end (hbox, 2);
-        gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_CENTER);
-        gtk_style_context_add_class (gtk_widget_get_style_context (hbox), GTK_STYLE_CLASS_LINKED);
+        gtk_widget_set_halign (hbox, GTK_ALIGN_CENTER);
 
-        priv->add_button = gtk_button_new_with_label (_("Add"));
+        priv->add_button = gtk_button_new_with_label ("+");
+        gtk_widget_set_tooltip_text (priv->add_button, _("Add bookmark"));
+        atk_object_set_name (gtk_widget_get_accessible (priv->add_button), _("Add bookmark"));
         gtk_actionable_set_action_name (GTK_ACTIONABLE (priv->add_button),
                                         "win.add-bookmark");
         gtk_widget_set_sensitive (priv->add_button, FALSE);
         gtk_box_pack_start (GTK_BOX (hbox), priv->add_button, FALSE, FALSE, 0);
         gtk_widget_show (priv->add_button);
 
-        priv->del_button = gtk_button_new_with_label (_("Remove"));
+        priv->del_button = gtk_button_new_with_label ("-");
+        gtk_widget_set_tooltip_text (priv->del_button, _("Remove bookmark"));
+        atk_object_set_name (gtk_widget_get_accessible (priv->del_button), _("Remove bookmark"));
         g_signal_connect (priv->del_button, "clicked",
                           G_CALLBACK (ev_sidebar_bookmarks_del_clicked),
                           sidebar_bookmarks);
diff --git a/shell/ev-sidebar.c b/shell/ev-sidebar.c
index 692b8d1..8a9c036 100644
--- a/shell/ev-sidebar.c
+++ b/shell/ev-sidebar.c
@@ -371,6 +371,7 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
        select_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
 
        ev_sidebar->priv->label = gtk_label_new ("");
+       gtk_label_set_ellipsize (GTK_LABEL (ev_sidebar->priv->label), PANGO_ELLIPSIZE_END);
        gtk_box_pack_start (GTK_BOX (select_hbox),
                            ev_sidebar->priv->label,
                            FALSE, FALSE, 0);


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