diff options
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtktable.c | 43 | ||||
-rw-r--r-- | gtk/gtktable.h | 1 |
2 files changed, 36 insertions, 8 deletions
diff --git a/gtk/gtktable.c b/gtk/gtktable.c index cae41a0c60..08a27ab533 100644 --- a/gtk/gtktable.c +++ b/gtk/gtktable.c @@ -1071,6 +1071,7 @@ gtk_table_size_allocate_init (GtkTable *table) table->cols[col].need_shrink = TRUE; table->cols[col].expand = FALSE; table->cols[col].shrink = TRUE; + table->cols[col].empty = TRUE; } for (row = 0; row < table->nrows; row++) { @@ -1079,6 +1080,7 @@ gtk_table_size_allocate_init (GtkTable *table) table->rows[row].need_shrink = TRUE; table->rows[row].expand = FALSE; table->rows[row].shrink = TRUE; + table->rows[row].empty = TRUE; } /* Loop over all the children and adjust the row and col values @@ -1101,6 +1103,8 @@ gtk_table_size_allocate_init (GtkTable *table) if (!child->xshrink) table->cols[child->left_attach].shrink = FALSE; + + table->cols[child->left_attach].empty = FALSE; } if (child->top_attach == (child->bottom_attach - 1)) @@ -1110,6 +1114,8 @@ gtk_table_size_allocate_init (GtkTable *table) if (!child->yshrink) table->rows[child->top_attach].shrink = FALSE; + + table->rows[child->top_attach].empty = FALSE; } } } @@ -1127,6 +1133,9 @@ gtk_table_size_allocate_init (GtkTable *table) { if (child->left_attach != (child->right_attach - 1)) { + for (col = child->left_attach; col < child->right_attach; col++) + table->cols[col].empty = FALSE; + if (child->xexpand) { has_expand = FALSE; @@ -1160,6 +1169,9 @@ gtk_table_size_allocate_init (GtkTable *table) if (child->top_attach != (child->bottom_attach - 1)) { + for (row = child->top_attach; row < child->bottom_attach; row++) + table->rows[row].empty = FALSE; + if (child->yexpand) { has_expand = FALSE; @@ -1198,10 +1210,18 @@ gtk_table_size_allocate_init (GtkTable *table) */ for (col = 0; col < table->ncols; col++) { - if (table->cols[col].need_expand) - table->cols[col].expand = TRUE; - if (!table->cols[col].need_shrink) - table->cols[col].shrink = FALSE; + if (table->cols[col].empty) + { + table->cols[col].expand = FALSE; + table->cols[col].shrink = FALSE; + } + else + { + if (table->cols[col].need_expand) + table->cols[col].expand = TRUE; + if (!table->cols[col].need_shrink) + table->cols[col].shrink = FALSE; + } } /* Loop over the rows and set the expand and shrink values @@ -1209,10 +1229,17 @@ gtk_table_size_allocate_init (GtkTable *table) */ for (row = 0; row < table->nrows; row++) { - if (table->rows[row].need_expand) - table->rows[row].expand = TRUE; - if (!table->rows[row].need_shrink) - table->rows[row].shrink = FALSE; + if (table->rows[row].empty) + { + table->rows[row].expand = FALSE; + table->rows[row].shrink = FALSE; + } + { + if (table->rows[row].need_expand) + table->rows[row].expand = TRUE; + if (!table->rows[row].need_shrink) + table->rows[row].shrink = FALSE; + } } } diff --git a/gtk/gtktable.h b/gtk/gtktable.h index 2c3d905911..e4234853ff 100644 --- a/gtk/gtktable.h +++ b/gtk/gtktable.h @@ -87,6 +87,7 @@ struct _GtkTableRowCol guint need_shrink : 1; guint expand : 1; guint shrink : 1; + guint empty : 1; }; |