[gnome-panel/wip/packed-objects: 1/17] panel: When creating an object, explicitly specify how it's packed



commit 460b2bd241420b5ebf93265b3999397e52063397
Author: Vincent Untz <vuntz gnome org>
Date:   Mon Mar 28 17:11:48 2011 +0530

    panel: When creating an object, explicitly specify how it's packed
    
    Instead of saying whether it's packed to the end, we pass the real pack
    method. This will enable us to add centered objects.

 gnome-panel/launcher.c            |    3 ++-
 gnome-panel/panel-action-button.c |    2 +-
 gnome-panel/panel-applet-frame.c  |    2 +-
 gnome-panel/panel-layout.c        |   16 ++++++++--------
 gnome-panel/panel-layout.h        |    4 ++--
 gnome-panel/panel-menu-bar.c      |    2 +-
 gnome-panel/panel-menu-button.c   |    2 +-
 gnome-panel/panel-separator.c     |    2 +-
 8 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/gnome-panel/launcher.c b/gnome-panel/launcher.c
index 286bc68..9e00a27 100644
--- a/gnome-panel/launcher.c
+++ b/gnome-panel/launcher.c
@@ -971,7 +971,8 @@ panel_launcher_create_with_id (const char    *toplevel_id,
 
 	id = panel_layout_object_create_start (PANEL_OBJECT_LAUNCHER,
 					       NULL,
-					       toplevel_id, position, FALSE,
+					       toplevel_id,
+					       position, PANEL_OBJECT_PACK_START,
 					       &settings);
 
 	no_uri = NULL;
diff --git a/gnome-panel/panel-action-button.c b/gnome-panel/panel-action-button.c
index 4e17a88..68a532d 100644
--- a/gnome-panel/panel-action-button.c
+++ b/gnome-panel/panel-action-button.c
@@ -662,7 +662,7 @@ panel_action_button_create (PanelToplevel         *toplevel,
 	panel_layout_object_create (PANEL_OBJECT_ACTION,
 				    detail,
 				    panel_toplevel_get_id (toplevel),
-				    position, FALSE);
+				    position, PANEL_OBJECT_PACK_START);
 }
 
 void
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index 6b6bdb0..5bf26d4 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -1013,5 +1013,5 @@ panel_applet_frame_create (PanelToplevel *toplevel,
 	panel_layout_object_create (PANEL_OBJECT_APPLET,
 				    iid,
 				    panel_toplevel_get_id (toplevel),
-				    position, FALSE);
+				    position, PANEL_OBJECT_PACK_START);
 }
diff --git a/gnome-panel/panel-layout.c b/gnome-panel/panel-layout.c
index bdf3bcc..e966d27 100644
--- a/gnome-panel/panel-layout.c
+++ b/gnome-panel/panel-layout.c
@@ -597,16 +597,16 @@ panel_layout_toplevel_create (GdkScreen *screen)
 }
 
 void
-panel_layout_object_create (PanelObjectType   type,
-                            const char       *type_detail,
-                            const char       *toplevel_id,
-                            int               position,
-                            gboolean          pack_end)
+panel_layout_object_create (PanelObjectType  type,
+                            const char      *type_detail,
+                            const char      *toplevel_id,
+                            int              position,
+                            PanelObjectPack  pack)
 {
         char *id;
 
         id = panel_layout_object_create_start (type, type_detail,
-                                               toplevel_id, position, pack_end,
+                                               toplevel_id, position, pack,
                                                NULL);
 
         if (!id)
@@ -661,7 +661,7 @@ panel_layout_object_create_start (PanelObjectType   type,
                                   const char       *type_detail,
                                   const char       *toplevel_id,
                                   int               position,
-                                  gboolean          pack_end,
+                                  PanelObjectPack   pack,
                                   GSettings       **settings)
 {
         char      *unique_id;
@@ -696,7 +696,7 @@ panel_layout_object_create_start (PanelObjectType   type,
                             position);
         g_settings_set_enum (settings_object,
                              PANEL_OBJECT_PACK_KEY,
-                             pack_end ? PANEL_OBJECT_PACK_END : PANEL_OBJECT_PACK_START);
+                             pack);
 
         g_free (iid);
 
diff --git a/gnome-panel/panel-layout.h b/gnome-panel/panel-layout.h
index 7f6dbd6..915047e 100644
--- a/gnome-panel/panel-layout.h
+++ b/gnome-panel/panel-layout.h
@@ -44,7 +44,7 @@ void  panel_layout_object_create        (PanelObjectType   type,
 					 const char       *type_detail,
 					 const char       *toplevel_id,
 					 int               position,
-					 gboolean          pack_end);
+					 PanelObjectPack   pack);
 
 char      *panel_layout_object_get_gconf_path (const char *object_id);
 GSettings *panel_layout_get_instance_settings (GSettings  *settings_object,
@@ -54,7 +54,7 @@ char *panel_layout_object_create_start  (PanelObjectType   type,
 					 const char       *type_detail,
 					 const char       *toplevel_id,
 					 int               position,
-					 gboolean          pack_end,
+					 PanelObjectPack   pack,
 					 GSettings       **settings);
 void  panel_layout_object_create_finish (const char       *object_id);
 
diff --git a/gnome-panel/panel-menu-bar.c b/gnome-panel/panel-menu-bar.c
index e5617ed..c1f2139 100644
--- a/gnome-panel/panel-menu-bar.c
+++ b/gnome-panel/panel-menu-bar.c
@@ -436,7 +436,7 @@ panel_menu_bar_create (PanelToplevel *toplevel,
 {
 	panel_layout_object_create (PANEL_OBJECT_MENU_BAR, NULL,
 				    panel_toplevel_get_id (toplevel),
-				    position, FALSE);
+				    position, PANEL_OBJECT_PACK_START);
 }
 
 void
diff --git a/gnome-panel/panel-menu-button.c b/gnome-panel/panel-menu-button.c
index 7283019..f0b9b3f 100644
--- a/gnome-panel/panel-menu-button.c
+++ b/gnome-panel/panel-menu-button.c
@@ -784,7 +784,7 @@ panel_menu_button_create (PanelToplevel *toplevel,
 
 	id = panel_layout_object_create_start (PANEL_OBJECT_MENU, NULL,
 					       panel_toplevel_get_id (toplevel),
-					       position, FALSE,
+					       position, PANEL_OBJECT_PACK_START,
 					       &settings);
 
 	settings_instance = panel_layout_get_instance_settings (settings,
diff --git a/gnome-panel/panel-separator.c b/gnome-panel/panel-separator.c
index 07feba3..2b579aa 100644
--- a/gnome-panel/panel-separator.c
+++ b/gnome-panel/panel-separator.c
@@ -261,7 +261,7 @@ panel_separator_create (PanelToplevel *toplevel,
 {
 	panel_layout_object_create (PANEL_OBJECT_SEPARATOR, NULL,
 				    panel_toplevel_get_id (toplevel),
-				    position, FALSE);
+				    position, PANEL_OBJECT_PACK_START);
 }
 
 void



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