[maemo-commits] [maemo-commits] r9670 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . libhildondesktop
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Feb 6 14:08:13 EET 2007
- Previous message: [maemo-commits] r9669 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . libhildondesktop src
- Next message: [maemo-commits] r9671 - in projects/haf/branches/maemo-af-desktop/python-hildondesktop: . libhildondesktop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: moimart Date: 2007-02-06 14:08:12 +0200 (Tue, 06 Feb 2007) New Revision: 9670 Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c Log: * libhildondesktop/hildon-desktop-panel-expandable.c: - Implemented position for statusbar * libhildondesktop/hildon-desktop-window-dialog.c: - Set the number of items to 7 for expandable panel. * ChangeLog updated. Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog =================================================================== --- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog 2007-02-06 11:55:36 UTC (rev 9669) +++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog 2007-02-06 12:08:12 UTC (rev 9670) @@ -1,3 +1,10 @@ +2007-02-06 Moises Martinez <moises.martinez at nokia.com> + + * libhildondesktop/hildon-desktop-panel-expandable.c: + - Implemented position for statusbar + * libhildondesktop/hildon-desktop-window-dialog.c: + - Set the number of items to 7 for expandable panel. + 2007-02-06 Lucas Rocha <lucas.rocha at nokia.com> * src/hd-desktop.c, libhildondesktop/hildon-desktop-window.[ch]: move Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c =================================================================== --- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c 2007-02-06 11:55:36 UTC (rev 9669) +++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c 2007-02-06 12:08:12 UTC (rev 9670) @@ -42,9 +42,12 @@ { guint items_p_row; guint n_items; + guint current_position; GHashTable *items; + GList *queued_items; + GtkWindow *extension_window; GtkTable *extension_table; @@ -130,14 +133,17 @@ { panel->priv = HILDON_DESKTOP_PANEL_EXPANDABLE_GET_PRIVATE (panel); - panel->priv->items_p_row = 0; - panel->priv->n_items = 0; + panel->priv->items_p_row = + panel->priv->n_items = + panel->priv->current_position = 0; panel->priv->items = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) gtk_widget_destroy); + panel->priv->queued_items = NULL; + panel->priv->extension_opened = FALSE; panel->priv->extension_table = NULL; @@ -288,6 +294,8 @@ G_CALLBACK (hildon_desktop_panel_expandable_button_destroyed), (gpointer)panel); + g_object_set (G_OBJECT (item), "position", ex_panel->priv->current_position++, NULL); + if (STATUSBAR_IS_ITEM (button)) { g_signal_connect_after (STATUSBAR_ITEM (item), @@ -336,6 +344,8 @@ HILDON_DESKTOP_ITEM (item)->id, (gpointer)item); } + + g_debug ("Number of items: %d",ex_panel->priv->n_items); } static void @@ -405,14 +415,25 @@ HildonDesktopItem *item, HildonDesktopPanelExpandable *panel) { + panel->priv->queued_items = + g_list_append (panel->priv->queued_items, item); +} - hildon_desktop_panel_expandable_add_button (HILDON_DESKTOP_PANEL (panel), - GTK_WIDGET (item)); +static gint +hildon_desktop_panel_expandable_sort_items (gconstpointer a, gconstpointer b) +{ + gint p1,p2; - if (STATUSBAR_IS_ITEM (item) && !STATUSBAR_ITEM (item)->condition) - g_debug ("not unreffing"); - else - g_object_unref (G_OBJECT (item)); + g_object_get (G_OBJECT (a), "position", &p1, NULL); + g_object_get (G_OBJECT (b), "position", &p2, NULL); + + if (p1 < p2) + return -1; + else + if (p1 == p2) + return 0; + else + return 1; } static void @@ -422,7 +443,7 @@ GList *children_panel, *children_table, *l; - children_panel = children_table = NULL; + panel->priv->queued_items = children_panel = children_table = NULL; children_panel = gtk_container_get_children (GTK_CONTAINER (panel)); children_table = gtk_container_get_children (GTK_CONTAINER (panel->priv->extension_table)); @@ -443,17 +464,35 @@ GTK_WIDGET (l->data)); } - panel->priv->n_items = 0; - + panel->priv->n_items = panel->priv->current_position = 0; + g_hash_table_foreach (panel->priv->items, (GHFunc)hildon_desktop_panel_expandable_hash_adding, (gpointer)panel); + + panel->priv->queued_items = + g_list_sort (panel->priv->queued_items, + (GCompareFunc)hildon_desktop_panel_expandable_sort_items); + for (l = panel->priv->queued_items; l; l = g_list_next (l)) + g_debug ("position %s: %d",HILDON_DESKTOP_ITEM (l->data)->id, HILDON_DESKTOP_PANEL_ITEM (l->data)->position); + + for (l = panel->priv->queued_items; l; l = g_list_next (l)) + { + hildon_desktop_panel_expandable_add_button (HILDON_DESKTOP_PANEL (panel), + GTK_WIDGET (l->data)); + + if (STATUSBAR_IS_ITEM (l->data) && !STATUSBAR_ITEM (l->data)->condition) + g_debug ("not unreffing"); + else + g_object_unref (G_OBJECT (l->data)); + } + + g_list_free (panel->priv->queued_items); g_list_free (children_panel); g_list_free (children_table); } - static GtkWidget * hildon_desktop_panel_expandable_add_arrow (HildonDesktopPanelExpandable *panel) { Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c =================================================================== --- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c 2007-02-06 11:55:36 UTC (rev 9669) +++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-window-dialog.c 2007-02-06 12:08:12 UTC (rev 9670) @@ -127,7 +127,7 @@ gtk_widget_push_composite_child (); HILDON_DESKTOP_WINDOW (window)->container = - g_object_new (HILDON_DESKTOP_TYPE_PANEL_EXPANDABLE, "items_row", 3, NULL); + g_object_new (HILDON_DESKTOP_TYPE_PANEL_EXPANDABLE, "items_row", 7,NULL); if (parent != NULL) gtk_container_add (parent,
- Previous message: [maemo-commits] r9669 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . libhildondesktop src
- Next message: [maemo-commits] r9671 - in projects/haf/branches/maemo-af-desktop/python-hildondesktop: . libhildondesktop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]