[gnome-applets/wip/segeiger/window-picker-in-process: 8/9] windowpicker/applet.c: Replace grid with box



commit 110b68d28c703c0296eba12eb11fea600da8db56
Author: Sebastian Geiger <sbastig gmx net>
Date:   Mon Jun 8 21:10:27 2015 +0200

    windowpicker/applet.c: Replace grid with box
    
    This fixes a problem on vertically aligned panels, that
    caused the task list to remain horizontal.

 windowpicker/src/applet.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/windowpicker/src/applet.c b/windowpicker/src/applet.c
index 71fbf8c..026fb55 100644
--- a/windowpicker/src/applet.c
+++ b/windowpicker/src/applet.c
@@ -139,19 +139,23 @@ load_window_picker (PanelApplet *applet) {
     GSettings *settings = windowPickerApplet->priv->settings
                         = panel_applet_settings_new(applet, SETTINGS_SCHEMA);
 
-    GtkWidget *grid = gtk_grid_new ();
-    gtk_grid_set_row_spacing (GTK_GRID(grid), 10);
-    gtk_container_add (GTK_CONTAINER (applet), grid);
+    GtkWidget *outer_box;
+    if(panel_applet_get_orient(applet) == (PANEL_APPLET_ORIENT_UP | PANEL_APPLET_ORIENT_UP)) {
+        outer_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+    } else {
+        outer_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+    }
+    gtk_container_add (GTK_CONTAINER (applet), outer_box);
     gtk_container_set_border_width (GTK_CONTAINER (applet), 0);
-    gtk_container_set_border_width (GTK_CONTAINER (grid), 0);
+    gtk_container_set_border_width (GTK_CONTAINER (outer_box), 0);
 
     priv->tasks = task_list_new (windowPickerApplet);
     gtk_widget_set_vexpand (priv->tasks, TRUE);
-    gtk_grid_attach (GTK_GRID(grid), priv->tasks, 0, 0, 1, 1);
+    gtk_box_pack_start (GTK_BOX(outer_box), priv->tasks, TRUE, TRUE, 0);
 
     priv->title = task_title_new (windowPickerApplet);
     gtk_widget_set_hexpand (priv->title, TRUE);
-    gtk_grid_attach (GTK_GRID(grid), priv->title, 1, 0, 1, 1);
+    gtk_box_pack_start (GTK_BOX(outer_box), priv->title, TRUE, TRUE, 0);
 
     priv->show_all_windows = g_settings_get_boolean (settings, KEY_SHOW_ALL_WINDOWS);
     g_settings_bind (settings, KEY_SHOW_ALL_WINDOWS,


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