Mercurial > emacs
comparison src/gtkutil.c @ 109415:5922ae6fb6dc
Merge from mainline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Tue, 22 Jun 2010 22:50:34 +0000 |
parents | 3e9a832a5533 |
children | 98796fa1a7f8 |
comparison
equal
deleted
inserted
replaced
109414:51f725b66eac | 109415:5922ae6fb6dc |
---|---|
3172 xg_set_cursor (webox, FRAME_X_DISPLAY_INFO (f)->xg_cursor); | 3172 xg_set_cursor (webox, FRAME_X_DISPLAY_INFO (f)->xg_cursor); |
3173 | 3173 |
3174 bar->x_window = scroll_id; | 3174 bar->x_window = scroll_id; |
3175 } | 3175 } |
3176 | 3176 |
3177 /* Make the scroll bar represented by SCROLLBAR_ID visible. */ | |
3178 | |
3179 void | |
3180 xg_show_scroll_bar (scrollbar_id) | |
3181 int scrollbar_id; | |
3182 { | |
3183 GtkWidget *w = xg_get_widget_from_map (scrollbar_id); | |
3184 if (w) | |
3185 gtk_widget_show_all (gtk_widget_get_parent (w)); | |
3186 } | |
3187 | |
3188 /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */ | 3177 /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */ |
3189 | 3178 |
3190 void | 3179 void |
3191 xg_remove_scroll_bar (f, scrollbar_id) | 3180 xg_remove_scroll_bar (f, scrollbar_id) |
3192 FRAME_PTR f; | 3181 FRAME_PTR f; |
3241 break; | 3230 break; |
3242 } | 3231 } |
3243 | 3232 |
3244 /* Move and resize to new values. */ | 3233 /* Move and resize to new values. */ |
3245 gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); | 3234 gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); |
3246 gtk_widget_set_size_request (wscroll, width, height); | 3235 gint msl; |
3236 gtk_widget_style_get (wscroll, "min-slider-length", &msl, NULL); | |
3237 if (msl > height) | |
3238 { | |
3239 /* No room. Hide scroll bar as some themes output a warning if | |
3240 the height is less than the min size. */ | |
3241 gtk_widget_hide (wparent); | |
3242 gtk_widget_hide (wscroll); | |
3243 } | |
3244 else | |
3245 { | |
3246 gtk_widget_show_all (wparent); | |
3247 gtk_widget_set_size_request (wscroll, width, height); | |
3248 } | |
3247 gtk_widget_queue_draw (wfixed); | 3249 gtk_widget_queue_draw (wfixed); |
3248 gdk_window_process_all_updates (); | 3250 gdk_window_process_all_updates (); |
3249 if (oldx != -1) | 3251 if (oldx != -1 && oldw > 0 && oldh > 0) |
3250 { | 3252 { |
3251 /* Clear under old scroll bar position. This must be done after | 3253 /* Clear under old scroll bar position. This must be done after |
3252 the gtk_widget_queue_draw and gdk_window_process_all_updates | 3254 the gtk_widget_queue_draw and gdk_window_process_all_updates |
3253 above. */ | 3255 above. */ |
3254 x_clear_area (FRAME_X_DISPLAY (f), | 3256 x_clear_area (FRAME_X_DISPLAY (f), |