From 0230508fb3cc88a8801a35d4b13947bcd10c86ae Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Jun 2010 02:47:50 +0200 Subject: Correctly handle panel orientation --- DClock.vala | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'DClock.vala') diff --git a/DClock.vala b/DClock.vala index 5f85d62..14abcc1 100644 --- a/DClock.vala +++ b/DClock.vala @@ -195,27 +195,21 @@ public class DClock : Panel.Applet { } void update_orient() { - /*string text; - int min_width; double new_angle; - double angle;*/ + double angle; - //text = gtk_label_get_text (GTK_LABEL (cd->clockw)); - //min_width = calculate_minimum_width (cd->panel_button, text); - - /*if(orient == Panel.AppletOrient.LEFT && min_width > button.allocation.width) - new_angle = 270; - else if(orient == Panel.AppletOrient.RIGHT && min_width > button.allocation.width) - new_angle = 90; - else - new_angle = 0;*/ + if(orient == Panel.AppletOrient.LEFT) + new_angle = 270; + else if(orient == Panel.AppletOrient.RIGHT) + new_angle = 90; + else + new_angle = 0; - /*angle = gtk_label_get_angle(GTK_LABEL (cd->clockw)); - if (angle != new_angle) { - unfix_size (cd); - gtk_label_set_angle (GTK_LABEL (cd->clockw), new_angle); - gtk_label_set_angle (GTK_LABEL (cd->panel_temperature_label), new_angle); - }*/ + angle = label.get_angle(); + if (angle != new_angle) { + unfix_size(); + label.set_angle(new_angle); + } } private static void applet_change_orient(Panel.Applet applet, Panel.AppletOrient orient, DClock clock) { -- cgit v1.2.3