[Commits] gtkcmclist.c 1.1.2.22 1.1.2.23 gtkcmctree.c 1.1.2.23 1.1.2.24
colin at claws-mail.org
colin at claws-mail.org
Wed Oct 26 01:00:08 CEST 2011
Update of /home/claws-mail/claws/src/gtk
In directory claws-mail:/tmp/cvs-serv7093/src/gtk
Modified Files:
Tag: gtk2
gtkcmclist.c gtkcmctree.c
Log Message:
2011-10-25 [colin] 3.7.10cvs53
* src/gtk/gtkcmclist.c
* src/gtk/gtkcmctree.c
Fix colors, fix warnings
Index: gtkcmclist.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Attic/gtkcmclist.c,v
retrieving revision 1.1.2.22
retrieving revision 1.1.2.23
diff -u -d -r1.1.2.22 -r1.1.2.23
--- gtkcmclist.c 25 Oct 2011 19:28:04 -0000 1.1.2.22
+++ gtkcmclist.c 25 Oct 2011 23:00:05 -0000 1.1.2.23
@@ -364,12 +364,8 @@
/* 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_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_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 @@
GtkStyle *style;
GdkWindow *window;
GdkWindowAttr attributes;
- GdkGCValues values;
GtkCMCListRow *clist_row;
GList *list;
gint attributes_mask;
@@ -4821,32 +4810,15 @@
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 @@
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 @@
/* 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 @@
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 @@
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 @@
if (layout)
{
gint row_center_offset = (clist->row_height - logical_rect.height - 1) / 2;
- gdk_cairo_set_source_color(cr, >k_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));
@@ -6091,30 +6060,6 @@
}
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: gtkcmctree.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Attic/gtkcmctree.c,v
retrieving revision 1.1.2.23
retrieving revision 1.1.2.24
diff -u -d -r1.1.2.23 -r1.1.2.24
--- gtkcmctree.c 25 Oct 2011 19:28:04 -0000 1.1.2.23
+++ gtkcmctree.c 25 Oct 2011 23:00:05 -0000 1.1.2.24
@@ -492,7 +492,7 @@
cairo_fill(cr);
cairo_new_path(cr);
- gdk_cairo_set_source_color(cr, >k_widget_get_style(ctree)->fg[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color(cr, >k_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 @@
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 @@
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 @@
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 @@
}
else
{
- rect = &clip_rectangle;
crect = &cell_rectangle;
gdk_cairo_rectangle(cr, &cell_rectangle);
@@ -1382,7 +1381,6 @@
GtkCMCList *clist;
GtkCMCTreeNode *node;
GtkCMCTreeNode *child;
- GtkStyle *style;
gint i;
cm_return_if_fail (GTK_IS_CMCTREE (widget));
@@ -1401,8 +1399,6 @@
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 @@
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 @@
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);
}
}
More information about the Commits
mailing list