comparison src/gtkconv.c @ 9459:dbeca8eca296

[gaim-migrate @ 10283] (08:24:24) LSchiere: nosnilmot: https://sourceforge.net/tracker/?func=detail&atid=100235&aid=972285&group_id=235 (08:37:39) nosnilmot: LSchiere: the only way I can reproduce anything like what's reported in that bug is by having the formatting toolbar disabled in prefs, and manually enabling it each time I start a new conversation (08:38:12) LSchiere: nosnilmot: can you fix that case? ;-) (08:38:34) nosnilmot: LSchiere: I doubt it (08:38:42) LSchiere: :-/ (08:39:00) nosnilmot: that would seem to be a stupid case to support, if the user really wants the formatting toolbar then they should just enable it in prefs! (08:39:51) LSchiere: now that's not quite so true. i've got it globally disabled and i've been known to enable it just long enough to remember the code to a smiley i've forgotten (08:40:52) nosnilmot: actually... how about if I try to check if the formatting toolbar is present, and if it's presence doesn't match preferences, don't save the conv size? (08:41:10) LSchiere: that works committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 06 Jul 2004 12:58:29 +0000
parents 3584cdab1d0b
children 4d0b0d5485e6
comparison
equal deleted inserted replaced
9458:3c92ae9fde5e 9459:dbeca8eca296
215 static gboolean 215 static gboolean
216 size_allocate_cb(GtkWidget *w, GtkAllocation *allocation, GaimConversation *conv) 216 size_allocate_cb(GtkWidget *w, GtkAllocation *allocation, GaimConversation *conv)
217 { 217 {
218 GaimGtkConversation *gtkconv; 218 GaimGtkConversation *gtkconv;
219 GaimConvWindow *win = gaim_conversation_get_window(conv); 219 GaimConvWindow *win = gaim_conversation_get_window(conv);
220 gboolean saveheight;
220 221
221 if (!GTK_WIDGET_VISIBLE(w)) 222 if (!GTK_WIDGET_VISIBLE(w))
222 return FALSE; 223 return FALSE;
223 224
224 if (!GAIM_IS_GTK_CONVERSATION(conv)) 225 if (!GAIM_IS_GTK_CONVERSATION(conv))
225 return FALSE; 226 return FALSE;
226 227
227 gtkconv = GAIM_GTK_CONVERSATION(conv); 228 gtkconv = GAIM_GTK_CONVERSATION(conv);
229
230 /* we only save the new height if the formatting toolbar visibility matches the pref */
231 saveheight = (gtkconv->show_formatting_toolbar == gaim_prefs_get_bool("/gaim/gtk/conversations/show_formatting_toolbar"));
228 232
229 /* I find that I resize the window when it has a bunch of conversations in it, mostly so that the tab bar 233 /* I find that I resize the window when it has a bunch of conversations in it, mostly so that the tab bar
230 * will fit, but then I don't want new windows taking up the entire screen. I check to see if there is only one 234 * will fit, but then I don't want new windows taking up the entire screen. I check to see if there is only one
231 * conversation in the window. This way we'll be setting new windows to the size of the last resized new window. */ 235 * conversation in the window. This way we'll be setting new windows to the size of the last resized new window. */
232 236
233 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) 237 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM)
234 { 238 {
235 if (w == gtkconv->sw && (gaim_conv_window_get_conversation_count(win) == 1)) 239 if (w == gtkconv->sw && (gaim_conv_window_get_conversation_count(win) == 1))
236 { 240 {
237 gaim_prefs_set_int("/gaim/gtk/conversations/im/default_width", allocation->width); 241 gaim_prefs_set_int("/gaim/gtk/conversations/im/default_width", allocation->width);
238 gaim_prefs_set_int("/gaim/gtk/conversations/im/default_height", allocation->height); 242 if (saveheight)
243 gaim_prefs_set_int("/gaim/gtk/conversations/im/default_height", allocation->height);
239 } 244 }
240 if (w == gtkconv->entry) 245 if (w == gtkconv->entry)
241 gaim_prefs_set_int("/gaim/gtk/conversations/im/entry_height", allocation->height); 246 gaim_prefs_set_int("/gaim/gtk/conversations/im/entry_height", allocation->height);
242 } 247 }
243 else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT) 248 else if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT)
244 { 249 {
245 if (w == gtkconv->sw && (gaim_conv_window_get_conversation_count(win) == 1)) 250 if (w == gtkconv->sw && (gaim_conv_window_get_conversation_count(win) == 1))
246 { 251 {
247 gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_width", allocation->width); 252 gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_width", allocation->width);
248 gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_height", allocation->height); 253 if (saveheight)
254 gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_height", allocation->height);
249 } 255 }
250 if (w == gtkconv->entry) 256 if (w == gtkconv->entry)
251 gaim_prefs_set_int("/gaim/gtk/conversations/chat/entry_height", allocation->height); 257 gaim_prefs_set_int("/gaim/gtk/conversations/chat/entry_height", allocation->height);
252 } 258 }
253 259