diff -r a8c646b56683 -r 084b5b1f02a7 emailuis/nmailui/src/nmeditorcontent.cpp --- a/emailuis/nmailui/src/nmeditorcontent.cpp Mon Aug 23 23:32:31 2010 +0300 +++ b/emailuis/nmailui/src/nmeditorcontent.cpp Fri Sep 03 14:07:42 2010 +0300 @@ -221,30 +221,34 @@ { NM_FUNCTION; - // the height of the margin between the title bar and the header - qreal topMargin = 0; - HbStyle().parameter("hb-param-margin-gene-top", topMargin); + HbStyle* style = mScrollAreaContents->style(); + + if (style) { + // the height of the margin between the title bar and the header + qreal topMargin = 0; + style->parameter("hb-param-margin-gene-top", topMargin); + + // header height + qreal headerHeight = mHeader->headerHeight(); + + // body area editor's document height with margins added + qreal documentHeightAndMargins = mEditorWidget->document()->size().height() + + (mEditorWidget->document()->documentMargin() * 2); - // header height - qreal headerHeight = mHeader->headerHeight(); - - // body area editor's document height with margins added - qreal documentHeightAndMargins = mEditorWidget->document()->size().height() + - (mEditorWidget->document()->documentMargin() * 2); - - // chrome height - qreal chromeHeight = 0; - HbStyle().parameter("hb-param-widget-chrome-height", chromeHeight); + // chrome height + qreal chromeHeight = 0; + style->parameter("hb-param-widget-chrome-height", chromeHeight); + + // screen height + qreal screenHeight = mApplication.screenSize().height(); - // screen height - qreal screenHeight = mApplication.screenSize().height(); - - // set min size for the body area so that at least the screen area is always filled - qreal bodyAreaMinSize = screenHeight - chromeHeight - topMargin - headerHeight; - - qreal bodyAreaSize = fmax(bodyAreaMinSize, documentHeightAndMargins); - - mScrollAreaContents->setPreferredHeight(topMargin + headerHeight + bodyAreaSize); + // set min size for the body area so that at least the screen area is always filled + qreal bodyAreaMinSize = screenHeight - chromeHeight - topMargin - headerHeight; + + qreal bodyAreaSize = fmax(bodyAreaMinSize, documentHeightAndMargins); + + mScrollAreaContents->setPreferredHeight(topMargin + headerHeight + bodyAreaSize); + } } /*! @@ -301,7 +305,7 @@ QPointF bottomRightPos = focused->mapToItem(mScrollAreaContents, localRect.bottomRight()); qreal marginRight = 0; - HbStyle().parameter("hb-param-margin-gene-right", marginRight); + mScrollArea->style()->parameter("hb-param-margin-gene-right", marginRight); bottomRightPos.rx() += marginRight; mScrollArea->ensureVisible(topLeftPos); mScrollArea->ensureVisible(bottomRightPos); @@ -330,8 +334,8 @@ // Get the layout's left margin qreal margin = 0; - HbStyle().parameter("hb-param-margin-gene-left", margin); - + HbInstance::instance()->style()->parameter("hb-param-margin-gene-left", margin); + // Calculate header width. (Screen width minus left and right margins. qreal headerWidth = mApplication.screenSize().width() - margin - margin;