[Xfce4-commits] <xfce4-battery-plugin:master> Revert partially to previous layout for deskbar mode

Landry Breuil noreply at xfce.org
Tue May 8 17:46:01 CEST 2012


Updating branch refs/heads/master
         to 71cd9bccc67f5e68ca40fcac2ec0987c05132b87 (commit)
       from 10dd7053297faf08d80148defbd5b7fee685b3f8 (commit)

commit 71cd9bccc67f5e68ca40fcac2ec0987c05132b87
Author: Landry Breuil <landry at xfce.org>
Date:   Tue May 8 17:44:44 2012 +0200

    Revert partially to previous layout for deskbar mode
    
    - set ebox orientation matching panel orientation
    - set horizontal progressbar when the panel is vertical
    
    still being worked on..

 panel-plugin/battery.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/panel-plugin/battery.c b/panel-plugin/battery.c
index 6dc231c..ad81b35 100644
--- a/panel-plugin/battery.c
+++ b/panel-plugin/battery.c
@@ -762,11 +762,11 @@ battmon_set_mode (XfcePanelPlugin *plugin, XfcePanelPluginMode mode,
     orientation =
       (mode != XFCE_PANEL_PLUGIN_MODE_VERTICAL) ?
       GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
-    xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->ebox), orientation);
+    xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->ebox), xfce_panel_plugin_get_orientation(plugin));
     xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->timechargebox), !orientation);
     xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->actempbox), !orientation);
     gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(battmon->battstatus),
-               (orientation == GTK_ORIENTATION_HORIZONTAL ? GTK_PROGRESS_BOTTOM_TO_TOP : GTK_PROGRESS_LEFT_TO_RIGHT));
+               (xfce_panel_plugin_get_orientation(plugin) == GTK_ORIENTATION_HORIZONTAL ? GTK_PROGRESS_BOTTOM_TO_TOP : GTK_PROGRESS_LEFT_TO_RIGHT));
     battmon_set_labels_orientation(battmon, orientation);
     battmon_set_size(plugin, xfce_panel_plugin_get_size (plugin), battmon);
     update_apm_status( battmon );
@@ -981,18 +981,11 @@ battmon_write_config(XfcePanelPlugin *plugin, t_battmon *battmon)
 static gboolean
 battmon_set_size(XfcePanelPlugin *plugin, int size, t_battmon *battmon)
 {
-    GtkOrientation orientation;
 #ifdef HAS_PANEL_49
-    XfcePanelPluginMode mode = xfce_panel_plugin_get_mode(plugin);
-    orientation =
-      (mode != XFCE_PANEL_PLUGIN_MODE_VERTICAL) ?
-      GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
     size /= xfce_panel_plugin_get_nrows (battmon->plugin);
-#else
-    orientation = xfce_panel_plugin_get_orientation(plugin);
 #endif
     DBG("set_size(%d)", size);
-    if (orientation == GTK_ORIENTATION_HORIZONTAL)
+    if (xfce_panel_plugin_get_orientation(plugin) == GTK_ORIENTATION_HORIZONTAL)
     {
         /* force size of the panel plugin */
         gtk_widget_set_size_request(GTK_WIDGET(battmon->plugin),


More information about the Xfce4-commits mailing list