Thu, 19 Dec 2019 05:00:44 -0500
Convert PidginRoomlistDialog to Glade.
| 11553 | 1 | /* |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
2 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 11553 | 3 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 4 | * source distribution. | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or modify | |
| 7 | * under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation; either version 2 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15931
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 11553 | 19 | */ |
|
33759
20349cbb57a0
Fix a linker error when building with gtk3. Specifically:
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
20 | #include "internal.h" |
|
20349cbb57a0
Fix a linker error when building with gtk3. Specifically:
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
21 | |
|
11908
ad9c7ca74793
[gaim-migrate @ 14199]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11888
diff
changeset
|
22 | #include "debug.h" |
|
ad9c7ca74793
[gaim-migrate @ 14199]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11888
diff
changeset
|
23 | |
|
40212
352d23243db5
rename gtkmenutray.[ch] to pidginmenutray.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
40210
diff
changeset
|
24 | #include "pidginmenutray.h" |
| 11553 | 25 | |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
26 | struct _PidginMenuTray { |
|
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
27 | GtkMenuItem parent; |
|
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
28 | |
|
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
29 | GtkWidget *tray; |
|
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
30 | }; |
|
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
31 | |
| 11553 | 32 | enum { |
| 33 | PROP_ZERO = 0, | |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
34 | PROP_BOX, |
|
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
35 | N_PROPERTIES |
| 11553 | 36 | }; |
| 37 | ||
| 38 | /****************************************************************************** | |
| 39 | * Globals | |
| 40 | *****************************************************************************/ | |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
41 | static GParamSpec *properties[N_PROPERTIES] = {NULL, }; |
| 11553 | 42 | |
| 43 | /****************************************************************************** | |
| 44 | * Item Stuff | |
| 45 | *****************************************************************************/ | |
| 46 | static void | |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
32375
diff
changeset
|
47 | pidgin_menu_tray_select(GtkMenuItem *widget) { |
| 11553 | 48 | /* this may look like nothing, but it's really overriding the |
| 49 | * GtkMenuItem's select function so that it doesn't get highlighted like | |
| 50 | * a normal menu item would. | |
| 51 | */ | |
| 52 | } | |
| 53 | ||
| 54 | static void | |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
32375
diff
changeset
|
55 | pidgin_menu_tray_deselect(GtkMenuItem *widget) { |
| 11553 | 56 | /* Probably not necessary, but I'd rather be safe than sorry. We're |
| 57 | * overridding the select, so it makes sense to override deselect as well. | |
| 58 | */ | |
| 59 | } | |
| 60 | ||
| 61 | /****************************************************************************** | |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
62 | * GObject Implementation |
| 11553 | 63 | *****************************************************************************/ |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
64 | G_DEFINE_TYPE(PidginMenuTray, pidgin_menu_tray, GTK_TYPE_MENU_ITEM); |
|
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
65 | |
| 11553 | 66 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
67 | pidgin_menu_tray_get_property(GObject *obj, guint param_id, GValue *value, |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
68 | GParamSpec *pspec) |
| 11553 | 69 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
70 | PidginMenuTray *menu_tray = PIDGIN_MENU_TRAY(obj); |
| 11553 | 71 | |
| 72 | switch(param_id) { | |
| 73 | case PROP_BOX: | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
74 | g_value_set_object(value, pidgin_menu_tray_get_box(menu_tray)); |
| 11553 | 75 | break; |
| 76 | default: | |
| 77 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); | |
| 78 | break; | |
| 79 | } | |
| 80 | } | |
| 81 | ||
| 82 | static void | |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
83 | pidgin_menu_tray_map(GtkWidget *widget) { |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
84 | GTK_WIDGET_CLASS(pidgin_menu_tray_parent_class)->map(widget); |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
85 | |
|
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
86 | gtk_container_add(GTK_CONTAINER(widget), PIDGIN_MENU_TRAY(widget)->tray); |
|
24327
2c0e33b2dc94
Change some menutray internals. This makes the tray-icons behave better.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23188
diff
changeset
|
87 | } |
|
2c0e33b2dc94
Change some menutray internals. This makes the tray-icons behave better.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23188
diff
changeset
|
88 | |
|
2c0e33b2dc94
Change some menutray internals. This makes the tray-icons behave better.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23188
diff
changeset
|
89 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
90 | pidgin_menu_tray_class_init(PidginMenuTrayClass *klass) { |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
91 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
32375
diff
changeset
|
92 | GtkMenuItemClass *menu_item_class = GTK_MENU_ITEM_CLASS(klass); |
|
24327
2c0e33b2dc94
Change some menutray internals. This makes the tray-icons behave better.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23188
diff
changeset
|
93 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
| 11553 | 94 | |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
95 | obj_class->get_property = pidgin_menu_tray_get_property; |
| 11553 | 96 | |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
32375
diff
changeset
|
97 | menu_item_class->select = pidgin_menu_tray_select; |
|
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
32375
diff
changeset
|
98 | menu_item_class->deselect = pidgin_menu_tray_deselect; |
| 11553 | 99 | |
|
24327
2c0e33b2dc94
Change some menutray internals. This makes the tray-icons behave better.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23188
diff
changeset
|
100 | widget_class->map = pidgin_menu_tray_map; |
|
2c0e33b2dc94
Change some menutray internals. This makes the tray-icons behave better.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23188
diff
changeset
|
101 | |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
102 | properties[PROP_BOX] = g_param_spec_object("box", "The box", "The box", |
|
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
103 | GTK_TYPE_BOX, |
|
40213
0c986cb5c063
Add G_PARAM_STATIC_STRINGS back
Gary Kramlich <grim@reaperworld.com>
parents:
40212
diff
changeset
|
104 | G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); |
|
40208
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
105 | |
|
1341d8d2c10e
Move PidginMenuTray to the gtype macros
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
106 | g_object_class_install_properties(obj_class, N_PROPERTIES, properties); |
| 11553 | 107 | } |
| 108 | ||
| 109 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
110 | pidgin_menu_tray_init(PidginMenuTray *menu_tray) { |
|
11787
fb0c7b22368d
[gaim-migrate @ 14078]
Gary Kramlich <grim@reaperworld.com>
parents:
11599
diff
changeset
|
111 | GtkWidget *widget = GTK_WIDGET(menu_tray); |
|
fb0c7b22368d
[gaim-migrate @ 14078]
Gary Kramlich <grim@reaperworld.com>
parents:
11599
diff
changeset
|
112 | gint height = -1; |
|
fb0c7b22368d
[gaim-migrate @ 14078]
Gary Kramlich <grim@reaperworld.com>
parents:
11599
diff
changeset
|
113 | |
|
35533
8ca83abbc248
Fix some crashes and bugs introduced by recent deprecation fixes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35532
diff
changeset
|
114 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
8ca83abbc248
Fix some crashes and bugs introduced by recent deprecation fixes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35532
diff
changeset
|
115 | /* Gtk3 docs says, it should be replaced with gtk_widget_set_hexpand and |
|
8ca83abbc248
Fix some crashes and bugs introduced by recent deprecation fixes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35532
diff
changeset
|
116 | * gtk_widget_set_halign. But it doesn't seems to work. */ |
| 11553 | 117 | gtk_menu_item_set_right_justified(GTK_MENU_ITEM(menu_tray), TRUE); |
|
35533
8ca83abbc248
Fix some crashes and bugs introduced by recent deprecation fixes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35532
diff
changeset
|
118 | G_GNUC_END_IGNORE_DEPRECATIONS |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
119 | |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
120 | if(!GTK_IS_WIDGET(menu_tray->tray)) { |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35060
diff
changeset
|
121 | menu_tray->tray = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
122 | } |
| 11553 | 123 | |
|
40210
34c97330b166
remove the finalize method as it's not necessary and clean up a deprecation warning
Gary Kramlich <grim@reaperworld.com>
parents:
40209
diff
changeset
|
124 | if(gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, NULL, &height)) { |
|
11787
fb0c7b22368d
[gaim-migrate @ 14078]
Gary Kramlich <grim@reaperworld.com>
parents:
11599
diff
changeset
|
125 | gtk_widget_set_size_request(widget, -1, height); |
|
fb0c7b22368d
[gaim-migrate @ 14078]
Gary Kramlich <grim@reaperworld.com>
parents:
11599
diff
changeset
|
126 | } |
|
fb0c7b22368d
[gaim-migrate @ 14078]
Gary Kramlich <grim@reaperworld.com>
parents:
11599
diff
changeset
|
127 | |
| 11558 | 128 | gtk_widget_show(menu_tray->tray); |
| 11553 | 129 | } |
| 130 | ||
| 131 | /****************************************************************************** | |
| 132 | * API | |
| 133 | *****************************************************************************/ | |
| 134 | GtkWidget * | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
135 | pidgin_menu_tray_new() { |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
136 | return g_object_new(PIDGIN_TYPE_MENU_TRAY, NULL); |
| 11553 | 137 | } |
| 138 | ||
| 139 | GtkWidget * | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
140 | pidgin_menu_tray_get_box(PidginMenuTray *menu_tray) { |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
141 | g_return_val_if_fail(PIDGIN_IS_MENU_TRAY(menu_tray), NULL); |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
142 | |
| 11558 | 143 | return menu_tray->tray; |
| 11553 | 144 | } |
| 145 | ||
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
146 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
147 | pidgin_menu_tray_add(PidginMenuTray *menu_tray, GtkWidget *widget, |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
148 | const char *tooltip, gboolean prepend) |
|
11908
ad9c7ca74793
[gaim-migrate @ 14199]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11888
diff
changeset
|
149 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
150 | g_return_if_fail(PIDGIN_IS_MENU_TRAY(menu_tray)); |
| 11553 | 151 | g_return_if_fail(GTK_IS_WIDGET(widget)); |
| 152 | ||
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
153 | if (!gtk_widget_get_has_window(widget)) { |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
154 | GtkWidget *event; |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
155 | |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
156 | event = gtk_event_box_new(); |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
157 | gtk_container_add(GTK_CONTAINER(event), widget); |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
158 | gtk_widget_show(event); |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
159 | widget = event; |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
160 | } |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
161 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
162 | pidgin_menu_tray_set_tooltip(menu_tray, widget, tooltip); |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
163 | |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
164 | if (prepend) { |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
165 | gtk_box_pack_start(GTK_BOX(menu_tray->tray), widget, FALSE, FALSE, 0); |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
166 | } else { |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
167 | gtk_box_pack_end(GTK_BOX(menu_tray->tray), widget, FALSE, FALSE, 0); |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
168 | } |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
169 | } |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
170 | |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
171 | void |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
172 | pidgin_menu_tray_append(PidginMenuTray *menu_tray, GtkWidget *widget, |
|
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
173 | const char *tooltip) |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
174 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
175 | pidgin_menu_tray_add(menu_tray, widget, tooltip, FALSE); |
| 11553 | 176 | } |
| 177 | ||
| 178 | void | |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
179 | pidgin_menu_tray_prepend(PidginMenuTray *menu_tray, GtkWidget *widget, |
|
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
180 | const char *tooltip) |
|
11908
ad9c7ca74793
[gaim-migrate @ 14199]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11888
diff
changeset
|
181 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
182 | pidgin_menu_tray_add(menu_tray, widget, tooltip, TRUE); |
| 11553 | 183 | } |
|
11908
ad9c7ca74793
[gaim-migrate @ 14199]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11888
diff
changeset
|
184 | |
|
ad9c7ca74793
[gaim-migrate @ 14199]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11888
diff
changeset
|
185 | void |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
186 | pidgin_menu_tray_set_tooltip(PidginMenuTray *menu_tray, GtkWidget *widget, |
|
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
187 | const char *tooltip) |
|
11908
ad9c7ca74793
[gaim-migrate @ 14199]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11888
diff
changeset
|
188 | { |
|
ad9c7ca74793
[gaim-migrate @ 14199]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11888
diff
changeset
|
189 | /* Should we check whether widget is a child of menu_tray? */ |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
190 | |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
191 | /* |
|
26929
2a8ade936729
Replace GtkTooltips code with GtkTooltip on GTK+ 2.12+.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26727
diff
changeset
|
192 | * If the widget does not have its own window, then it |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
193 | * must have automatically been added to an event box |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
194 | * when it was added to the menu tray. If this is the |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
195 | * case, we want to set the tooltip on the widget's parent, |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
196 | * not on the widget itself. |
|
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
197 | */ |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
198 | if (!gtk_widget_get_has_window(widget)) { |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
32375
diff
changeset
|
199 | widget = gtk_widget_get_parent(widget); |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
200 | } |
|
12008
df998b18ec60
[gaim-migrate @ 14301]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11908
diff
changeset
|
201 | |
|
26929
2a8ade936729
Replace GtkTooltips code with GtkTooltip on GTK+ 2.12+.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26727
diff
changeset
|
202 | gtk_widget_set_tooltip_text(widget, tooltip); |
|
11908
ad9c7ca74793
[gaim-migrate @ 14199]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11888
diff
changeset
|
203 | } |
|
40209
ee5349aa57ac
Clean up a some formatting
Gary Kramlich <grim@reaperworld.com>
parents:
40208
diff
changeset
|
204 |