[Xfce4-commits] <xfce4-panel:andrzejr/deskbar-launcher> launcher: syncing with nick/desktop-mode branch.

Andrzej noreply at xfce.org
Tue Dec 13 07:20:03 CET 2011


Updating branch refs/heads/andrzejr/deskbar-launcher
         to 2903e27d918360221bc1dc0d955b5e6c21dbc4f9 (commit)
       from e8bc0a9a0453aa7501c73aa3151565cb023e8ab9 (commit)

commit 2903e27d918360221bc1dc0d955b5e6c21dbc4f9
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Tue Dec 13 13:57:39 2011 +0900

    launcher: syncing with nick/desktop-mode branch.

 plugins/launcher/launcher.c |   37 ++++++++-----------------------------
 1 files changed, 8 insertions(+), 29 deletions(-)

diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index cc90685..82d1daa 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -70,8 +70,6 @@ static void               launcher_plugin_orientation_changed           (XfcePan
                                                                          GtkOrientation        orientation);
 static gboolean           launcher_plugin_size_changed                  (XfcePanelPlugin      *panel_plugin,
                                                                          gint                  size);
-static void               launcher_plugin_nrows_changed                 (XfcePanelPlugin      *panel_plugin,
-                                                                         guint                 nrows);
 static void               launcher_plugin_configure_plugin              (XfcePanelPlugin      *panel_plugin);
 static void               launcher_plugin_screen_position_changed       (XfcePanelPlugin      *panel_plugin,
                                                                          XfceScreenPosition    position);
@@ -272,7 +270,6 @@ launcher_plugin_class_init (LauncherPluginClass *klass)
   plugin_class->free_data = launcher_plugin_free_data;
   plugin_class->orientation_changed = launcher_plugin_orientation_changed;
   plugin_class->size_changed = launcher_plugin_size_changed;
-  plugin_class->nrows_changed = launcher_plugin_nrows_changed;
   plugin_class->configure_plugin = launcher_plugin_configure_plugin;
   plugin_class->screen_position_changed = launcher_plugin_screen_position_changed;
   plugin_class->removed = launcher_plugin_removed;
@@ -855,13 +852,10 @@ launcher_plugin_set_property (GObject      *object,
         gtk_widget_destroy (plugin->child);
 
       /* create child */
-      if (G_UNLIKELY (plugin->show_label)) {
+      if (G_UNLIKELY (plugin->show_label))
         plugin->child = gtk_label_new (NULL);
-        xfce_panel_plugin_set_small (XFCE_PANEL_PLUGIN (plugin), FALSE);
-      } else {
+      else
         plugin->child = xfce_panel_image_new ();
-        xfce_panel_plugin_set_small (XFCE_PANEL_PLUGIN (plugin), TRUE);
-      }
       gtk_container_add (GTK_CONTAINER (plugin->button), plugin->child);
       gtk_widget_show (plugin->child);
 
@@ -1008,7 +1002,7 @@ launcher_plugin_construct (XfcePanelPlugin *panel_plugin)
   };
 
   /* show the configure menu item */
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+  xfce_panel_plugin_menu_show_configure (panel_plugin);
 
   xfce_panel_plugin_set_small (panel_plugin, TRUE);
 
@@ -1243,9 +1237,9 @@ launcher_plugin_size_changed (XfcePanelPlugin *panel_plugin,
   gint               a_width, a_height;
   gboolean           horizontal;
   LauncherArrowType  arrow_position;
-  guint              nrows;
 
   /* initialize the plugin size */
+  size /= xfce_panel_plugin_get_nrows (panel_plugin);
   p_width = p_height = size;
   a_width = a_height = -1;
 
@@ -1290,30 +1284,15 @@ launcher_plugin_size_changed (XfcePanelPlugin *panel_plugin,
     }
 
   /* set the panel plugin size */
-  nrows = xfce_panel_plugin_get_nrows (XFCE_PANEL_PLUGIN (plugin));
-  if (plugin->show_label) {
-    horizontal = !!(xfce_panel_plugin_get_orientation (panel_plugin) ==
-                    GTK_ORIENTATION_HORIZONTAL);
-    if (horizontal)
-      gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, -1);
-    else
-      gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, p_height / nrows);
-  } else
-    gtk_widget_set_size_request (GTK_WIDGET (plugin), p_width / nrows, p_height / nrows);
+  if (plugin->show_label)
+    gtk_widget_set_size_request (GTK_WIDGET (panel_plugin), -1, -1);
+  else
+    gtk_widget_set_size_request (GTK_WIDGET (panel_plugin), p_width, p_height);
 
   return TRUE;
 }
 
 
-static void
-launcher_plugin_nrows_changed (XfcePanelPlugin *panel_plugin,
-                               guint            nrows)
-{
-  launcher_plugin_size_changed (XFCE_PANEL_PLUGIN (panel_plugin),
-                                xfce_panel_plugin_get_size (XFCE_PANEL_PLUGIN (panel_plugin)));
-}
-
-
 
 static void
 launcher_plugin_configure_plugin (XfcePanelPlugin *panel_plugin)


More information about the Xfce4-commits mailing list