X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f66f6a5b3583b02c34854556eb83e3a808524ce..11a23db53128bf244a089123b7fd27deb577a889:/src/gtk/scrolwin.cpp diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 37cf570e13..9b39077a3d 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -181,6 +181,23 @@ GtkPolicyType GtkPolicyFromWX(wxScrollbarVisibility visibility) } // anonymous namespace +bool wxScrollHelper::IsScrollbarShown(int orient) const +{ + GtkScrolledWindow * const scrolled = GTK_SCROLLED_WINDOW(m_win->m_widget); + if ( !scrolled ) + { + // By default, all windows are scrollable. + return true; + } + + GtkPolicyType hpolicy, vpolicy; + gtk_scrolled_window_get_policy(scrolled, &hpolicy, &vpolicy); + + GtkPolicyType policy = orient == wxHORIZONTAL ? hpolicy : vpolicy; + + return policy != GTK_POLICY_NEVER; +} + void wxScrollHelper::DoShowScrollbars(wxScrollbarVisibility horz, wxScrollbarVisibility vert) {