emailuis/nmailui/src/nmviewerview.cpp
changeset 72 64e38f08e49c
parent 65 478bc57ad291
child 75 47d84de1c893
equal deleted inserted replaced
65:478bc57ad291 72:64e38f08e49c
   417             mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_ATTALIST));
   417             mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_ATTALIST));
   418     if (mMessage && mAttaWidget) {
   418     if (mMessage && mAttaWidget) {
   419         // connect atta widget to listen progress value events
   419         // connect atta widget to listen progress value events
   420         QObject::connect(this, SIGNAL(progressValueChanged(int, int)),
   420         QObject::connect(this, SIGNAL(progressValueChanged(int, int)),
   421                 mAttaWidget, SLOT(setProgressBarValue(int, int)));
   421                 mAttaWidget, SLOT(setProgressBarValue(int, int)));
   422         // Set atta widget text color black since header has static white bg.
   422 
       
   423         // Set the text color of the attachment widget black and the background
       
   424         // color white.
   423         mAttaWidget->setTextColor(Qt::black);
   425         mAttaWidget->setTextColor(Qt::black);
       
   426         mAttaWidget->setBackgroundColor(Qt::white);
       
   427 
   424         // Set attawidget minimum & maximum size
   428         // Set attawidget minimum & maximum size
   425         mAttaWidget->setMinimumWidth(mScreenSize.width());
   429         mAttaWidget->setMinimumWidth(mScreenSize.width());
   426         mAttaWidget->setMaximumWidth(mScreenSize.width());
   430         mAttaWidget->setMaximumWidth(mScreenSize.width());
   427         bool inserted(false);
   431         bool inserted(false);
   428         QList<NmMessagePart*> messageParts;
   432         QList<NmMessagePart*> messageParts;
   547         for (int i=0; i < parts.count(); i++) {
   551         for (int i=0; i < parts.count(); i++) {
   548             NmMessagePart *child = parts[i];
   552             NmMessagePart *child = parts[i];
   549             // Browse through embedded image parts and add those
   553             // Browse through embedded image parts and add those
   550             // the web view.
   554             // the web view.
   551             bool isFetched = child->fetchedSize() >= child->size();
   555             bool isFetched = child->fetchedSize() >= child->size();
   552             if (child->contentType().startsWith("image", Qt::CaseInsensitive)) {
   556             if(child->contentType().startsWith("image", Qt::CaseInsensitive) &&
       
   557                child->contentDisposition().trimmed().startsWith("inline", Qt::CaseInsensitive)) {
   553                 QString contentId = child->contentId();
   558                 QString contentId = child->contentId();
   554                 if (isFetched) {
   559                 if (isFetched) {
   555                     int ret = mUiEngine.contentToMessagePart(
   560                     int ret = mUiEngine.contentToMessagePart(
   556                             mailboxId, folderId, messageId, *child);
   561                             mailboxId, folderId, messageId, *child);
   557                     if (ret == NmNoError) {
   562                     if (ret == NmNoError) {
   591             QTextDocument document;
   596             QTextDocument document;
   592             // set font
   597             // set font
   593             QFont currentFont = document.defaultFont();
   598             QFont currentFont = document.defaultFont();
   594             currentFont.setWeight(QFont::Normal);
   599             currentFont.setWeight(QFont::Normal);
   595             qreal secondarySize;
   600             qreal secondarySize;
   596             HbStyle myStyle;
   601             bool found = style()->parameter(NmParamTextHeightSecondary, secondarySize);
   597             bool found = myStyle.parameter(NmParamTextHeightSecondary, secondarySize);
       
   598             if (found) {
   602             if (found) {
   599                 HbFontSpec fontSpec(HbFontSpec::Secondary);
   603                 HbFontSpec fontSpec(HbFontSpec::Secondary);
   600                 fontSpec.setTextHeight(secondarySize);
   604                 fontSpec.setTextHeight(secondarySize);
   601                 currentFont.setPixelSize(fontSpec.font().pixelSize());
   605                 currentFont.setPixelSize(fontSpec.font().pixelSize());
   602             }
   606             }