void ScrollView::platformSetScrollbarModes() { bool needsAdjust = false; if (m_data->hScrollbarMode != horizontalScrollbarMode() ) { m_data->hScrollbarMode = horizontalScrollbarMode(); needsAdjust = true; } if (m_data->vScrollbarMode != verticalScrollbarMode() ) { m_data->vScrollbarMode = verticalScrollbarMode(); needsAdjust = true; } if (needsAdjust) adjustScrollbars(); }
void ScrollView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode, bool horizontalLock, bool verticalLock) { // FIXME: Restructure the ScrollView abstraction so that we do not have to // copy this verbatim from ScrollView.cpp. Until then, we should make sure this // is kept in sync. bool needsUpdate = false; if (horizontalMode != horizontalScrollbarMode() && !m_horizontalScrollbarLock) { m_horizontalScrollbarMode = horizontalMode; needsUpdate = true; } if (verticalMode != verticalScrollbarMode() && !m_verticalScrollbarLock) { m_verticalScrollbarMode = verticalMode; needsUpdate = true; } if (horizontalLock) setHorizontalScrollbarLock(); if (verticalLock) setVerticalScrollbarLock(); if (needsUpdate) updateScrollbars(scrollOffset()); // We don't need to report policy changes on ScrollView's unless this // one has an adjustment attached and it is a main frame. if (!m_horizontalAdjustment || parent() || !isFrameView()) return; // For frames that do have adjustments attached, we want to report // policy changes, so that they may be applied to the widget to // which the WebView's container (e.g. GtkScrolledWindow). if (hostWindow()) hostWindow()->scrollbarsModeDidChange(); }