From f7df759a6228db1806a1c6c5b417b967020e93c6 Mon Sep 17 00:00:00 2001 From: Harald Judt Date: Sat, 19 May 2012 15:55:00 +0200 Subject: Make panel plugin small and fit on a single row for >=xfce4-panel-4.9. Being only an icon, the plugin wastes much valuable space in vertical and deskbar mode. Set it small and occupy only one row, the space freed can be used by other plugins. --- panel-plugin/xfce-mixer-plugin.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/panel-plugin/xfce-mixer-plugin.c b/panel-plugin/xfce-mixer-plugin.c index f6cf276..96c2467 100644 --- a/panel-plugin/xfce-mixer-plugin.c +++ b/panel-plugin/xfce-mixer-plugin.c @@ -39,7 +39,11 @@ #include "xfce-volume-button.h" #include "xfce-plugin-dialog.h" - +#ifdef LIBXFCE4PANEL_CHECK_VERSION +#if LIBXFCE4PANEL_CHECK_VERSION (4,9,0) +#define HAS_PANEL_49 +#endif +#endif #define DEFAULT_COMMAND "xfce4-mixer" @@ -139,6 +143,11 @@ xfce_mixer_plugin_new (XfcePanelPlugin *plugin) mixer_plugin->message_handler_id = 0; #endif +#ifdef HAS_PANEL_49 + /* Make it a small panel plugin regardless of the mode, as there are no labels. */ + xfce_panel_plugin_set_small(XFCE_PANEL_PLUGIN(plugin), TRUE); +#endif + /* Allocate a tooltips structure */ mixer_plugin->tooltips = gtk_tooltips_new (); gtk_tooltips_set_delay (mixer_plugin->tooltips, 10); @@ -232,6 +241,9 @@ xfce_mixer_plugin_size_changed (XfceMixerPlugin *mixer_plugin, g_return_val_if_fail (mixer_plugin != NULL, FALSE); /* Determine size for the volume button icons */ +#ifdef HAS_PANEL_49 + size /= xfce_panel_plugin_get_nrows (mixer_plugin->plugin); +#endif size -= 2 + 2 * MAX (mixer_plugin->button->style->xthickness, mixer_plugin->button->style->ythickness); /* Set volume button icon size and update the volume button */ -- 1.7.8.6