[anjal] Fix some padding & activate issues on the custom vbox renderer
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Fix some padding & activate issues on the custom vbox renderer
- Date: Mon, 30 Mar 2009 01:35:21 -0400 (EDT)
commit 8ead6c73545d15092298ad55115b61871d09ed33
Author: Srinivasa Ragavan <sragavan novell com>
Date: Mon Mar 30 10:41:23 2009 +0530
Fix some padding & activate issues on the custom vbox renderer
---
src/custom-cell-renderer-vbox.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/custom-cell-renderer-vbox.c b/src/custom-cell-renderer-vbox.c
index 80d07fa..f16868e 100644
--- a/src/custom-cell-renderer-vbox.c
+++ b/src/custom-cell-renderer-vbox.c
@@ -347,7 +347,7 @@ custom_cell_renderer_vbox_render (GtkCellRenderer *cell,
custom_cell_renderer_vbox_get_size (cell, widget, cell_area,
&x_offset, &y_offset,
&width, &height);
- cell_area->y = cell_area->y - (height / 2) + (4 * cell->ypad);
+ cell_area->y = cell_area->y - (height / 2) + (5 * cell->ypad);
store_x = cell_area->x;
while(tmp) {
GtkCellRenderer *child = (GtkCellRenderer *)tmp->data;
@@ -355,12 +355,10 @@ custom_cell_renderer_vbox_render (GtkCellRenderer *cell,
cell_area->x = store_x;
gtk_cell_renderer_get_size (child, widget, cell_area, &cx, &cy, &cw, &ch);
-// if (GTK_IS_CELL_RENDERER_PIXBUF(child) && (!(flags & GTK_CELL_RENDERER_SELECTED))) {
-// // printf("insensitive\n");
-// gtk_cell_renderer_render (child, window, widget, background_area, cell_area, expose_area, GTK_CELL_RENDERER_INSENSITIVE);
-// }
-// else
- gtk_cell_renderer_render (child, window, widget, background_area, cell_area, expose_area, flags);
+ if (GTK_IS_CELL_RENDERER_PIXBUF(child) && (!(flags & GTK_CELL_RENDERER_SELECTED)))
+ gtk_cell_renderer_render (child, window, widget, background_area, cell_area, expose_area, GTK_CELL_RENDERER_INSENSITIVE);
+ else
+ gtk_cell_renderer_render (child, window, widget, background_area, cell_area, expose_area, flags);
/* FIXME: Just trial & error hacks. Need to find why chiid's ypad is 0 */
cell_area->y += ch - (2*2)+ i; /* 2-cellpad*/
i+=4;
@@ -391,7 +389,7 @@ cc_vbox_activate (GtkCellRenderer *cell,
custom_cell_renderer_vbox_get_size (cell, widget, cell_area,
&x_offset, &y_offset,
&width, &height);
- cell_area->y = cell_area->y - (4 * cell->ypad);
+ cell_area->y = cell_area->y - (9 * cell->ypad);
store_x = cell_area->x;
while(tmp) {
GtkCellRenderer *child = (GtkCellRenderer *)tmp->data;
@@ -402,15 +400,15 @@ cc_vbox_activate (GtkCellRenderer *cell,
if ((event->x >= cell_area->x && event->x <= cell_area->x+cw) &&
(event->y >= cell_area->y +ch&& event->y <= cell_area->y+(2*ch))) {
CellRenderActivateFunc func = g_object_get_data (child, "activate_func");
- if (func) {
+ if (func) {
(*func)(cell, event, widget, path, background_area, cell_area, flags);
return TRUE;
}
}
- cell_area->y += ch - (2*2)+ i; /* 2-cellpad*/
+ cell_area->y += ch - (1*2)+ i; /* 2-cellpad*/
i+=4;
- cell_area->y += 3*2; /* 2 - cell-pad */
+ cell_area->y += 1*2; /* 2 - cell-pad */
tmp = tmp->next;
}
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]