void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset) { if (requestScrollPositionUpdate(offset)) return; scrollPositionChanged(offset); }
void ScrollableArea::setScrollOffsetFromAnimation(const ScrollOffset& offset) { ScrollPosition position = scrollPositionFromOffset(offset); if (requestScrollPositionUpdate(position)) return; scrollPositionChanged(position); }
/*! \brief SLOT handles simultanous vertical scrolling of owned widgets. \param newPos New scroll position */ void CalenDayContentWidget::widgetScrolled(const QPointF &newPos) { for (int i = 0; i < mWidgets.count(); i++) { CalenDayItemView *view = static_cast<CalenDayItemView *> (mWidgets[i]); view->scrollVertically(newPos); } emit scrollPositionChanged(newPos); }
void ScrollableArea::setScrollPosition(const DoublePoint& position, ScrollType scrollType, ScrollBehavior behavior) { if (behavior == ScrollBehaviorAuto) behavior = scrollBehaviorStyle(); if (scrollType == CompositorScroll) scrollPositionChanged(clampScrollPosition(position), CompositorScroll); else if (scrollType == ProgrammaticScroll) programmaticScrollHelper(position, behavior); else if (scrollType == UserScroll) userScrollHelper(position, behavior); else ASSERT_NOT_REACHED(); }
void ScrollableArea::notifyScrollPositionChanged(const IntPoint& position) { scrollPositionChanged(position); scrollAnimator()->setCurrentPosition(position); }
void ScrollableArea::setScrollOffsetFromAnimation(const DoublePoint& offset) { scrollPositionChanged(offset); }
void GuiScrollBar::setScrollPosition(size_t position) { dynamic_cast<MyGUI::ScrollBar*>(getMyGUIWidget())->setScrollPosition(position); emit scrollPositionChanged(position); }
// NOTE: Only called from Internals for testing. void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset) { scrollPositionChanged(DoublePoint(offset), ProgrammaticScroll); }
/*! View layout loading from XML */ void NmViewerView::loadViewLayout() { NM_FUNCTION; // Use document loader to load the view bool ok(false); setObjectName(QString(NMUI_MESSAGE_VIEWER_VIEW)); QObjectList objectList; objectList.append(this); // Pass the view to documentloader. Document loader uses this view // when docml is parsed, instead of creating new view. // documentloader is created in constructor mDocumentLoader->setObjectTree(objectList); mWidgetList = mDocumentLoader->load(NMUI_MESSAGE_VIEWER_XML, &ok); if (ok) { // Create content and content layout // qobject_cast not work in this case, using reinterpret_cast mViewerContent = reinterpret_cast<HbWidget *>( mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_CONTENT)); // Find scroll area mScrollArea = reinterpret_cast<HbScrollArea *>( mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_SCROLL_AREA)); if (mScrollArea) { mScrollArea->setParentItem(this); mScrollArea->setScrollDirections(Qt::Vertical | Qt::Horizontal); connect(mScrollArea, SIGNAL(scrollPositionChanged(QPointF)), this, SLOT(contentScrollPositionChanged(QPointF))); // Get scroll area contents and set layout margins mScrollAreaContents = qobject_cast<HbWidget *>( mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_SCROLL_AREA_CONTENTS)); if (mScrollAreaContents) { QGraphicsLayout *layout = mScrollAreaContents->layout(); if (layout){ layout->setContentsMargins(0,0,0,0); } // Set white pixmap to backgrounditem QPixmap whitePixmap(NmWhitePixmapSize,NmWhitePixmapSize); whitePixmap.fill(Qt::white); QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(whitePixmap); mScrollAreaContents->setBackgroundItem(pixmapItem); } // Load headerwidget mHeaderWidget = qobject_cast<NmViewerHeader *>( mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_HEADER)); if (mHeaderWidget) { mHeaderWidget->setView(this); mHeaderWidget->rescaleHeader(mScreenSize); mHeaderWidget->setMessage(mMessage); QPointF headerStartPos = mHeaderWidget->scenePos(); mHeaderStartScenePos = QPointF(0,headerStartPos.y()); } // Load webview mWebView = reinterpret_cast<NmMailViewerWK *>( mDocumentLoader->findObject(QString(NMUI_MESSAGE_VIEWER_SCROLL_WEB_VIEW))); if (mWebView) { // Set auto load images and private browsing(no history) attributes QWebSettings *settings = mWebView->settings(); if (settings) { settings->setAttribute(QWebSettings::AutoLoadImages, true); settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); } QWebPage *page = mWebView->page(); if (page) { QWebFrame *frame = page->mainFrame(); if (frame) { frame->setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff); frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); frame->setTextSizeMultiplier(NmZoomFactor); connect(mWebView->page()->mainFrame(), SIGNAL(contentsSizeChanged(const QSize&)), this, SLOT(scaleWebViewWhenLoading(const QSize&))); } } } } } }