]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkiconview.c
Change FSF Address
[~andy/gtk] / gtk / gtkiconview.c
index 828f1c510fec5a40ccae2c97fa45b38b20dae3fc..1e9050fe8b2bd289f14a8913ec69ac8f52133c36 100644 (file)
@@ -12,9 +12,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -1302,6 +1300,7 @@ gtk_icon_view_realize (GtkWidget *widget)
   gtk_style_context_save (context);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
   gtk_style_context_set_background (context, icon_view->priv->bin_window);
+  gtk_style_context_set_background (context, window);
   gtk_style_context_restore (context);
 
   gdk_window_show (icon_view->priv->bin_window);
@@ -1502,11 +1501,9 @@ gtk_icon_view_draw (GtkWidget *widget,
       dest_pos != GTK_ICON_VIEW_NO_DROP)
     {
       GtkStyleContext *context;
-      GtkStateFlags state;
       GdkRectangle rect = { 0 };
 
       context = gtk_widget_get_style_context (widget);
-      state = gtk_widget_get_state_flags (widget);
 
       switch (dest_pos)
        {
@@ -1540,7 +1537,6 @@ gtk_icon_view_draw (GtkWidget *widget,
          break;
         }
 
-      gtk_style_context_set_state (context, state);
       gtk_render_focus (context, cr,
                         rect.x, rect.y,
                         rect.width, rect.height);
@@ -1882,7 +1878,7 @@ gtk_icon_view_button_press (GtkWidget      *widget,
   if (!gtk_widget_has_focus (widget))
     gtk_widget_grab_focus (widget);
 
-  if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
+  if (event->button == GDK_BUTTON_PRIMARY && event->type == GDK_BUTTON_PRESS)
     {
       GdkModifierType extend_mod_mask;
       GdkModifierType modify_mod_mask;
@@ -1995,7 +1991,7 @@ gtk_icon_view_button_press (GtkWidget      *widget,
       icon_view->priv->draw_focus = FALSE;
     }
 
-  if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
+  if (event->button == GDK_BUTTON_PRIMARY && event->type == GDK_2BUTTON_PRESS)
     {
       item = _gtk_icon_view_get_item_at_coords (icon_view,
                                               event->x, event->y,
@@ -2018,7 +2014,7 @@ gtk_icon_view_button_press (GtkWidget      *widget,
   if (dirty)
     g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
 
-  return event->button == 1;
+  return event->button == GDK_BUTTON_PRIMARY;
 }
 
 static gboolean
@@ -2825,17 +2821,19 @@ gtk_icon_view_paint_item (GtkIconView     *icon_view,
   _gtk_icon_view_set_cell_data (icon_view, item);
 
   style_context = gtk_widget_get_style_context (widget);
+  state = gtk_widget_get_state_flags (widget);
 
   gtk_style_context_save (style_context);
   gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_VIEW);
   gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_CELL);
 
+  state &= ~(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_PRELIGHT);
+
   if (item->selected)
     {
-      if (gtk_widget_has_focus (widget) &&
+      if ((state & GTK_STATE_FLAG_FOCUSED) &&
           item == icon_view->priv->cursor_item)
         {
-          state |= GTK_STATE_FLAG_FOCUSED;
           flags |= GTK_CELL_RENDERER_FOCUSED;
         }
 
@@ -4495,7 +4493,7 @@ gtk_icon_view_set_tooltip_query_cb (GtkWidget  *widget,
  * for you. @column should be set to the column in @icon_view's model
  * containing the tooltip texts, or -1 to disable this feature.
  *
- * When enabled, #GtkWidget::has-tooltip will be set to %TRUE and
+ * When enabled, #GtkWidget:has-tooltip will be set to %TRUE and
  * @icon_view will connect a #GtkWidget::query-tooltip signal handler.
  *
  * Note that the signal handler sets the text with gtk_tooltip_set_markup(),
@@ -4769,8 +4767,7 @@ gtk_icon_view_set_model (GtkIconView *icon_view,
 
       g_object_unref (icon_view->priv->model);
       
-      g_list_foreach (icon_view->priv->items, (GFunc)gtk_icon_view_item_free, NULL);
-      g_list_free (icon_view->priv->items);
+      g_list_free_full (icon_view->priv->items, (GDestroyNotify) gtk_icon_view_item_free);
       icon_view->priv->items = NULL;
       icon_view->priv->anchor_item = NULL;
       icon_view->priv->cursor_item = NULL;
@@ -5181,8 +5178,7 @@ gtk_icon_view_unselect_path (GtkIconView *icon_view,
  *
  * To free the return value, use:
  * |[
- * g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
- * g_list_free (list);
+ * g_list_free_full (list, (GDestroyNotify) gtk_tree_patch_free);
  * ]|
  *
  * Return value: (element-type GtkTreePath) (transfer full): A #GList containing a #GtkTreePath for each selected row.