[Xfce4-commits] [xfce/thunar] 01/01: Fix for the eject button and spinner taking too much space

noreply at xfce.org noreply at xfce.org
Sat Aug 26 22:10:23 CEST 2017


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/thunar.

commit d9d481c83b4df171db4fa55692a34e79a64825d3
Author: Andre Miranda <andreldm at xfce.org>
Date:   Sat Aug 26 17:09:39 2017 -0300

    Fix for the eject button and spinner taking too much space
---
 thunar/thunar-shortcuts-view.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c
index ca370cd..fffd9dc 100644
--- a/thunar/thunar-shortcuts-view.c
+++ b/thunar/thunar-shortcuts-view.c
@@ -269,7 +269,7 @@ thunar_shortcuts_view_class_init (ThunarShortcutsViewClass *klass)
 static void
 thunar_shortcuts_view_init (ThunarShortcutsView *view)
 {
-  GtkTreeViewColumn *column;
+  GtkTreeViewColumn *column, *column_eject;
   GtkCellRenderer   *renderer;
   GtkTreeSelection  *selection;
 
@@ -291,11 +291,15 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view)
   column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN,
                          "reorderable", FALSE,
                          "resizable", FALSE,
+                         "expand", TRUE,
                          "sizing", GTK_TREE_VIEW_COLUMN_AUTOSIZE,
                          "spacing", 2,
                          NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (view), column);
 
+  column_eject = gtk_tree_view_column_new ();
+  gtk_tree_view_append_column (GTK_TREE_VIEW (view), column_eject);
+
   /* queue a resize on the column whenever the icon size is changed */
   view->queue_resize_signal_id = g_signal_connect_swapped (G_OBJECT (view->preferences), "notify::shortcuts-icon-size",
                                                            G_CALLBACK (gtk_tree_view_column_queue_resize), column);
@@ -350,8 +354,8 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view)
 
   /* spinner to indicate (un)mount/eject delay */
   renderer = gtk_cell_renderer_spinner_new ();
-  gtk_tree_view_column_pack_start (column, renderer, FALSE);
-  gtk_tree_view_column_set_attributes (column, renderer,
+  gtk_tree_view_column_pack_start (column_eject, renderer, FALSE);
+  gtk_tree_view_column_set_attributes (column_eject, renderer,
                                        "visible", THUNAR_SHORTCUTS_MODEL_COLUMN_BUSY,
                                        "active", THUNAR_SHORTCUTS_MODEL_COLUMN_BUSY,
                                        "pulse", THUNAR_SHORTCUTS_MODEL_COLUMN_BUSY_PULSE,
@@ -360,8 +364,8 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view)
   /* allocate icon renderer for the eject symbol */
   renderer = gtk_cell_renderer_pixbuf_new ();
   g_object_set (renderer, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, "icon-name", "media-eject", NULL);
-  gtk_tree_view_column_pack_start (column, renderer, FALSE);
-  gtk_tree_view_column_set_attributes (column, renderer,
+  gtk_tree_view_column_pack_start (column_eject, renderer, FALSE);
+  gtk_tree_view_column_set_attributes (column_eject, renderer,
                                        "visible", THUNAR_SHORTCUTS_MODEL_COLUMN_CAN_EJECT,
                                        NULL);
 
@@ -450,7 +454,7 @@ thunar_shortcuts_view_button_press_event (GtkWidget      *widget,
           /* check if we clicked the eject button area */
           column_width = gtk_tree_view_column_get_width (gtk_tree_view_get_column (GTK_TREE_VIEW (view), 0));
           gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &icon_width, &icon_height);
-          if (event->button == 1 && event->x >= column_width - icon_width - 3)
+          if (event->button == 1 && event->x > column_width)
             {
               /* check if that shortcut actually has an eject button */
               model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list