diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-10-15 14:14:14 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-10-15 14:14:14 +0900 |
commit | d7c7f010b026003d50669a567bd5136e3eef7869 (patch) | |
tree | 5883721523f054cf3a6afab1a09e3880beacf01d /gtk | |
parent | 479dc131eef8793ec8e70f0b7dd929d028f68890 (diff) | |
download | gtk+-d7c7f010b026003d50669a567bd5136e3eef7869.tar.gz |
Removed screwy GtkScrolledWindow logic
Removed portion of scrolled-window that observes user-set
size request data (aux_info->width/height) on the child directly
in order to derive it's minimum possible size... if the scrolled
window has (auto/always) scrollbars in a said orientation; only
request enough space for the scrollbars (bug 631976).
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkscrolledwindow.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 1a13b4aa53..c3aac18256 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -2010,19 +2010,9 @@ gtk_scrolled_window_get_preferred_size (GtkWidget *widget, } else { - GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (child, FALSE); - - if (aux_info && aux_info->width > 0) - { - minimum_req.width += aux_info->width; - natural_req.width += aux_info->width; - extra_width = -1; - } - else - { - minimum_req.width += vscrollbar_requisition.width; - natural_req.width += vscrollbar_requisition.width; - } + /* Always ask for at least enough to fit the scrollbars */ + minimum_req.width += vscrollbar_requisition.width; + natural_req.width += vscrollbar_requisition.width; } } else /* GTK_ORIENTATION_VERTICAL */ @@ -2038,19 +2028,9 @@ gtk_scrolled_window_get_preferred_size (GtkWidget *widget, } else { - GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (child, FALSE); - - if (aux_info && aux_info->height > 0) - { - minimum_req.height += aux_info->height; - natural_req.height += aux_info->height; - extra_height = -1; - } - else - { - minimum_req.height += hscrollbar_requisition.height; - natural_req.height += hscrollbar_requisition.height; - } + /* Always ask for at least enough to fit the scrollbars */ + minimum_req.height += hscrollbar_requisition.height; + natural_req.height += hscrollbar_requisition.height; } } } @@ -2073,10 +2053,10 @@ gtk_scrolled_window_get_preferred_size (GtkWidget *widget, extra_width = scrollbar_spacing + vscrollbar_requisition.width; } - minimum_req.width += MAX (0, extra_width); - minimum_req.height += MAX (0, extra_height); - natural_req.width += MAX (0, extra_width); - natural_req.height += MAX (0, extra_height); + minimum_req.width += extra_width; + minimum_req.height += extra_height; + natural_req.width += extra_width; + natural_req.height += extra_height; if (priv->shadow_type != GTK_SHADOW_NONE) { |