Correct PanelIconGrid allocation and enable focus painting on drag over launchbuttons.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Mon, 3 Oct 2016 22:36:55 +0000 (01:36 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Mon, 3 Oct 2016 22:36:55 +0000 (01:36 +0300)
plugins/launchtaskbar.c
src/icon-grid.c

index c811db6..3a0902b 100644 (file)
@@ -148,7 +148,6 @@ struct LaunchTaskBarPlugin {
 
 static gchar *launchtaskbar_rc = "style 'launchtaskbar-style' = 'theme-panel'\n"
         "{\n"
-        "GtkWidget::focus-line-width=0\n"
         "GtkWidget::focus-padding=0\n"
         "GtkButton::default-border={0,0,0,0}\n"
         "GtkButton::default-outside-border={0,0,0,0}\n"
@@ -312,13 +311,15 @@ static gboolean on_launchbar_drag_motion(
     {
         panel_icon_grid_set_drag_dest(PANEL_ICON_GRID(b->lb_icon_grid), NULL, 0);
         fm_dnd_dest_set_dest_file(b->dd, NULL);
-        return FALSE;
+        gdk_drag_status(context, 0, time);
+        return TRUE;
     }
     panel_icon_grid_set_drag_dest(PANEL_ICON_GRID(b->lb_icon_grid), btn, pos);
     if (!PANEL_IS_LAUNCH_BUTTON(btn) || pos != PANEL_ICON_GRID_DROP_INTO)
     {
         fm_dnd_dest_set_dest_file(b->dd, NULL);
-        return FALSE;
+        gdk_drag_status(context, 0, time);
+        return TRUE;
     }
     fm_dnd_dest_set_dest_file(b->dd, launch_button_get_file_info((LaunchButton *)btn));
     target = fm_dnd_dest_find_target(b->dd, context);
@@ -326,7 +327,7 @@ static gboolean on_launchbar_drag_motion(
         action = fm_dnd_dest_get_default_action(b->dd, context, target);
     gdk_drag_status(context, action, time);
     /* g_debug("launchbutton_drag_motion_event: act=%u",action); */
-    return (action != 0);
+    return TRUE;
 }
 
 static void on_launchbar_drag_leave(GtkWidget * widget, GdkDragContext * drag_context,
index 2900557..1447beb 100644 (file)
@@ -98,14 +98,14 @@ static void panel_icon_grid_size_allocate(GtkWidget *widget,
     /* Apply given allocation */
     gtk_widget_set_allocation(widget, allocation);
     border = gtk_container_get_border_width(GTK_CONTAINER(widget));
-    child_allocation.width = MAX(allocation->width - border * 2, 0);
-    child_allocation.height = MAX(allocation->height - border * 2, 0);
+    child_allocation.width = MAX(allocation->width, 0);
+    child_allocation.height = MAX(allocation->height, 0);
     if (gtk_widget_get_realized(widget))
     {
         if (!gtk_widget_get_has_window(widget))
         {
-            child_allocation.x = allocation->x + border;
-            child_allocation.y = allocation->y + border;
+            child_allocation.x = allocation->x;
+            child_allocation.y = allocation->y;
         }
         else
         {
@@ -120,8 +120,8 @@ static void panel_icon_grid_size_allocate(GtkWidget *widget,
                                    child_allocation.height);
         if (gtk_widget_get_has_window(widget))
             gdk_window_move_resize(gtk_widget_get_window(widget),
-                                   allocation->x + border,
-                                   allocation->y + border,
+                                   allocation->x,
+                                   allocation->y,
                                    child_allocation.width,
                                    child_allocation.height);
     }
@@ -275,7 +275,11 @@ static void panel_icon_grid_size_request(GtkWidget *widget,
                 }
             }
         if (row > 0)
+        {
+            if (requisition->width > 0)
+                requisition->width += ig->spacing;
             requisition->width += w + 2 * border;
+        }
         /* if ((ig->columns == 1) && (ig->rows > visible_children))
             ig->rows = visible_children; */
     }
@@ -795,7 +799,6 @@ static void panel_icon_grid_realize(GtkWidget *widget)
     GtkStyle *style;
     GtkAllocation allocation;
     GdkWindowAttr attributes;
-    guint border = gtk_container_get_border_width(GTK_CONTAINER(widget));
     gint attributes_mask;
     gboolean visible_window;
 
@@ -806,10 +809,10 @@ static void panel_icon_grid_realize(GtkWidget *widget)
 #endif
 
     gtk_widget_get_allocation(widget, &allocation);
-    attributes.x = allocation.x + border;
-    attributes.y = allocation.y + border;
-    attributes.width = allocation.width - 2*border;
-    attributes.height = allocation.height - 2*border;
+    attributes.x = allocation.x;
+    attributes.y = allocation.y;
+    attributes.width = allocation.width;
+    attributes.height = allocation.height;
     attributes.window_type = GDK_WINDOW_CHILD;
     attributes.event_mask = gtk_widget_get_events(widget)
                             | GDK_BUTTON_MOTION_MASK