[Xfce4-commits] [xfce/xfce4-power-manager] 03/03: brightness-button: do not invert hscale direction in vertical panel

noreply at xfce.org noreply at xfce.org
Mon Jun 2 08:33:02 CEST 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfce4-power-manager.

commit 07fd60cd9f5088f5653a7f3a579e6ef4fdbea832
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sun Jun 1 23:27:20 2014 +0100

    brightness-button: do not invert hscale direction in vertical panel
---
 panel-plugins/brightness/brightness-button.c |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/panel-plugins/brightness/brightness-button.c b/panel-plugins/brightness/brightness-button.c
index c6c95d9..750fca4 100644
--- a/panel-plugins/brightness/brightness-button.c
+++ b/panel-plugins/brightness/brightness-button.c
@@ -396,13 +396,14 @@ brightness_button_create_popup (BrightnessButton *button)
     {
 	button->priv->range = gtk_hscale_new_with_range (0, max_level, 1);
 	gtk_widget_set_size_request (button->priv->range, 100, -1);
+        gtk_range_set_inverted (GTK_RANGE(button->priv->range), FALSE);
     }
     else
     {
 	button->priv->range = gtk_vscale_new_with_range (0, max_level, 1);
 	gtk_widget_set_size_request (button->priv->range, -1, 100);
+        gtk_range_set_inverted (GTK_RANGE(button->priv->range), TRUE);
     }
-    gtk_range_set_inverted (GTK_RANGE(button->priv->range), TRUE);
     gtk_scale_set_draw_value (GTK_SCALE(button->priv->range), FALSE);
     
     g_signal_connect (button->priv->range, "grab-notify",
@@ -415,10 +416,19 @@ brightness_button_create_popup (BrightnessButton *button)
     g_signal_connect (button->priv->plus, "clicked",
 		      G_CALLBACK (plus_clicked), button);
 
-    gtk_box_pack_start (GTK_BOX(box), button->priv->plus, FALSE, FALSE, 0);
-    gtk_box_pack_start (GTK_BOX(box), button->priv->range, TRUE, TRUE, 0);
-    gtk_box_pack_start (GTK_BOX(box), button->priv->minus, FALSE, FALSE, 0);
-    
+    if ( orientation == GTK_ORIENTATION_VERTICAL )
+    {
+        gtk_box_pack_start (GTK_BOX(box), button->priv->minus, FALSE, FALSE, 0);
+        gtk_box_pack_start (GTK_BOX(box), button->priv->range, TRUE, TRUE, 0);
+        gtk_box_pack_start (GTK_BOX(box), button->priv->plus, FALSE, FALSE, 0);
+    }
+    else
+    {
+        gtk_box_pack_start (GTK_BOX(box), button->priv->plus, FALSE, FALSE, 0);
+        gtk_box_pack_start (GTK_BOX(box), button->priv->range, TRUE, TRUE, 0);
+        gtk_box_pack_start (GTK_BOX(box), button->priv->minus, FALSE, FALSE, 0);
+    }
+
     gtk_window_set_type_hint (GTK_WINDOW(button->priv->popup), GDK_WINDOW_TYPE_HINT_UTILITY );
     
     gtk_container_add (GTK_CONTAINER(button->priv->popup), box);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list