[gnome-shell] StTable: Update row and column count in st_table_remove_actor
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] StTable: Update row and column count in st_table_remove_actor
- Date: Wed, 31 Mar 2010 14:55:35 +0000 (UTC)
commit 2ca5cfd6f59a207d7844c90273e437497586bbbc
Author: Adel Gadllah <adel gadllah gmail com>
Date: Wed Mar 31 16:43:41 2010 +0200
StTable: Update row and column count in st_table_remove_actor
Adjust the table size when removing an actor in st_table_remove_actor.
https://bugzilla.gnome.org/show_bug.cgi?id=614144
src/st/st-table.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-table.c b/src/st/st-table.c
index c79a9ef..1949077 100644
--- a/src/st/st-table.c
+++ b/src/st/st-table.c
@@ -114,6 +114,39 @@ st_table_remove_actor (ClutterContainer *container,
ClutterActor *actor)
{
StTablePrivate *priv = ST_TABLE (container)->priv;
+ GList *list;
+ gint n_rows = 0;
+ gint n_cols = 0;
+
+ /* Calculate and update the number of rows / columns */
+ for (list = priv->children; list; list = list->next)
+ {
+ ClutterActor *child = CLUTTER_ACTOR (list->data);
+ StTableChild *meta;
+
+ if (child == actor)
+ continue;
+
+ meta = (StTableChild *) clutter_container_get_child_meta (container, child);
+ n_rows = MAX (n_rows, meta->row + 1);
+ n_cols = MAX (n_cols, meta->col + 1);
+ }
+
+ g_object_freeze_notify (G_OBJECT (container));
+
+ if (priv->n_rows != n_rows)
+ {
+ priv->n_rows = n_rows;
+ g_object_notify (G_OBJECT (container), "row-count");
+ }
+
+ if (priv->n_cols != n_cols)
+ {
+ priv->n_cols = n_cols;
+ g_object_notify (G_OBJECT (container), "column-count");
+ }
+
+ g_object_thaw_notify (G_OBJECT (container));
_st_container_remove_actor (container, actor, &priv->children);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]