-=| Damyan Ivanov, Fri, Jul 17, 2009 at 08:50:22PM +0300 |=-
> I am attaching a quilt patch, ready to be put in debian/patches.

This time for real :)

-- 
dam
# Description: change applet orientation to match panel orientation
#      taken from the launchpad bug report
# Author: Luca Invernizzi <[email protected]>
# Debian-Bug: 536868
# Launchpad-Bug: 264974
--- a/src/applet.c
+++ b/src/applet.c
@@ -52,6 +52,10 @@ static void cw_panel_background_changed 
 				         GdkColor                  *colour,
 				         GdkPixmap                 *pixmap,
                                          gpointer                   user_data);
+static void
+cw_panel_orientation_changed (PanelApplet               *applet,
+                             guint                      orient,
+                             gpointer                   user_data);
 static void display_about_dialog (BonoboUIComponent *component, 
                                   gpointer           user_data, 
                                   const gchar       *verb);
@@ -162,6 +166,9 @@ cw_applet_fill (PanelApplet *applet, 
   /* Signals */
 	g_signal_connect (applet, "change-background",
 			             G_CALLBACK (cw_panel_background_changed), NULL);
+
+	g_signal_connect (applet, "change-orient",
+			             G_CALLBACK (cw_panel_orientation_changed), NULL);
 	
   panel_applet_setup_menu (PANEL_APPLET (applet),
                          	Context_menu_xml,
@@ -232,6 +239,36 @@ cw_panel_background_changed (PanelApplet
   }
 }
 
+static void
+cw_panel_orientation_changed (PanelApplet               *applet,
+                             guint                      orient,
+                             gpointer                   user_data)
+{
+    if (orient == PANEL_APPLET_ORIENT_LEFT || orient == PANEL_APPLET_ORIENT_RIGHT)
+    {
+        /*TODO*/
+
+    }
+    else
+    {
+        /*TODO*/
+    }
+}
+
+gboolean
+applet_orientation_get_bool (void )
+{
+    guint orient = panel_applet_get_orient (PANEL_APPLET(mainapp->applet));
+    if (orient == PANEL_APPLET_ORIENT_LEFT || orient == PANEL_APPLET_ORIENT_RIGHT) {
+        return TRUE;
+    }
+    else
+    {
+        return FALSE;
+    }
+
+}
+
 static void
 display_about_dialog (BonoboUIComponent *component, 
                       gpointer           user_data, 
--- /dev/null
+++ b/src/applet.h
@@ -0,0 +1,6 @@
+#ifndef _APPLET_H_
+#define _APPLET_H_
+
+gboolean applet_orientation_get_bool ();
+
+#endif //_APPLET_H_
--- a/src/task-list.c
+++ b/src/task-list.c
@@ -18,10 +18,12 @@
  */
 
 #include "task-list.h"
+#include "applet.h"
 
 #include <libwnck/libwnck.h>
 
-G_DEFINE_TYPE (TaskList, task_list, GTK_TYPE_HBOX);
+G_DEFINE_TYPE (TaskList, task_list, \
+        applet_orientation_get_bool()? GTK_TYPE_VBOX:GTK_TYPE_HBOX);
 
 #define TASK_LIST_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),\
   TASK_TYPE_LIST, \

Attachment: signature.asc
Description: Digital signature

Reply via email to