[Xfce4-commits] <xfce4-diskperf-plugin:master> as its done in launcher plugin, set small to FALSE if we want the title displayed and are in deskbar mode

Landry Breuil noreply at xfce.org
Tue May 8 12:38:01 CEST 2012


Updating branch refs/heads/master
         to 1bbd0ee93d90f6b7dda5de5006ccdebe4c01fde5 (commit)
       from fa51ed4379ac812733ce85992c66653cf8ef5627 (commit)

commit 1bbd0ee93d90f6b7dda5de5006ccdebe4c01fde5
Author: Landry Breuil <landry at xfce.org>
Date:   Tue May 8 12:37:54 2012 +0200

    as its done in launcher plugin, set small to FALSE if we want the title displayed and are in deskbar mode

 panel-plugin/main.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index 3f6ee12..3672f03 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -538,6 +538,14 @@ static void diskperf_read_config (XfcePanelPlugin *plugin,
     else
         gtk_widget_hide (GTK_WIDGET (poMonitor->wTitle));
 
+#ifdef HAS_PANEL_49
+    /* unset small if we are in deskbar mode and we want the title */
+    if (poConf->fTitleDisplayed && xfce_panel_plugin_get_mode(poPlugin->plugin) == XFCE_PANEL_PLUGIN_MODE_DESKBAR)
+      xfce_panel_plugin_set_small (XFCE_PANEL_PLUGIN (poPlugin->plugin), FALSE);
+    else
+      xfce_panel_plugin_set_small (XFCE_PANEL_PLUGIN (poPlugin->plugin), TRUE);
+#endif
+
     if ((value = xfce_rc_read_entry (rc, (CONF_LABEL_TEXT), NULL))) {
         memset (poConf->acTitle, 0, sizeof (poConf->acTitle));
         strncpy (poConf->acTitle, value, sizeof (poConf->acTitle) - 1);
@@ -672,8 +680,17 @@ static void ToggleTitle (Widget_t p_w, void *p_pvPlugin)
 	gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (p_w));
     if (poConf->fTitleDisplayed)
 	gtk_widget_show (GTK_WIDGET (poMonitor->wTitle));
+
     else
 	gtk_widget_hide (GTK_WIDGET (poMonitor->wTitle));
+
+#ifdef HAS_PANEL_49
+    /* unset small if we are in deskbar mode and we want the title */
+    if (poConf->fTitleDisplayed && xfce_panel_plugin_get_mode(poPlugin->plugin) == XFCE_PANEL_PLUGIN_MODE_DESKBAR)
+      xfce_panel_plugin_set_small (XFCE_PANEL_PLUGIN (poPlugin->plugin), FALSE);
+    else
+      xfce_panel_plugin_set_small (XFCE_PANEL_PLUGIN (poPlugin->plugin), TRUE);
+#endif
 }				/* ToggleTitle() */
 
 	/**************************************************************/
@@ -1114,6 +1131,12 @@ static void diskperf_set_mode (XfcePanelPlugin *plugin,
     gtk_label_set_angle (GTK_LABEL (poMonitor->wTitle),
                          (p_iMode != XFCE_PANEL_PLUGIN_MODE_VERTICAL) ?
                          0 : 270);
+    /* unset small if we are in deskbar mode and we want the title */
+    if (poPlugin->oConf.oParam.fTitleDisplayed && p_iMode == XFCE_PANEL_PLUGIN_MODE_DESKBAR)
+      xfce_panel_plugin_set_small (XFCE_PANEL_PLUGIN (plugin), FALSE);
+    else
+      xfce_panel_plugin_set_small (XFCE_PANEL_PLUGIN (plugin), TRUE);
+
     diskperf_set_size (plugin, xfce_panel_plugin_get_size (plugin), poPlugin);
 }				/* diskperf_set_orientation() */
 #else


More information about the Xfce4-commits mailing list