comparison src/gtkimhtml.c @ 8726:3ac178eedac2

[gaim-migrate @ 9481] Tim tells me this fixes some horizontal scrollbar-age committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Tue, 20 Apr 2004 15:04:42 +0000
parents 513b8bbcc104
children 7024b9145357
comparison
equal deleted inserted replaced
8725:809ef4f1b20e 8726:3ac178eedac2
216 } 216 }
217 217
218 static gboolean gtk_size_allocate_cb(GtkIMHtml *widget, GtkAllocation *alloc, gpointer user_data) 218 static gboolean gtk_size_allocate_cb(GtkIMHtml *widget, GtkAllocation *alloc, gpointer user_data)
219 { 219 {
220 GdkRectangle rect; 220 GdkRectangle rect;
221 int xminus;
221 222
222 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(widget), &rect); 223 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(widget), &rect);
223 if(widget->old_rect.width != rect.width || widget->old_rect.height != rect.height){ 224 if(widget->old_rect.width != rect.width || widget->old_rect.height != rect.height){
224 GList *iter = GTK_IMHTML(widget)->scalables; 225 GList *iter = GTK_IMHTML(widget)->scalables;
225 226
227 xminus = gtk_text_view_get_left_margin(GTK_TEXT_VIEW(widget)) +
228 gtk_text_view_get_right_margin(GTK_TEXT_VIEW(widget));
229
226 while(iter){ 230 while(iter){
227 GtkIMHtmlScalable *scale = GTK_IMHTML_SCALABLE(iter->data); 231 GtkIMHtmlScalable *scale = GTK_IMHTML_SCALABLE(iter->data);
228 scale->scale(scale, rect.width, rect.height); 232 scale->scale(scale, rect.width - xminus, rect.height);
229 233
230 iter = iter->next; 234 iter = iter->next;
231 } 235 }
232 } 236 }
233 237
1917 ws[wpos] = '\n'; 1921 ws[wpos] = '\n';
1918 wpos++; 1922 wpos++;
1919 break; 1923 break;
1920 case 26: /* HR */ 1924 case 26: /* HR */
1921 case 42: /* HR (opt) */ 1925 case 42: /* HR (opt) */
1926 {
1927 int minus;
1928
1922 ws[wpos++] = '\n'; 1929 ws[wpos++] = '\n';
1923 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 1930 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
1924 1931
1925 scalable = gtk_imhtml_hr_new(); 1932 scalable = gtk_imhtml_hr_new();
1926 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(imhtml), &rect); 1933 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(imhtml), &rect);
1927 scalable->add_to(scalable, imhtml, iter); 1934 scalable->add_to(scalable, imhtml, iter);
1928 scalable->scale(scalable, rect.width, rect.height); 1935 minus = gtk_text_view_get_left_margin(GTK_TEXT_VIEW(imhtml)) +
1936 gtk_text_view_get_right_margin(GTK_TEXT_VIEW(imhtml));
1937 scalable->scale(scalable, rect.width - minus, rect.height);
1929 imhtml->scalables = g_list_append(imhtml->scalables, scalable); 1938 imhtml->scalables = g_list_append(imhtml->scalables, scalable);
1930 ws[0] = '\0'; wpos = 0; 1939 ws[0] = '\0'; wpos = 0;
1931 ws[wpos++] = '\n'; 1940 ws[wpos++] = '\n';
1932 1941
1933 break; 1942 break;
1943 }
1934 case 27: /* /FONT */ 1944 case 27: /* /FONT */
1935 if (fonts && !imhtml->wbfo) { 1945 if (fonts && !imhtml->wbfo) {
1936 GtkIMHtmlFontDetail *font = fonts->data; 1946 GtkIMHtmlFontDetail *font = fonts->data;
1937 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 1947 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
1938 ws[0] = '\0'; wpos = 0; 1948 ws[0] = '\0'; wpos = 0;