]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/gtk+/gtk+-2.6.4-1.osso7/gtktable.c.diff
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / gtk+ / gtk+-2.6.4-1.osso7 / gtktable.c.diff
1 --- gtk+-2.6.4/gtk/gtktable.c   2004-08-09 19:59:52.000000000 +0300
2 +++ gtk+-2.6.4/gtk/gtktable.c   2005-04-06 16:19:37.974765320 +0300
3 @@ -28,6 +28,7 @@
4  #include "gtkalias.h"
5  #include "gtktable.h"
6  #include "gtkintl.h"
7 +#include "gtkbutton.h"
8  
9  enum
10  {
11 @@ -507,6 +508,33 @@
12    return GTK_WIDGET (table);
13  }
14  
15 +void osso_gtk_table_find_button_detail (GtkTable *table,
16 +                                       GtkTableChild *table_child)
17 +{
18 +  OssoGtkButtonAttachFlags attachflags = 0;
19 +  gboolean automatic_detail;
20 +
21 +  g_return_if_fail (GTK_IS_TABLE (table));
22 +  g_return_if_fail (table_child != NULL);
23 +  g_return_if_fail (GTK_IS_BUTTON (table_child->widget));
24 +
25 +  if (table_child->top_attach == 0)
26 +    attachflags |= OSSO_GTK_BUTTON_ATTACH_NORTH;
27 +
28 +  if (table_child->bottom_attach == table->nrows)
29 +    attachflags |= OSSO_GTK_BUTTON_ATTACH_SOUTH;
30 +
31 +  if (table_child->left_attach == 0)
32 +    attachflags |= OSSO_GTK_BUTTON_ATTACH_WEST;
33 +
34 +  if (table_child->right_attach == table->ncols)
35 +    attachflags |= OSSO_GTK_BUTTON_ATTACH_EAST;
36 +
37 +  g_object_get (G_OBJECT (table_child->widget), "automatic_detail", &automatic_detail, NULL);
38 +  if (automatic_detail == TRUE)
39 +    g_object_set (G_OBJECT (table_child->widget), "detail", osso_gtk_button_attach_details[attachflags], NULL);
40 +}
41 +
42  void
43  gtk_table_resize (GtkTable *table,
44                   guint     n_rows,
45 @@ -523,6 +551,18 @@
46        n_cols != table->ncols)
47      {
48        GList *list;
49 +      guint recalc_column = -1;
50 +      guint recalc_row = -1;
51 +
52 +      if (n_rows > table->nrows)
53 +        recalc_row = table->nrows;
54 +      else
55 +        recalc_row = n_rows;
56 +
57 +      if (n_cols > table->ncols)
58 +        recalc_column = table->ncols;
59 +      else
60 +        recalc_column = n_cols;
61        
62        for (list = table->children; list; list = list->next)
63         {
64 @@ -577,6 +617,20 @@
65  
66           g_object_notify (G_OBJECT (table), "n_columns");
67         }
68 +
69 +      if ((recalc_column != -1) || (recalc_row != -1))
70 +       for (list = table->children; list; list = list->next)
71 +       {
72 +         GtkTableChild *child;
73 +         
74 +         child = list->data;
75 +
76 +          if (GTK_IS_BUTTON (child->widget) &&
77 +               ((child->bottom_attach == recalc_row) ||
78 +               (child->right_attach == recalc_column)))
79 +
80 +           osso_gtk_table_find_button_detail (table, child);
81 +       }
82      }
83  }
84  
85 @@ -623,6 +677,10 @@
86    table_child->yshrink = (yoptions & GTK_SHRINK) != 0;
87    table_child->yfill = (yoptions & GTK_FILL) != 0;
88    table_child->ypadding = ypadding;
89 +
90 +
91 +  if (GTK_IS_BUTTON (table_child->widget))
92 +    osso_gtk_table_find_button_detail (table, table_child);
93    
94    table->children = g_list_prepend (table->children, table_child);
95