2010-06-22 Jan Djärv <jan.h.d@swipnet.se>
+ * xterm.c (x_scroll_bar_create): Remove call to xg_show_scroll_bar.
+
+ * gtkutil.h (xg_show_scroll_bar): : Remove.
+
+ * gtkutil.c (xg_update_scrollbar_pos): Show/hide scroll bar as needed
+ if height is less than scroll bar min size.
+ (xg_show_scroll_bar): Remove, show moved to xg_update_scrollbar_pos.
+
* xfns.c (x_default_font_parameter): Try to open font from system
before using it (bug#6478). Rename got_from_gconf to got_from_system.
bar->x_window = scroll_id;
}
-/* Make the scroll bar represented by SCROLLBAR_ID visible. */
-
-void
-xg_show_scroll_bar (scrollbar_id)
- int scrollbar_id;
-{
- GtkWidget *w = xg_get_widget_from_map (scrollbar_id);
- if (w)
- gtk_widget_show_all (gtk_widget_get_parent (w));
-}
-
/* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */
void
/* Move and resize to new values. */
gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top);
- gtk_widget_set_size_request (wscroll, width, height);
+ gint msl;
+ gtk_widget_style_get (wscroll, "min-slider-length", &msl, NULL);
+ if (msl > height)
+ {
+ /* No room. Hide scroll bar as some themes output a warning if
+ the height is less than the min size. */
+ gtk_widget_hide (wparent);
+ gtk_widget_hide (wscroll);
+ }
+ else
+ {
+ gtk_widget_show_all (wparent);
+ gtk_widget_set_size_request (wscroll, width, height);
+ }
gtk_widget_queue_draw (wfixed);
gdk_window_process_all_updates ();
- if (oldx != -1)
+ if (oldx != -1 && oldw > 0 && oldh > 0)
{
/* Clear under old scroll bar position. This must be done after
the gtk_widget_queue_draw and gdk_window_process_all_updates
GCallback scroll_callback,
GCallback end_callback,
char *scroll_bar_name));
-extern void xg_show_scroll_bar P_ ((int scrollbar_id));
extern void xg_remove_scroll_bar P_ ((FRAME_PTR f, int scrollbar_id));
extern void xg_update_scrollbar_pos P_ ((FRAME_PTR f,
left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
max (height, 1));
- xg_show_scroll_bar (bar->x_window);
#else /* not USE_GTK */
Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
XtConfigureWidget (scroll_bar,