1
Description: fix tasks and appointements list expanding
2
Author: Alberts Muktupāvels <alberts.muktupavels@gmail.com>
3
Forwarded: yes, https://mail.gnome.org/archives/gnome-flashback-list/2014-August/msg00001.html
4
Last-Update: 2014-08-12
6
--- a/applets/clock/calendar-window.c
7
+++ b/applets/clock/calendar-window.c
8
@@ -1271,10 +1271,16 @@
9
handle_tasks_changed (calwin);
14
+ GtkWidget *calendar;
19
-setup_list_size_constraint (GtkWidget *widget,
20
- GtkWidget *calendar,
22
+constrain_list_size (GtkWidget *widget,
23
+ GtkAllocation *allocation,
24
+ ConstraintData *constraint)
27
GtkStyleContext *context;
28
@@ -1282,23 +1288,44 @@
36
/* constrain width to the calendar width */
37
- gtk_widget_get_preferred_size (calendar, &req, NULL);
38
+ gtk_widget_get_preferred_size (constraint->calendar, &req, NULL);
39
+ width = MIN (allocation->width, req.width);
41
screen_h = gdk_screen_get_height (gtk_widget_get_screen (widget));
42
- /* constrain height to be the tree height up to a max */
43
+ /* constrain height to be the tree height up to a max */
44
max_height = (screen_h - req.height) / 3;
45
- gtk_widget_get_preferred_size (tree, &req, NULL);
46
+ gtk_widget_get_preferred_size (constraint->tree, &req, NULL);
48
state = gtk_widget_get_state_flags (widget);
49
context = gtk_widget_get_style_context (widget);
50
gtk_style_context_get_padding (context, state, &padding);
52
- req_height = MIN (req.height, max_height);
53
- req_height += padding.top + padding.bottom;
54
- gtk_widget_set_size_request (widget, req.width, req_height);
55
+ height = MIN (req.height, max_height);
56
+ height += padding.top + padding.bottom;
57
+ /* top & bottom border */
60
+ gtk_widget_set_size_request (widget, width, height);
64
+setup_list_size_constraint (GtkWidget *widget,
65
+ GtkWidget *calendar,
68
+ ConstraintData *constraint;
70
+ constraint = g_new0 (ConstraintData, 1);
71
+ constraint->calendar = calendar;
72
+ constraint->tree = tree;
74
+ g_signal_connect_data (widget, "size-allocate",
75
+ G_CALLBACK (constrain_list_size), constraint,
76
+ (GClosureNotify) g_free, 0);