src/gui/styles/qs60style_s60.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 5 d3bac044e0f0
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
   907         newSkinId.Set(m_partMap[(int)part].skinID);
   907         newSkinId.Set(m_partMap[(int)part].skinID);
   908     return newSkinId;
   908     return newSkinId;
   909 }
   909 }
   910 
   910 
   911 QFont QS60StylePrivate::s60Font_specific(
   911 QFont QS60StylePrivate::s60Font_specific(
   912     QS60StyleEnums::FontCategories fontCategory, int pointSize)
   912     QS60StyleEnums::FontCategories fontCategory,
   913 {
   913     int pointSize, bool resolveFontSize)
       
   914 {
       
   915     Q_UNUSED(resolveFontSize);
       
   916 
   914     TAknFontCategory aknFontCategory = EAknFontCategoryUndefined;
   917     TAknFontCategory aknFontCategory = EAknFontCategoryUndefined;
   915     switch (fontCategory) {
   918     switch (fontCategory) {
   916         case QS60StyleEnums::FC_Primary:
   919         case QS60StyleEnums::FC_Primary:
   917             aknFontCategory = EAknFontCategoryPrimary;
   920             aknFontCategory = EAknFontCategoryPrimary;
   918             break;
   921             break;
  1131     return result;
  1134     return result;
  1132 }
  1135 }
  1133 
  1136 
  1134 QPixmap QS60StylePrivate::backgroundTexture()
  1137 QPixmap QS60StylePrivate::backgroundTexture()
  1135 {
  1138 {
       
  1139     bool createNewBackground = false;
  1136     if (!m_background) {
  1140     if (!m_background) {
       
  1141         createNewBackground = true;
       
  1142     } else {
       
  1143         //if background brush does not match screensize, re-create it
       
  1144         if (m_background->width() != S60->screenWidthInPixels ||
       
  1145             m_background->height() != S60->screenHeightInPixels) {
       
  1146             delete m_background;
       
  1147             createNewBackground = true;
       
  1148         }
       
  1149     }
       
  1150 
       
  1151     if (createNewBackground) {
  1137         QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen,
  1152         QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen,
  1138                 QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), 0, SkinElementFlags());
  1153             QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), 0, SkinElementFlags());
  1139         m_background = new QPixmap(background);
  1154         m_background = new QPixmap(background);
  1140     }
  1155     }
  1141     return *m_background;
  1156     return *m_background;
  1142 }
  1157 }
  1143 
  1158 
  1144 QSize QS60StylePrivate::screenSize()
  1159 QSize QS60StylePrivate::screenSize()
  1145 {
  1160 {
  1146     const TSize screenSize = QS60Data::screenDevice()->SizeInPixels();
  1161     return QSize(S60->screenWidthInPixels, S60->screenHeightInPixels);
  1147     return QSize(screenSize.iWidth, screenSize.iHeight);
       
  1148 }
  1162 }
  1149 
  1163 
  1150 QS60Style::QS60Style()
  1164 QS60Style::QS60Style()
  1151     : QCommonStyle(*new QS60StylePrivate)
  1165     : QCommonStyle(*new QS60StylePrivate)
  1152 {
  1166 {