[Xfce4-commits] <xfce4-panel:andrzejr/deskbar-github> Added support for deskbar mode in the applications menu.
Andrzej
noreply at xfce.org
Mon Dec 12 11:40:11 CET 2011
Updating branch refs/heads/andrzejr/deskbar-github
to 0e6a9ecb92708cef71c569c0a107423086ee17b3 (commit)
from 9ba9df835c8597452db32b9ab8be83d921b6fdd4 (commit)
commit 0e6a9ecb92708cef71c569c0a107423086ee17b3
Author: Andrzej <ndrwrdck at gmail.com>
Date: Fri Nov 11 05:21:08 2011 +0900
Added support for deskbar mode in the applications menu.
Probably we want to scale the icon in this mode.
Currently the button title is not visible due to lack of space.
Also, the button becomes very big when the deskbar is wide.
plugins/applicationsmenu/applicationsmenu.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/plugins/applicationsmenu/applicationsmenu.c b/plugins/applicationsmenu/applicationsmenu.c
index 5b2045d..ebd328f 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -103,6 +103,8 @@ static gboolean applications_menu_plugin_size_changed (XfcePanelPlugin
gint size);
static void applications_menu_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
GtkOrientation orientation);
+static void applications_menu_plugin_deskbar_mode_changed (XfcePanelPlugin *panel_plugin,
+ gboolean deskbar_mode);
static void applications_menu_plugin_configure_plugin (XfcePanelPlugin *panel_plugin);
static gboolean applications_menu_plugin_remote_event (XfcePanelPlugin *panel_plugin,
const gchar *name,
@@ -138,6 +140,7 @@ applications_menu_plugin_class_init (ApplicationsMenuPluginClass *klass)
plugin_class->free_data = applications_menu_plugin_free_data;
plugin_class->size_changed = applications_menu_plugin_size_changed;
plugin_class->orientation_changed = applications_menu_plugin_orientation_changed;
+ plugin_class->deskbar_mode_changed = applications_menu_plugin_deskbar_mode_changed;
plugin_class->configure_plugin = applications_menu_plugin_configure_plugin;
plugin_class->remote_event = applications_menu_plugin_remote_event;
@@ -451,11 +454,23 @@ applications_menu_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
{
ApplicationsMenuPlugin *plugin = XFCE_APPLICATIONS_MENU_PLUGIN (panel_plugin);
+ if (xfce_panel_plugin_get_deskbar_mode (panel_plugin))
+ orientation = GTK_ORIENTATION_HORIZONTAL;
+
xfce_hvbox_set_orientation (XFCE_HVBOX (plugin->box), orientation);
gtk_label_set_angle (GTK_LABEL (plugin->label), orientation == GTK_ORIENTATION_HORIZONTAL ? 0 : 270);
}
+static void
+applications_menu_plugin_deskbar_mode_changed (XfcePanelPlugin *panel_plugin,
+ gboolean deskbar_mode)
+{
+ applications_menu_plugin_orientation_changed (
+ panel_plugin,
+ xfce_panel_plugin_get_orientation (panel_plugin));
+}
+
static void
applications_menu_plugin_configure_plugin_file_set (GtkFileChooserButton *button,
More information about the Xfce4-commits
mailing list