~ubuntu-branches/ubuntu/vivid/gnome-panel/vivid

« back to all changes in this revision

Viewing changes to debian/patches/clock-fix-expanding.patch

  • Committer: Package Import Robot
  • Author(s): Alberts Muktupāvels
  • Date: 2014-08-12 11:36:15 UTC
  • Revision ID: package-import@ubuntu.com-20140812113615-3xfcx2a82urwfl4f
Tags: 1:3.8.0-1ubuntu16
* debian/patches/lp-1314706.patch:
  - Fix broken Evolution Data Server integration (LP: #1314706).
* debian/patches/clock-fix-expanding.patch:
  - Fix tasks and appointements list expanding.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
 
 
6
--- a/applets/clock/calendar-window.c
 
7
+++ b/applets/clock/calendar-window.c
 
8
@@ -1271,10 +1271,16 @@
 
9
         handle_tasks_changed (calwin);
 
10
 }
 
11
 
 
12
+typedef struct
 
13
+{
 
14
+        GtkWidget *calendar;
 
15
+        GtkWidget *tree;
 
16
+} ConstraintData;
 
17
+
 
18
 static void
 
19
-setup_list_size_constraint (GtkWidget *widget,
 
20
-                            GtkWidget *calendar,
 
21
-                            GtkWidget *tree)
 
22
+constrain_list_size (GtkWidget      *widget,
 
23
+                     GtkAllocation  *allocation,
 
24
+                     ConstraintData *constraint)
 
25
 {
 
26
        GtkRequisition   req;
 
27
        GtkStyleContext *context;
 
28
@@ -1282,23 +1288,44 @@
 
29
        GtkBorder        padding;
 
30
        int              screen_h;
 
31
        int              max_height;
 
32
-       int              req_height;
 
33
+       int              width;
 
34
+       int              height;
 
35
 
 
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);
 
40
 
 
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);
 
47
 
 
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);
 
51
 
 
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 */
 
58
+       height += 2;
 
59
+
 
60
+       gtk_widget_set_size_request (widget, width, height);
 
61
+}
 
62
+
 
63
+static void
 
64
+setup_list_size_constraint (GtkWidget *widget,
 
65
+                            GtkWidget *calendar,
 
66
+                            GtkWidget *tree)
 
67
+{
 
68
+        ConstraintData *constraint;
 
69
+
 
70
+        constraint           = g_new0 (ConstraintData, 1);
 
71
+        constraint->calendar = calendar;
 
72
+        constraint->tree     = tree;
 
73
+
 
74
+        g_signal_connect_data (widget, "size-allocate",
 
75
+                               G_CALLBACK (constrain_list_size), constraint,
 
76
+                               (GClosureNotify) g_free, 0);
 
77
 }
 
78
 
 
79
 #endif /* HAVE_EDS */