updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / trayer+dclock / trayer+dclock.combined_GtkTooltip_DClockUpdate.patch
blob6270904937c760f03e6a2584597df8e77b643fe3
1 $Id: trayer+dclock.combined_GtkTooltip_DClockUpdate.patch 1299 2008-03-17 02:12:14Z mehani $
2 Update Trayer's code to the new GtkTooltip feature instead of the GtkTooltips
3 formerly in use and deprecated as of GTK 2.12.
4 Update the clock using the specific functions as soon as the label is created to
5 avoid style inconsistencies.
7 Olivier Mehani <shtrom@ssji.net>
8 ===
9 diff -urN trayer-1.0/dclock.c trayer-1.0-GtkTooltip/dclock.c
10 --- trayer-1.0/dclock.c 2008-03-17 12:54:58.000000000 +1100
11 +++ trayer-1.0-GtkTooltip/dclock.c 2008-03-17 13:01:06.000000000 +1100
12 @@ -22,7 +22,6 @@
13 GtkWidget *eb;
14 GtkWidget *main;
15 GtkWidget *clockw;
16 - GtkTooltips *tip;
17 char *tfmt;
18 char *cfmt;
19 char *action;
20 @@ -69,7 +68,7 @@
22 strftime (output, sizeof(output), dc->tfmt, detail) ;
23 if ((utf8 = g_locale_to_utf8(output, -1, NULL, NULL, NULL))) {
24 - gtk_tooltips_set_tip(dc->tip, dc->main, utf8, NULL) ;
25 + gtk_widget_set_tooltip_text (dc->main, utf8);
26 g_free(utf8);
29 @@ -126,15 +125,13 @@
30 g_signal_connect (G_OBJECT (dc->main), "button_press_event",
31 G_CALLBACK (clicked), (gpointer) dc);
32 time(&now);
33 - detail = localtime(&now);
34 - strftime(output, sizeof(output), dc->cfmt, detail) ;
35 dc->clockw = gtk_label_new(output);
36 + clock_update(dc);
37 gtk_misc_set_alignment(GTK_MISC(dc->clockw), 0.5, 0.5);
38 gtk_misc_set_padding(GTK_MISC(dc->clockw), 4, 0);
39 //gtk_widget_show(dc->clockw);
40 gtk_container_add(GTK_CONTAINER(dc->main), dc->clockw);
41 gtk_widget_show_all(dc->main);
42 - dc->tip = gtk_tooltips_new();
43 dc->timer = g_timeout_add(1000, (GSourceFunc) clock_update, (gpointer)dc);
44 gtk_container_add(GTK_CONTAINER(p->pwid), dc->main);
45 RET(1);
46 diff -urN trayer-1.0/systray/fixedtip.c trayer-1.0-GtkTooltip/systray/fixedtip.c
47 --- trayer-1.0/systray/fixedtip.c 2004-05-24 04:57:04.000000000 +1000
48 +++ trayer-1.0-GtkTooltip/systray/fixedtip.c 2008-03-17 13:03:23.000000000 +1100
49 @@ -36,17 +36,6 @@
50 return FALSE;
53 -static gboolean
54 -expose_handler (GtkTooltips *tooltips)
56 - gtk_paint_flat_box (tip->style, tip->window,
57 - GTK_STATE_NORMAL, GTK_SHADOW_OUT,
58 - NULL, tip, "tooltip",
59 - 0, 0, -1, -1);
61 - return FALSE;
64 void
65 fixed_tip_show (int screen_number,
66 int root_x, int root_y,
67 @@ -81,11 +70,6 @@
68 gtk_widget_set_name (tip, "gtk-tooltips");
69 gtk_container_set_border_width (GTK_CONTAINER (tip), 4);
71 - g_signal_connect (G_OBJECT (tip),
72 - "expose_event",
73 - G_CALLBACK (expose_handler),
74 - NULL);
76 gtk_widget_add_events (tip, GDK_BUTTON_PRESS_MASK);
78 g_signal_connect (G_OBJECT (tip),