[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (b372ca668852701f5e19b878ee3aa97361e377c8)



The branch, master has been updated
       via  b372ca668852701f5e19b878ee3aa97361e377c8 (commit)
      from  89ca3994480c74b23f05c4deac0eee24dee0d9b0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/gtk/ghid-cell-renderer-visibility.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)


=================
 Commit Messages
=================

commit b372ca668852701f5e19b878ee3aa97361e377c8
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Use gtk_cell_renderer_get_{align,pad} accessors
    
    In GTK3.0, direct access to these fields will be impossible.

:100644 100644 ee5f6cb... 6e69744... M	src/hid/gtk/ghid-cell-renderer-visibility.c

=========
 Changes
=========

commit b372ca668852701f5e19b878ee3aa97361e377c8
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Use gtk_cell_renderer_get_{align,pad} accessors
    
    In GTK3.0, direct access to these fields will be impossible.

diff --git a/src/hid/gtk/ghid-cell-renderer-visibility.c b/src/hid/gtk/ghid-cell-renderer-visibility.c
index ee5f6cb..6e69744 100644
--- a/src/hid/gtk/ghid-cell-renderer-visibility.c
+++ b/src/hid/gtk/ghid-cell-renderer-visibility.c
@@ -54,9 +54,14 @@ ghid_cell_renderer_visibility_get_size (GtkCellRenderer *cell,
 {
   GtkStyle *style = gtk_widget_get_style (widget);
   gint w, h;
+  gint xpad, ypad;
+  gfloat xalign, yalign;
 
-  w = VISIBILITY_TOGGLE_SIZE + 2 * (cell->xpad + style->xthickness);
-  h = VISIBILITY_TOGGLE_SIZE + 2 * (cell->ypad + style->ythickness);
+  gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
+  gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
+
+  w = VISIBILITY_TOGGLE_SIZE + 2 * (xpad + style->xthickness);
+  h = VISIBILITY_TOGGLE_SIZE + 2 * (ypad + style->ythickness);
 
   if (width)
     *width = w;
@@ -67,13 +72,12 @@ ghid_cell_renderer_visibility_get_size (GtkCellRenderer *cell,
     {
       if (x_offset)
         {
-          gint xalign = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
-                          ? 1.0 - cell->xalign
-                          : cell->xalign;
+          if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+            xalign = 1. - xalign;
           *x_offset = MAX (0, xalign * (cell_area->width - w));
         }
       if (y_offset)
-        *y_offset = MAX(0, cell->yalign * (cell_area->height - h));
+        *y_offset = MAX(0, yalign * (cell_area->height - h));
     }
 }
 
@@ -90,6 +94,7 @@ ghid_cell_renderer_visibility_render (GtkCellRenderer      *cell,
   GHidCellRendererVisibility *pcb_cell;
   GdkRectangle toggle_rect;
   GdkRectangle draw_rect;
+  gint xpad, ypad;
 
   pcb_cell = GHID_CELL_RENDERER_VISIBILITY (cell);
   ghid_cell_renderer_visibility_get_size (cell, widget, cell_area,
@@ -97,11 +102,12 @@ ghid_cell_renderer_visibility_render (GtkCellRenderer      *cell,
                                           &toggle_rect.y,
                                           &toggle_rect.width,
                                           &toggle_rect.height);
+  gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
 
-  toggle_rect.x      += cell_area->x + cell->xpad;
-  toggle_rect.y      += cell_area->y + cell->ypad;
-  toggle_rect.width  -= cell->xpad * 2;
-  toggle_rect.height -= cell->ypad * 2;
+  toggle_rect.x      += cell_area->x + xpad;
+  toggle_rect.y      += cell_area->y + ypad;
+  toggle_rect.width  -= xpad * 2;
+  toggle_rect.height -= ypad * 2;
 
   if (toggle_rect.width <= 0 || toggle_rect.height <= 0)
     return;




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs