[Pkg-maemo-commits] r314 ./hildon-desktop/ubuntu: * Merge patch by Horace Li to call a new function

Loïc Minier lool at dooz.org
Wed Dec 19 11:24:55 UTC 2007


------------------------------------------------------------
revno: 314
committer: Loïc Minier <lool at dooz.org>
branch nick: ubuntu
timestamp: Wed 2007-12-19 12:24:55 +0100
message:
  * Merge patch by Horace Li to call a new function
    hildon_home_area_calculate_real_size() in
    libhildondesktop/hildon-home-area.c to substract the Marquee's
    X-Size-Height read in /etc/hildon-desktop/desktop.conf from the Gdk screen
    size; LP: #172426.
modified:
  debian/changelog
  libhildondesktop/hildon-home-area.c
-------------- next part --------------
=== modified file 'debian/changelog'
--- a/debian/changelog	2007-11-08 17:39:45 +0000
+++ b/debian/changelog	2007-12-19 11:24:55 +0000
@@ -1,3 +1,13 @@
+hildon-desktop (1:0.0.43-1ubuntu2) hardy; urgency=low
+
+  * Merge patch by Horace Li to call a new function
+    hildon_home_area_calculate_real_size() in
+    libhildondesktop/hildon-home-area.c to substract the Marquee's
+    X-Size-Height read in /etc/hildon-desktop/desktop.conf from the Gdk screen
+    size; LP: #172426.
+
+ -- Loic Minier <lool at dooz.org>  Wed, 19 Dec 2007 12:08:56 +0100
+
 hildon-desktop (1:0.0.43-1ubuntu1) hardy; urgency=low
 
   [ Rusty Lynch ]

=== modified file 'libhildondesktop/hildon-home-area.c'
--- a/libhildondesktop/hildon-home-area.c	2007-10-12 17:05:47 +0000
+++ b/libhildondesktop/hildon-home-area.c	2007-12-19 11:24:55 +0000
@@ -141,6 +141,9 @@
 hildon_home_area_remove (GtkContainer *area, GtkWidget *applet);
 
 static void
+hildon_home_area_calculate_real_size (gint *width, gint *height);
+
+static void
 hildon_home_area_forall (GtkContainer  *container,
                          gboolean       include_internals,
                          GtkCallback    callback,
@@ -1847,6 +1850,50 @@
 
 }
 
+static void
+hildon_home_area_calculate_real_size (gint *width, gint *height)
+{
+  GdkScreen *screen;
+  GKeyFile *key_file;
+  GError *error = NULL;
+  gint panel_height = 52; //default marquee panel height
+
+  key_file = g_key_file_new();
+
+  g_key_file_load_from_file (key_file,
+                             "/etc/hildon-desktop/desktop.conf",
+                             G_KEY_FILE_NONE,
+                             &error);
+
+  if (error)
+  {
+    g_warning ("Error loading desktop configuration file: %s",
+               error->message);
+    g_error_free (error);
+  }
+  else
+  {
+    panel_height = g_key_file_get_integer (key_file,
+                                           "Marquee",
+                                           "X-Size-Height",
+                                           &error);
+
+    if (error)
+    {
+      g_warning ("Error loading marquee panel height: %s",
+                 error->message);
+      g_error_free (error);
+    }
+  }
+
+  screen = gdk_screen_get_default ();
+  if (screen)
+  {
+    *width = gdk_screen_get_width (screen);
+    *height = gdk_screen_get_height (screen) - panel_height;
+  }
+}
+
 gint
 hildon_home_area_save_configuration (HildonHomeArea *area,
                                      const gchar *path,
@@ -2007,6 +2054,8 @@
                                        HH_APPLET_KEY_HEIGHT,
                                        NULL);
 
+      hildon_home_area_calculate_real_size (&width, &height);
+
       stack_index = g_key_file_get_integer (keyfile,
                                             groups[n_groups-1],
                                             HH_APPLET_KEY_STACK_INDEX,



More information about the Pkg-maemo-commits mailing list