[Xfce4-commits] <xfce4-panel:andrzejr/deskbar-launcher> launcher: changing label orientation in a vertical mode.
Andrzej
noreply at xfce.org
Tue Dec 13 07:20:04 CET 2011
Updating branch refs/heads/andrzejr/deskbar-launcher
to 3fb6dbf32f8b7c708f3515a1ebc968adb70635e1 (commit)
from 2903e27d918360221bc1dc0d955b5e6c21dbc4f9 (commit)
commit 3fb6dbf32f8b7c708f3515a1ebc968adb70635e1
Author: Andrzej <ndrwrdck at gmail.com>
Date: Tue Dec 13 14:34:34 2011 +0900
launcher: changing label orientation in a vertical mode.
plugins/launcher/launcher.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index 82d1daa..d68d21a 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -66,8 +66,8 @@ static gboolean launcher_plugin_remote_event (XfcePan
const GValue *value);
static gboolean launcher_plugin_save_delayed_timeout (gpointer user_data);
static void launcher_plugin_save_delayed (LauncherPlugin *plugin);
-static void launcher_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
- GtkOrientation orientation);
+static void launcher_plugin_mode_changed (XfcePanelPlugin *panel_plugin,
+ XfcePanelPluginMode mode);
static gboolean launcher_plugin_size_changed (XfcePanelPlugin *panel_plugin,
gint size);
static void launcher_plugin_configure_plugin (XfcePanelPlugin *panel_plugin);
@@ -268,7 +268,7 @@ launcher_plugin_class_init (LauncherPluginClass *klass)
plugin_class = XFCE_PANEL_PLUGIN_CLASS (klass);
plugin_class->construct = launcher_plugin_construct;
plugin_class->free_data = launcher_plugin_free_data;
- plugin_class->orientation_changed = launcher_plugin_orientation_changed;
+ plugin_class->mode_changed = launcher_plugin_mode_changed;
plugin_class->size_changed = launcher_plugin_size_changed;
plugin_class->configure_plugin = launcher_plugin_configure_plugin;
plugin_class->screen_position_changed = launcher_plugin_screen_position_changed;
@@ -1211,9 +1211,12 @@ launcher_plugin_save_delayed (LauncherPlugin *plugin)
static void
-launcher_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
- GtkOrientation orientation)
+launcher_plugin_mode_changed (XfcePanelPlugin *panel_plugin,
+ XfcePanelPluginMode mode)
{
+ /* update label orientation */
+ launcher_plugin_button_update (XFCE_LAUNCHER_PLUGIN (panel_plugin));
+
/* update the widget order */
launcher_plugin_pack_widgets (XFCE_LAUNCHER_PLUGIN (panel_plugin));
@@ -1689,8 +1692,9 @@ launcher_plugin_menu_destroy (LauncherPlugin *plugin)
static void
launcher_plugin_button_update (LauncherPlugin *plugin)
{
- GarconMenuItem *item = NULL;
- const gchar *icon_name;
+ GarconMenuItem *item = NULL;
+ const gchar *icon_name;
+ XfcePanelPluginMode mode;
panel_return_if_fail (XFCE_IS_LAUNCHER_PLUGIN (plugin));
@@ -1708,6 +1712,9 @@ launcher_plugin_button_update (LauncherPlugin *plugin)
if (G_UNLIKELY (plugin->show_label))
{
panel_return_if_fail (GTK_IS_LABEL (plugin->child));
+ mode = xfce_panel_plugin_get_mode (XFCE_PANEL_PLUGIN (plugin));
+ gtk_label_set_angle (GTK_LABEL (plugin->child),
+ (mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL) ? 270 : 0);
gtk_label_set_text (GTK_LABEL (plugin->child),
item != NULL ? garcon_menu_item_get_name (item) : _("No items"));
}
More information about the Xfce4-commits
mailing list