[maemo-commits] [maemo-commits] r9375 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . data libhildondesktop src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jan 26 18:13:14 EET 2007
Author: moimart
Date: 2007-01-26 18:13:13 +0200 (Fri, 26 Jan 2007)
New Revision: 9375

Added:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/data/statusbar.conf
Modified:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
   projects/haf/branches/maemo-af-desktop/hildon-desktop/data/Makefile.am
   projects/haf/branches/maemo-af-desktop/hildon-desktop/data/desktop.conf
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-config.h
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c
Log:

	* data/statusbar.conf: configuration file for statusbar
        * data/desktop.conf: added statusbar layout
        * data/Makefile.am: updated.
        * libhildondesktop/hildon-desktop-panel-expandable.c:
        - Set the size to widgets.
        * src/hd-desktop.c: check new type of panel (expandable)
        * src/hd-config.h: Added new key 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-01-26 14:55:26 UTC (rev 9374)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2007-01-26 16:13:13 UTC (rev 9375)
@@ -1,3 +1,13 @@
+2007-01-26  Moises Martinez  <moises.martinez at nokia.com>
+
+	* data/statusbar.conf: configuration file for statusbar
+	* data/desktop.conf: added statusbar layout
+	* data/Makefile.am: updated.
+	* libhildondesktop/hildon-desktop-panel-expandable.c:
+	- Set the size to widgets.
+	* src/hd-desktop.c: check new type of panel (expandable)
+	* src/hd-config.h: Added new key for expandable panel
+
 2007-01-26  Johan Bilien  <johan.bilien at nokia.com>
 
 	* src/hn-others-button.c: Fixed bottom orientation

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/data/Makefile.am
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/data/Makefile.am	2007-01-26 14:55:26 UTC (rev 9374)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/data/Makefile.am	2007-01-26 16:13:13 UTC (rev 9375)
@@ -3,7 +3,8 @@
 	tasknavigator.conf  \
 	home.conf           \
 	home-layout.conf    \
-	home-background.conf
+	home-background.conf \
+	statusbar.conf
 
 hildonnavigatordesktopentry_DATA = \
 	app-switcher.desktop       \

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/data/desktop.conf
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/data/desktop.conf	2007-01-26 14:55:26 UTC (rev 9374)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/data/desktop.conf	2007-01-26 16:13:13 UTC (rev 9375)
@@ -12,3 +12,14 @@
 X-Type=home
 X-Config-File=home.conf
 X-Plugin-Dir=/usr/share/applications/hildon-home
+
+[Statusbar]
+X-Type=panel_expandable
+X-Position-X=400
+X-Position-Y=0
+X-Size-Width=200
+X-Size-Height=50
+X-Orientation=top
+X-Config-File=statusbar.conf
+X-Plugin-Dir=/usr/share/applications/hildon-status-bar
+

Added: projects/haf/branches/maemo-af-desktop/hildon-desktop/data/statusbar.conf
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/data/statusbar.conf	2007-01-26 14:55:26 UTC (rev 9374)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/data/statusbar.conf	2007-01-26 16:13:13 UTC (rev 9375)
@@ -0,0 +1,4 @@
+[/usr/share/applications/hildon-status-bar/contact.desktop]
+[/usr/share/applications/hildon-status-bar/hildon-status-bar-battery.desktop]
+[/usr/share/applications/hildon-status-bar/hildon-status-bar-usb.desktop]
+[/usr/share/applications/hildon-status-bar/sound.desktop]

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-01-26 14:55:26 UTC (rev 9374)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-desktop-panel-expandable.c	2007-01-26 16:13:13 UTC (rev 9375)
@@ -31,8 +31,10 @@
 #define HILDON_DESKTOP_PANEL_EXPANDABLE_GET_PRIVATE(object) \
         (G_TYPE_INSTANCE_GET_PRIVATE ((object), HILDON_DESKTOP_TYPE_PANEL_EXPANDABLE, HildonDesktopPanelExpandablePrivate))
 
+#define HSB_ITEM_WIDTH 40
+#define HSB_ITEM_HEIGHT 50
+#define HSB_ARROW_ICON_SIZE HSB_ITEM_WIDTH
 #define HSB_ARROW_ICON_NAME "qgn_stat_more"
-#define HSB_ARROW_ICON_SIZE 40
 
 G_DEFINE_TYPE (HildonDesktopPanelExpandable, hildon_desktop_panel_expandable, HILDON_DESKTOP_TYPE_PANEL);
 
@@ -140,6 +142,7 @@
 {
   GObject *object;
   HildonDesktopPanelExpandable *panel;
+  gint item_width, item_height;
 
   object = 
     G_OBJECT_CLASS (hildon_desktop_panel_expandable_parent_class)->constructor (gtype,
@@ -166,6 +169,11 @@
 		    "notify::items_row",
 		    G_CALLBACK (hildon_desktop_panel_expandable_resize_notify),
 		    NULL);
+
+  g_object_get (object, "item_width", &item_width, "item_height", &item_height, NULL);
+
+  if (item_width == 0 || item_height == 0)
+    g_object_set (object, "item_width", HSB_ITEM_WIDTH, "item_height", HSB_ITEM_HEIGHT, NULL);
   
   return object;
 }
@@ -247,9 +255,14 @@
 {
   HildonDesktopPanelItem *item = HILDON_DESKTOP_PANEL_ITEM (button);
   HildonDesktopPanelExpandable *ex_panel = HILDON_DESKTOP_PANEL_EXPANDABLE (panel);
+  gint item_width,item_height;
 
   g_debug ("Adding button in expandable %d %d",ex_panel->priv->items_p_row,ex_panel->priv->n_items+1);
+
+  g_object_get (G_OBJECT (panel), "item_width", &item_width, "item_height", &item_height, NULL);
   
+  gtk_widget_set_size_request (button, item_width, item_height);
+  
   if (STATUSBAR_IS_ITEM (button))
   {
     g_signal_connect (STATUSBAR_ITEM (item),
@@ -260,11 +273,12 @@
 
   if ((ex_panel->priv->n_items+1) > ex_panel->priv->items_p_row)
   {
-    GtkWidget *arrow =  hildon_desktop_panel_expandable_add_arrow (ex_panel);
-
     if (ex_panel->priv->arrow == NULL)
     {
+      GtkWidget *arrow = hildon_desktop_panel_expandable_add_arrow (ex_panel);
+	    
       HILDON_DESKTOP_PANEL_CLASS (hildon_desktop_panel_expandable_parent_class)->add_button (panel,arrow);
+      
       ex_panel->priv->arrow = arrow;
     }
     
@@ -385,6 +399,7 @@
   GError *error = NULL;
   GdkPixbuf *arrow_pixbuf;
   GtkIconTheme *icon_theme;
+  gint item_width, item_height;
   
   arrow_button = gtk_toggle_button_new ();
  
@@ -415,8 +430,13 @@
 		    G_CALLBACK (hildon_desktop_panel_expandable_arrow_toggled),
 		    (gpointer)panel);
 
-  gtk_widget_show_all (arrow_button);
+  g_object_get (panel, "item_width", &item_width, "item_height", &item_height, NULL);
 
+  gtk_widget_set_size_request (arrow_button, item_width, item_height);
+  gtk_widget_set_size_request (arrow_image, item_width, item_height);
+
+  gtk_widget_show (arrow_button);
+  
   return arrow_button;
 }
 

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-config.h
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-config.h	2007-01-26 14:55:26 UTC (rev 9374)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-config.h	2007-01-26 16:13:13 UTC (rev 9375)
@@ -37,7 +37,7 @@
 #define HD_CONTAINER_TYPE_HOME              "home"
 #define HD_CONTAINER_TYPE_PANEL_FIXED       "panel_fixed"
 #define HD_CONTAINER_TYPE_PANEL_BOX         "panel_box"
-#define HD_CONTAINER_TYPE_PANEL_SLIDER      "panel_slider"
+#define HD_CONTAINER_TYPE_PANEL_EXPANDABLE  "panel_expandable"
 
 #define HD_WINDOW_ORIENTATION_TOP           "top"
 #define HD_WINDOW_ORIENTATION_BOTTOM        "bottom"

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c	2007-01-26 14:55:26 UTC (rev 9374)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c	2007-01-26 16:13:13 UTC (rev 9375)
@@ -38,6 +38,7 @@
 
 #include <hildon-base-lib/hildon-base-dnotify.h>
 #include <libhildondesktop/hildon-desktop-window.h>
+#include <libhildondesktop/hildon-desktop-panel-window-dialog.h>
 
 #include "hd-desktop.h"
 #include "hd-select-plugins-dialog.h"
@@ -560,7 +561,8 @@
                                 NULL);
       hildon_home_window_applets_init (HILDON_HOME_WINDOW (container));
     }
-    else if (!g_ascii_strcasecmp (type, HD_CONTAINER_TYPE_PANEL_BOX))
+    else if (!g_ascii_strcasecmp (type, HD_CONTAINER_TYPE_PANEL_BOX) ||
+ 	     !g_ascii_strcasecmp (type, HD_CONTAINER_TYPE_PANEL_EXPANDABLE))
     {
       HildonDesktopPanelWindowOrientation orientation;
       gchar *orientation_str;
@@ -650,15 +652,29 @@
       else if (!g_ascii_strcasecmp (orientation_str, HD_WINDOW_ORIENTATION_RIGHT))
         orientation = HILDON_DESKTOP_PANEL_WINDOW_ORIENTATION_RIGHT; 
       else 
-        orientation = HILDON_DESKTOP_PANEL_WINDOW_ORIENTATION_LEFT; 
+        orientation = HILDON_DESKTOP_PANEL_WINDOW_ORIENTATION_LEFT;
 
-      container = g_object_new (HD_TYPE_PANEL_WINDOW,
-                               "x", x,
-                               "y", y,
-                               "width", width,
-                               "height", height,
-                               "orientation", orientation,
-                                NULL);
+      if (!g_ascii_strcasecmp (type, HD_CONTAINER_TYPE_PANEL_BOX))
+      {
+        container = g_object_new (HD_TYPE_PANEL_WINDOW,
+                                  "x", x,
+                                  "y", y,
+                                  "width", width,
+                                  "height", height,
+                                  "orientation", orientation,
+                                   NULL);
+      }
+      else
+      if (!g_ascii_strcasecmp (type, HD_CONTAINER_TYPE_PANEL_EXPANDABLE))
+      {
+        container = g_object_new (HILDON_DESKTOP_TYPE_PANEL_WINDOW_DIALOG,
+                                 "x", x,
+                                 "y", y,
+                                 "width", width,
+                                 "height", height,
+                                 "orientation", orientation,
+                                  NULL);
+      }
 
       g_free (orientation_str);
     }


More information about the maemo-commits mailing list