Example #1
0
/*!
  Returns the current value for the scrollbar with orientation \a orientation, or 0
  if no scrollbar is found for \a orientation.

  \sa scrollBarMinimum(), scrollBarMaximum()
*/
int QWebFrame::scrollBarValue(Qt::Orientation orientation) const
{
    Scrollbar *sb;
    sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar();
    if (sb)
        return sb->value();
    return 0;
}
void GtkAdjustmentWatcher::adjustmentValueChanged(GtkAdjustment* adjustment)
{
    FrameView* frameView = core(m_webView)->mainFrame()->view();
    Scrollbar* scrollbar = (adjustment == m_horizontalAdjustment.get()) ? 
        frameView->horizontalScrollbar() : frameView->verticalScrollbar();
    if (!scrollbar)
        return;

    int newValue = static_cast<int>(gtk_adjustment_get_value(adjustment));
    if (newValue != scrollbar->value()) {
        m_handlingGtkAdjustmentChange = true;
        frameView->scrollToOffsetWithoutAnimation(scrollbar->orientation(), newValue);
        m_handlingGtkAdjustmentChange = false;
    }
}