emailuis/nmailui/src/nmmessagelistviewitem.cpp
changeset 54 997a02608b3a
parent 53 bf7eb7911fc5
child 56 15bc1d5d6267
child 59 16ed8d08d0b1
equal deleted inserted replaced
53:bf7eb7911fc5 54:997a02608b3a
   234         mNewMsgIcon->hide();        
   234         mNewMsgIcon->hide();        
   235     }
   235     }
   236 }
   236 }
   237 
   237 
   238 /*!
   238 /*!
   239     paint. Paint function for line painting.
       
   240 */
       
   241 void NmMessageListViewItem::paint(
       
   242     QPainter *painter,
       
   243     const QStyleOptionGraphicsItem *option,
       
   244     QWidget *widget)
       
   245 {
       
   246     NM_FUNCTION;
       
   247     
       
   248     Q_UNUSED(option);
       
   249     Q_UNUSED(widget);
       
   250     Q_UNUSED(painter);
       
   251 }
       
   252 
       
   253 /*!
       
   254     setFontsUnread
   239     setFontsUnread
   255 */
   240 */
   256 void  NmMessageListViewItem::setFontsUnread()
   241 void  NmMessageListViewItem::setFontsUnread()
   257 {    
   242 {    
   258     NM_FUNCTION;
   243     NM_FUNCTION;
   259     
   244     
   260     static QColor colorRole = HbColorScheme::color("qtc_list_item_title_normal");
   245     static QColor colorRole = HbColorScheme::color("qtc_list_item_title_normal");
   261     HbFontSpec spekki(HbFontSpec::Primary);
   246     HbFontSpec fontSpec(HbFontSpec::Primary);
   262     setFonts(colorRole, spekki);
   247     setFonts(colorRole, fontSpec);
   263 }
   248 }
   264 
   249 
   265 /*!
   250 /*!
   266     setFontsRead
   251     setFontsRead
   267 */
   252 */
   268 void  NmMessageListViewItem::setFontsRead()
   253 void  NmMessageListViewItem::setFontsRead()
   269 {
   254 {
   270     NM_FUNCTION;
   255     NM_FUNCTION;
   271     
   256     
   272     static QColor colorRole = HbColorScheme::color("qtc_list_item_content_normal");
   257     static QColor colorRole = HbColorScheme::color("qtc_list_item_content_normal");
   273     HbFontSpec spekki(HbFontSpec::Secondary);
   258     HbFontSpec fontSpec(HbFontSpec::Secondary);
   274     setFonts(colorRole, spekki);
   259     setFonts(colorRole, fontSpec);
   275 }
   260 }
   276 
   261 
   277 /*!
   262 /*!
   278     getFontSizes.
   263     getFontSizes.
   279 */
   264 */
   281 {
   266 {
   282     NM_FUNCTION;
   267     NM_FUNCTION;
   283     
   268     
   284     // Get font sizes from style  
   269     // Get font sizes from style  
   285     qreal currentSize;
   270     qreal currentSize;
   286     HbStyle mystyle;
   271     bool found = style()->parameter(QString("hb-param-text-height-primary"), currentSize );
   287     bool found = mystyle.parameter(QString("hb-param-text-height-primary"), currentSize );
       
   288     if (found) {
   272     if (found) {
   289         mPrimarySize = currentSize;
   273         mPrimarySize = currentSize;
   290     }      
   274     }      
   291     found = mystyle.parameter(QString("hb-param-text-height-secondary"), currentSize );
   275     found = style()->parameter(QString("hb-param-text-height-secondary"), currentSize );
   292     if (found) {
   276     if (found) {
   293         mSecondarySize = currentSize;
   277         mSecondarySize = currentSize;
   294     }        
   278     }        
   295     found = mystyle.parameter(QString("hb-param-text-height-tiny"), currentSize );
   279     found = style()->parameter(QString("hb-param-text-height-tiny"), currentSize );
   296     if (found) {
   280     if (found) {
   297         mTinySize = currentSize;
   281         mTinySize = currentSize;
   298     } 
   282     } 
   299 }
   283 }
   300 
   284 
   301 /*!
   285 /*!
   302     setFonts.
   286     setFonts.
   303 */
   287 */
   304 void  NmMessageListViewItem::setFonts(const QColor &colorRole, 
   288 void  NmMessageListViewItem::setFonts(const QColor &colorRole, 
   305         HbFontSpec &spekki)
   289         HbFontSpec &fontSpec)
   306 {
   290 {
   307     NM_FUNCTION;
   291     NM_FUNCTION;
   308     
   292     
   309     // Change sizes explicitly since css is overwritten in polish now.    
   293     // Change sizes explicitly since css is overwritten in polish now.    
   310     if (mSender && mSubject && mTime) {
   294     if (mSender && mSubject && mTime) {
   311         
   295         
   312         if (mPrimarySize) {
   296         if (mPrimarySize) {
   313             spekki.setTextHeight(mPrimarySize);
   297             fontSpec.setTextHeight(mPrimarySize);
   314         }      
   298         }      
   315         mSender->setFontSpec(spekki);
   299         mSender->setFontSpec(fontSpec);
   316         mSender->setTextColor(colorRole);
   300         mSender->setTextColor(colorRole);
   317         
   301         
   318         if (mSecondarySize) {
   302         if (mSecondarySize) {
   319             spekki.setTextHeight(mSecondarySize);
   303             fontSpec.setTextHeight(mSecondarySize);
   320         }        
   304         }        
   321         mSubject->setFontSpec(spekki);
   305         mSubject->setFontSpec(fontSpec);
   322         mSubject->setTextColor(colorRole);
   306         mSubject->setTextColor(colorRole);
   323 
   307 
   324         if (mTinySize) {
   308         if (mTinySize) {
   325             spekki.setTextHeight(mTinySize);
   309             fontSpec.setTextHeight(mTinySize);
   326         } 
   310         } 
   327         mTime->setFontSpec(spekki);        
   311         mTime->setFontSpec(fontSpec);        
   328         mTime->setTextColor(colorRole);
   312         mTime->setTextColor(colorRole);
   329     }
   313     }
   330 }
   314 }
   331 
   315 
   332 /*!
   316 /*!