1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
diff -up gnome-panel-2.21.91/applets/clock/clock.c.less-resizing gnome-panel-2.21.91/applets/clock/clock.c
--- gnome-panel-2.21.91/applets/clock/clock.c.less-resizing 2008-02-20 11:46:30.000000000 -0500
+++ gnome-panel-2.21.91/applets/clock/clock.c 2008-02-20 11:46:30.000000000 -0500
@@ -1074,6 +1074,7 @@ location_tile_timezone_set_cb (ClockLoca
ClockData *cd = data;
clock_map_refresh (CLOCK_MAP (cd->map_widget));
+ update_location_tiles (cd);
}
static void
diff -up gnome-panel-2.21.91/applets/clock/clock-location-tile.c.less-resizing gnome-panel-2.21.91/applets/clock/clock-location-tile.c
--- gnome-panel-2.21.91/applets/clock/clock-location-tile.c.less-resizing 2008-02-20 11:46:30.000000000 -0500
+++ gnome-panel-2.21.91/applets/clock/clock-location-tile.c 2008-02-20 12:03:00.000000000 -0500
@@ -42,6 +42,8 @@ typedef struct {
GtkWidget *current_button;
GtkWidget *current_label;
GtkWidget *current_marker;
+ GtkWidget *current_spacer;
+ GtkSizeGroup *current_group;
GtkSizeGroup *button_group;
GtkWidget *weather_icon;
@@ -157,6 +159,11 @@ clock_location_tile_finalize (GObject *g
priv->button_group = NULL;
}
+ if (priv->current_group) {
+ g_object_unref (priv->current_group);
+ priv->current_group = NULL;
+ }
+
G_OBJECT_CLASS (clock_location_tile_parent_class)->finalize (g_obj);
}
@@ -213,25 +220,43 @@ enter_or_leave_tile (GtkWidget
if (event->mode != GDK_CROSSING_NORMAL) {
return TRUE;
}
+
+ if (clock_location_is_current (priv->location)) {
+ gtk_widget_hide (priv->current_button);
+ gtk_widget_hide (priv->current_spacer);
+ gtk_widget_show (priv->current_marker);
+
+ return TRUE;
+ }
+
if (event->type == GDK_ENTER_NOTIFY) {
- gint can_set;
+ gint can_set;
can_set = can_set_system_timezone ();
- if (!clock_location_is_current (priv->location) &&
- can_set != 0) {
+ if (can_set != 0) {
gtk_label_set_markup (GTK_LABEL (priv->current_label),
can_set == 1 ?
_("<small>Set...</small>") :
- _("<small>Set</small>"));
+ _("<small>Set</small>"));
+ gtk_widget_hide (priv->current_spacer);
+ gtk_widget_hide (priv->current_marker);
gtk_widget_show (priv->current_button);
}
- }
- else {
- if (event->detail != GDK_NOTIFY_INFERIOR)
- gtk_widget_hide (priv->current_button);
- }
+ else {
+ gtk_widget_hide (priv->current_marker);
+ gtk_widget_hide (priv->current_button);
+ gtk_widget_show (priv->current_spacer);
+ }
+ }
+ else {
+ if (event->detail != GDK_NOTIFY_INFERIOR) {
+ gtk_widget_hide (priv->current_button);
+ gtk_widget_hide (priv->current_marker);
+ gtk_widget_show (priv->current_spacer);
+ }
+ }
- return TRUE;
+ return TRUE;
}
static void
@@ -241,6 +266,7 @@ clock_location_tile_fill (ClockLocationT
GtkWidget *align;
GtkWidget *strut;
GtkWidget *box;
+ gint can_set;
priv->box = gtk_event_box_new ();
@@ -278,8 +304,16 @@ clock_location_tile_fill (ClockLocationT
gtk_box_pack_start (GTK_BOX (box), align, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), priv->time_label, FALSE, FALSE, 0);
+ can_set = can_set_system_timezone ();
+
priv->current_button = gtk_button_new ();
priv->current_label = gtk_label_new ("");
+ if (can_set != 0) {
+ gtk_label_set_markup (GTK_LABEL (priv->current_label),
+ can_set == 1 ?
+ _("<small>Set...</small>") :
+ _("<small>Set</small>"));
+ }
gtk_widget_show (priv->current_label);
gtk_widget_set_no_show_all (priv->current_button, TRUE);
gtk_container_add (GTK_CONTAINER (priv->current_button), priv->current_label);
@@ -289,15 +323,29 @@ clock_location_tile_fill (ClockLocationT
gtk_misc_set_alignment (GTK_MISC (priv->current_marker), 1.0, 0.5);
gtk_widget_set_no_show_all (priv->current_marker, TRUE);
+ priv->current_spacer = gtk_event_box_new ();
+ gtk_widget_set_no_show_all (priv->current_spacer, TRUE);
+
strut = gtk_event_box_new ();
gtk_box_pack_start (GTK_BOX (box), strut, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), priv->current_button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), priv->current_marker, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (box), priv->current_spacer, FALSE, FALSE, 0);
priv->button_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
gtk_size_group_set_ignore_hidden (priv->button_group, FALSE);
gtk_size_group_add_widget (priv->button_group, strut);
gtk_size_group_add_widget (priv->button_group, priv->current_button);
+ priv->current_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
+ gtk_size_group_set_ignore_hidden (priv->current_group, FALSE);
+ gtk_size_group_add_widget (priv->current_group, priv->current_button);
+ gtk_size_group_add_widget (priv->current_group, priv->current_marker);
+ gtk_size_group_add_widget (priv->current_group, priv->current_spacer);
+
+ gtk_widget_show (priv->current_button);
+ gtk_widget_show (priv->current_marker);
+ gtk_widget_show (priv->current_spacer);
+
g_signal_connect (priv->current_button, "clicked",
G_CALLBACK (make_current), this);
@@ -443,11 +491,16 @@ clock_location_tile_refresh (ClockLocati
g_return_if_fail (IS_CLOCK_LOCATION_TILE (this));
if (clock_location_is_current (priv->location)) {
- gtk_widget_hide (priv->current_button);
- gtk_widget_show (priv->current_marker);
- }
- else {
- gtk_widget_hide (priv->current_marker);
+ gtk_widget_hide (priv->current_spacer);
+ gtk_widget_hide (priv->current_button);
+ gtk_widget_show (priv->current_marker);
+ }
+ else {
+ if (GTK_WIDGET_VISIBLE (priv->current_marker)) {
+ gtk_widget_hide (priv->current_marker);
+ gtk_widget_hide (priv->current_button);
+ gtk_widget_show (priv->current_spacer);
+ }
}
if (clock_needs_face_refresh (this)) {
|