[Xfce4-commits] <xfce4-panel:andrzejr/deskbar-github> action buttons: added nrows and deskbar-mode notifications and changed label orientation (in menu mode)

Andrzej noreply at xfce.org
Mon Dec 12 11:40:21 CET 2011


Updating branch refs/heads/andrzejr/deskbar-github
         to 15c8029c835781d5ec7e592c283226b1e6057a67 (commit)
       from 656b62ae709ad16083b0e8865d6955c2d2c6738b (commit)

commit 15c8029c835781d5ec7e592c283226b1e6057a67
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sat Nov 19 22:48:45 2011 +0900

    action buttons: added nrows and deskbar-mode notifications and changed label orientation (in menu mode)

 plugins/actions/actions.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/plugins/actions/actions.c b/plugins/actions/actions.c
index 6b50486..7bac67b 100644
--- a/plugins/actions/actions.c
+++ b/plugins/actions/actions.c
@@ -57,6 +57,10 @@ static gboolean   actions_plugin_size_changed        (XfcePanelPlugin       *pan
 static void       actions_plugin_configure_plugin    (XfcePanelPlugin       *panel_plugin);
 static void       actions_plugin_orientation_changed (XfcePanelPlugin       *panel_plugin,
                                                       GtkOrientation         orientation);
+static void       actions_plugin_deskbar_mode_changed(XfcePanelPlugin       *panel_plugin,
+                                                      gboolean               deskbar_mode);
+static void       actions_plugin_nrows_changed       (XfcePanelPlugin       *panel_plugin,
+                                                      guint                  nrows);
 static void       actions_plugin_pack                (ActionsPlugin         *plugin);
 static GPtrArray *actions_plugin_default_array       (void);
 static void       actions_plugin_menu                (GtkWidget             *button,
@@ -236,6 +240,8 @@ actions_plugin_class_init (ActionsPluginClass *klass)
   plugin_class->construct = actions_plugin_construct;
   plugin_class->free_data = actions_plugin_free_data;
   plugin_class->size_changed = actions_plugin_size_changed;
+  plugin_class->deskbar_mode_changed = actions_plugin_deskbar_mode_changed;
+  plugin_class->nrows_changed = actions_plugin_nrows_changed;
   plugin_class->configure_plugin = actions_plugin_configure_plugin;
   plugin_class->orientation_changed = actions_plugin_orientation_changed;
 
@@ -689,6 +695,23 @@ actions_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
 
 
 
+static void
+actions_plugin_deskbar_mode_changed (XfcePanelPlugin        *panel_plugin,
+                                     gboolean                deskbar_mode)
+{
+  actions_plugin_pack (XFCE_ACTIONS_PLUGIN (panel_plugin));
+}
+
+
+static void
+actions_plugin_nrows_changed (XfcePanelPlugin        *panel_plugin,
+                              guint                   nrows)
+{
+  actions_plugin_pack (XFCE_ACTIONS_PLUGIN (panel_plugin));
+}
+
+
+
 static gboolean
 actions_plugin_action_confirmation_time (gpointer data)
 {
@@ -969,6 +992,7 @@ actions_plugin_pack_idle (gpointer data)
   const GValue   *val;
   gint            type;
   GtkOrientation  orientation;
+  gboolean        deskbar_mode;
 
   child = gtk_bin_get_child (GTK_BIN (plugin));
   if (child != NULL)
@@ -1038,8 +1062,9 @@ actions_plugin_pack_idle (gpointer data)
 
       label = gtk_label_new (username);
       gtk_container_add (GTK_CONTAINER (button), label);
+      deskbar_mode = xfce_panel_plugin_get_deskbar_mode (XFCE_PANEL_PLUGIN (plugin));
       gtk_label_set_angle (GTK_LABEL (label),
-          orientation == GTK_ORIENTATION_HORIZONTAL ? 0 : 270);
+          (orientation == GTK_ORIENTATION_HORIZONTAL || deskbar_mode) ? 0 : 270);
       gtk_widget_show (label);
     }
 


More information about the Xfce4-commits mailing list