[Xfce4-commits] <xfce4-mpc-plugin:master> Changes for 4.9+ panel.
Landry Breuil
noreply at xfce.org
Tue Feb 14 11:36:01 CET 2012
Updating branch refs/heads/master
to 8cff2d09308edb3eddef2ecd199b0ec96660c758 (commit)
from 95fcd98b2c076fc9b43816159679f33cd07444e8 (commit)
commit 8cff2d09308edb3eddef2ecd199b0ec96660c758
Author: Andrzej <ndrwrdck at gmail.com>
Date: Mon Feb 13 17:35:29 2012 +0900
Changes for 4.9+ panel.
panel-plugin/xfce4-mpc-plugin.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/panel-plugin/xfce4-mpc-plugin.c b/panel-plugin/xfce4-mpc-plugin.c
index 741cb9e..2febf64 100644
--- a/panel-plugin/xfce4-mpc-plugin.c
+++ b/panel-plugin/xfce4-mpc-plugin.c
@@ -43,6 +43,21 @@ mpc_free (XfcePanelPlugin * plugin, t_mpc * mpc)
g_free (mpc);
}
+#if defined (LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION (4,9,0)
+static void
+mpc_set_mode (XfcePanelPlugin * plugin, XfcePanelPluginMode mode, t_mpc * mpc)
+{
+ GtkOrientation orientation;
+ DBG ("!");
+
+ orientation =
+ (mode != XFCE_PANEL_PLUGIN_MODE_VERTICAL) ?
+ GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
+
+ xfce_hvbox_set_orientation(XFCE_HVBOX(mpc->box), orientation);
+}
+
+#else
static void
mpc_set_orientation (XfcePanelPlugin * plugin, GtkOrientation orientation, t_mpc * mpc)
{
@@ -50,10 +65,15 @@ mpc_set_orientation (XfcePanelPlugin * plugin, GtkOrientation orientation, t_mpc
xfce_hvbox_set_orientation(XFCE_HVBOX(mpc->box), orientation);
}
+#endif
static gboolean
mpc_set_size (XfcePanelPlugin * plugin, int size, t_mpc * mpc)
{
+#if defined (LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION (4,9,0)
+ size /= xfce_panel_plugin_get_nrows (plugin);
+#endif
+
DBG ("size=%d",size);
gtk_container_set_border_width (GTK_CONTAINER (mpc->frame), (size > 26 && mpc->show_frame ? 2 : 0));
@@ -805,7 +825,11 @@ mpc_construct (XfcePanelPlugin * plugin)
g_signal_connect (plugin, "free-data", G_CALLBACK (mpc_free), mpc);
g_signal_connect (plugin, "save", G_CALLBACK (mpc_write_config), mpc);
g_signal_connect (plugin, "size-changed", G_CALLBACK (mpc_set_size), mpc);
+#if defined (LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION (4,9,0)
+ g_signal_connect (plugin, "mode-changed", G_CALLBACK (mpc_set_mode), mpc);
+#else
g_signal_connect (plugin, "orientation-changed", G_CALLBACK (mpc_set_orientation), mpc);
+#endif
/* the configure and about menu items are hidden by default */
xfce_panel_plugin_menu_show_configure (plugin);
More information about the Xfce4-commits
mailing list