2011-10-25 [colin] 3.7.10cvs53
authorColin Leroy <colin@colino.net>
Tue, 25 Oct 2011 23:00:05 +0000 (23:00 +0000)
committerColin Leroy <colin@colino.net>
Tue, 25 Oct 2011 23:00:05 +0000 (23:00 +0000)
* src/gtk/gtkcmclist.c
* src/gtk/gtkcmctree.c
Fix colors, fix warnings

ChangeLog
PATCHSETS
configure.ac
src/gtk/gtkcmclist.c
src/gtk/gtkcmctree.c

index cc233e8..9fd70b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-10-25 [colin]     3.7.10cvs53
+
+       * src/gtk/gtkcmclist.c
+       * src/gtk/gtkcmctree.c
+               Fix colors, fix warnings
+
 2011-10-25 [colin]     3.7.10cvs52
 
        * src/gtk/gtkcmclist.c
index 296269a..981bc04 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.587 -r 1.382.2.588 src/compose.c;  cvs diff -u -r 1.94.2.220 -r 1.94.2.221 src/messageview.c;  cvs diff -u -r 1.150.2.118 -r 1.150.2.119 src/procmsg.c;  cvs diff -u -r 1.60.2.56 -r 1.60.2.57 src/procmsg.h;  ) > 3.7.10cvs50.patchset
 ( cvs diff -u -r 1.25.2.71 -r 1.25.2.72 src/stock_pixmap.c;  ) > 3.7.10cvs51.patchset
 ( cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/gtk/gtkcmclist.c;  cvs diff -u -r 1.1.2.22 -r 1.1.2.23 src/gtk/gtkcmctree.c;  ) > 3.7.10cvs52.patchset
+( cvs diff -u -r 1.1.2.22 -r 1.1.2.23 src/gtk/gtkcmclist.c;  cvs diff -u -r 1.1.2.23 -r 1.1.2.24 src/gtk/gtkcmctree.c;  ) > 3.7.10cvs53.patchset
index 3b7d266..d76acbe 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=52
+EXTRA_VERSION=53
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 69df1dc..7f09cb3 100644 (file)
@@ -364,12 +364,8 @@ static void column_button_clicked     (GtkWidget      *widget,
 /* Adjustments */
 static void adjust_adjustments        (GtkCMCList       *clist,
                                       gboolean        block_resize);
-static void vadjustment_changed       (GtkAdjustment  *adjustment,
-                                      gpointer        data);
 static void vadjustment_value_changed (GtkAdjustment  *adjustment,
                                       gpointer        data);
-static void hadjustment_changed       (GtkAdjustment  *adjustment,
-                                      gpointer        data);
 static void hadjustment_value_changed (GtkAdjustment  *adjustment,
                                       gpointer        data);
 
@@ -1231,9 +1227,6 @@ gtk_cmclist_set_hadjustment (GtkCMCList      *clist,
       gtk_object_ref (G_OBJECT (clist->hadjustment));
       gtk_object_sink (G_OBJECT (clist->hadjustment));
 #endif
-      g_signal_connect (G_OBJECT (clist->hadjustment), "changed",
-                         G_CALLBACK( hadjustment_changed),
-                         (gpointer) clist);
       g_signal_connect (G_OBJECT (clist->hadjustment), "value_changed",
                          G_CALLBACK( hadjustment_value_changed),
                          (gpointer) clist);
@@ -1284,9 +1277,6 @@ gtk_cmclist_set_vadjustment (GtkCMCList      *clist,
       gtk_object_sink (G_OBJECT (clist->vadjustment));
 #endif
 
-      g_signal_connect (G_OBJECT (clist->vadjustment), "changed",
-                         G_CALLBACK(vadjustment_changed),
-                         (gpointer) clist);
       g_signal_connect (G_OBJECT (clist->vadjustment), "value_changed",
                          G_CALLBACK(vadjustment_value_changed),
                          (gpointer) clist);
@@ -4512,7 +4502,6 @@ gtk_cmclist_realize (GtkWidget *widget)
   GtkStyle *style;
   GdkWindow *window;
   GdkWindowAttr attributes;
-  GdkGCValues values;
   GtkCMCListRow *clist_row;
   GList *list;
   gint attributes_mask;
@@ -4821,32 +4810,15 @@ static gint
 gtk_cmclist_expose (GtkWidget      *widget,
                  GdkEventExpose *event)
 {
-  GdkWindow *window;
   GtkCMCList *clist;
-  GtkStyle *style;
 
   cm_return_val_if_fail (GTK_IS_CMCLIST (widget), FALSE);
   cm_return_val_if_fail (event != NULL, FALSE);
 
-  window = gtk_widget_get_window (widget);
-  style = gtk_widget_get_style (widget);
-
   if (gtk_widget_is_drawable (widget))
     {
       clist = GTK_CMCLIST (widget);
 
-      /* draw border */
-      if (event->window == window)
-       gtk_paint_shadow (style, window,
-                        GTK_STATE_NORMAL, clist->shadow_type,
-                        NULL, NULL, NULL,
-                        0, 0,
-                        clist->clist_window_width +
-                        (2 * style->xthickness),
-                        clist->clist_window_height +
-                        (2 * style->ythickness) +
-                        clist->column_title_area.height);
-
       /* exposure events on the list */
       if (event->window == clist->clist_window)
        draw_rows (clist, &event->area);
@@ -5396,7 +5368,6 @@ gtk_cmclist_size_request (GtkWidget      *widget,
   GtkCMCList *clist;
   GtkStyle *style;
   gint i;
-  gint font_height = 0;
   guint border_width;
   cm_return_if_fail (GTK_IS_CMCLIST (widget));
   cm_return_if_fail (requisition != NULL);
@@ -5410,7 +5381,6 @@ gtk_cmclist_size_request (GtkWidget      *widget,
   /* compute the size of the column title (title) area */
   clist->column_title_area.height = 0;
   if (GTK_CMCLIST_SHOW_TITLES(clist)) {
-    font_height = (pango_font_description_get_size(style->font_desc)/PANGO_SCALE)*2+4;
     for (i = 0; i < clist->columns; i++)
       if (clist->column[i].button)
        {
@@ -5646,7 +5616,6 @@ draw_row (GtkCMCList     *clist,
   gint state;
   gint i;
   cairo_t *cr;
-  const double dashes[] = {4.0, 4.0};
   cm_return_if_fail (clist != NULL);
 
   /* bail now if we arn't drawable yet */
@@ -5654,7 +5623,7 @@ draw_row (GtkCMCList     *clist,
     return;
 
   widget = GTK_WIDGET (clist);
-  style = gtk_widget_get_style (widget);
+  style = clist_row->style ? clist_row->style : gtk_widget_get_style (widget);
 
   /* if the function is passed the pointer to the row instead of null,
    * it avoids this expensive lookup */
@@ -5842,7 +5811,7 @@ draw_row (GtkCMCList     *clist,
          if (layout)
            {
              gint row_center_offset = (clist->row_height - logical_rect.height - 1) / 2;
-             gdk_cairo_set_source_color(cr, &gtk_widget_get_style(GTK_WIDGET(clist))->fg[state]);
+             gdk_cairo_set_source_color(cr, clist_row->fg_set ? &clist_row->foreground : &style->fg[state]);
              cairo_move_to(cr, offset, row_rectangle.y + row_center_offset + clist_row->cell[i].vertical);
              pango_cairo_show_layout(cr, layout);
               g_object_unref (G_OBJECT (layout));
@@ -6090,30 +6059,6 @@ adjust_adjustments (GtkCMCList *clist,
     }
 }
 
-static void
-vadjustment_changed (GtkAdjustment *adjustment,
-                    gpointer       data)
-{
-  GtkCMCList *clist;
-
-  cm_return_if_fail (adjustment != NULL);
-  cm_return_if_fail (data != NULL);
-
-  clist = GTK_CMCLIST (data);
-}
-
-static void
-hadjustment_changed (GtkAdjustment *adjustment,
-                    gpointer       data)
-{
-  GtkCMCList *clist;
-
-  cm_return_if_fail (adjustment != NULL);
-  cm_return_if_fail (data != NULL);
-
-  clist = GTK_CMCLIST (data);
-}
-
 static void
 vadjustment_value_changed (GtkAdjustment *adjustment,
                           gpointer       data)
index 21aebc4..3feb476 100644 (file)
@@ -492,7 +492,7 @@ draw_expander (GtkCMCTree     *ctree,
   cairo_fill(cr);
  
   cairo_new_path(cr);
-  gdk_cairo_set_source_color(cr, &gtk_widget_get_style(ctree)->fg[GTK_STATE_NORMAL]);
+  gdk_cairo_set_source_color(cr, &gtk_widget_get_style(GTK_WIDGET(ctree))->fg[GTK_STATE_NORMAL]);
   cairo_set_line_width(cr, 1);
   cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
   cairo_move_to(cr, points[0].x, points[0].y);
@@ -623,15 +623,12 @@ draw_row (GtkCMCList     *clist,
   GtkWidget *widget;
   GtkStyle *style;
   GtkCMCTree  *ctree;
-  GdkRectangle *rect;
   GdkRectangle *crect;
   GdkRectangle row_rectangle;
   GdkRectangle cell_rectangle; 
   GdkRectangle clip_rectangle;
   GdkRectangle intersect_rectangle;
   gint last_column;
-  gint column_left = 0;
-  gint column_right = 0;
   gint offset = 0;
   gint state;
   gint i;
@@ -642,7 +639,7 @@ draw_row (GtkCMCList     *clist,
 
   cm_return_if_fail (clist != NULL);
   widget = GTK_WIDGET (clist);
-  style = gtk_widget_get_style (widget);
+  style = clist_row->style ? clist_row->style : gtk_widget_get_style (widget);
 
   if (greybg.pixel == 0 &&
       greybg.red == 0 &&
@@ -706,11 +703,14 @@ draw_row (GtkCMCList     *clist,
   state = clist_row->state;
 
   cr = gdk_cairo_create(clist->clist_window);
-  fgcolor = &style->fg[clist_row->state];
+  
+  if (clist_row->fg_set && state != GTK_STATE_SELECTED)
+       fgcolor = &clist_row->foreground;
+  else
+       fgcolor = &style->fg[clist_row->state];
   /* draw the cell borders */
   if (area)
     {
-      rect = &intersect_rectangle;
       crect = &intersect_rectangle;
 
       if (gdk_rectangle_intersect (area, &cell_rectangle, crect)) {
@@ -721,7 +721,6 @@ draw_row (GtkCMCList     *clist,
     }
   else
     {
-      rect = &clip_rectangle;
       crect = &cell_rectangle;
 
       gdk_cairo_rectangle(cr, &cell_rectangle);
@@ -1382,7 +1381,6 @@ gtk_cmctree_realize (GtkWidget *widget)
   GtkCMCList *clist;
   GtkCMCTreeNode *node;
   GtkCMCTreeNode *child;
-  GtkStyle *style;
   gint i;
 
   cm_return_if_fail (GTK_IS_CMCTREE (widget));
@@ -1401,8 +1399,6 @@ gtk_cmctree_realize (GtkWidget *widget)
          gtk_cmctree_pre_recursive (ctree, child, ctree_attach_styles, NULL);
       node = GTK_CMCTREE_NODE_NEXT (node);
     }
-
-  style = gtk_widget_get_style(widget);
 }
 
 static void
@@ -5227,14 +5223,12 @@ gtk_cmctree_drag_begin (GtkWidget            *widget,
                      GdkDragContext *context)
 {
   GtkCMCList *clist;
-  GtkCMCTree *ctree;
   gboolean use_icons;
 
   cm_return_if_fail (GTK_IS_CMCTREE (widget));
   cm_return_if_fail (context != NULL);
 
   clist = GTK_CMCLIST (widget);
-  ctree = GTK_CMCTREE (widget);
 
   use_icons = GTK_CMCLIST_USE_DRAG_ICONS (clist);
   GTK_CMCLIST_UNSET_FLAG (clist, CMCLIST_USE_DRAG_ICONS);
@@ -5242,11 +5236,7 @@ gtk_cmctree_drag_begin (GtkWidget             *widget,
 
   if (use_icons)
     {
-      GtkCMCTreeNode *node;
-
       GTK_CMCLIST_SET_FLAG (clist, CMCLIST_USE_DRAG_ICONS);
-      node = GTK_CMCTREE_NODE (g_list_nth (clist->row_list,
-                                        clist->click_cell.row));
       gtk_drag_set_icon_default (context);
     }
 }