Modified FriendGroupItem paint event. Changed friend_group.png image.
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Mon, 17 May 2010 10:37:23 +0000 (13:37 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Mon, 17 May 2010 10:37:23 +0000 (13:37 +0300)
images.qrc
res/images/friend_group.png
src/common.h
src/map/friendgroupitem.cpp
src/map/mapcommon.h
src/ui/friendlistitem.cpp

index 067614e..6d7adaf 100644 (file)
         <file>res/images/sliding_bar_right.png</file>
         <file>res/images/led_red.png</file>
         <file>res/images/led_red_s.png</file>
-        <file>res/images/friend_group.png</file>
         <file>res/images/list_item.png</file>
         <file>res/images/list_item_bottom.png</file>
         <file>res/images/list_item_middle.png</file>
         <file>res/images/list_item_top.png</file>
+        <file>res/images/friend_group.png</file>
     </qresource>
 </RCC>
index 9b8aec7..3d555c6 100644 (file)
Binary files a/res/images/friend_group.png and b/res/images/friend_group.png differ
index 89b7ea0..9c295f1 100644 (file)
 #define COMMON_H
 
 #include <QString>
+#include <QColor>
+#include <QFont>
 
 // QSettings identifiers
 const QString DIRECTORY_NAME = "Ixonos";
 const QString FILE_NAME = "Situare";
 
+const QColor COLOR_GRAY = QColor(152, 152, 152);                           ///< Gray color
+const QFont NOKIA_FONT_NORMAL = QFont("Nokia Sans", 18, QFont::Normal);    ///< Normal font
+const QFont NOKIA_FONT_SMALL = QFont("Nokia Sans", 13, QFont::Normal);     ///< Small font
+
 #endif // COMMON_H
index d64558d..bdc3a96 100644 (file)
@@ -26,8 +26,8 @@
 
 #include "friendlocationitem.h"
 #include "mapcommon.h"
-
 #include "friendgroupitem.h"
+#include "common.h"
 
 FriendGroupItem::FriendGroupItem(FriendLocationItem *item)
 {
@@ -97,8 +97,9 @@ void FriendGroupItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
 
     BaseLocationItem::paint(painter, option, widget);
 
-    QFont font = painter->font();
-    font.setPointSize(painter->font().pointSize() * 2); // double default font size
-    painter->setFont(font);
-    painter->drawText(boundingRect(), Qt::AlignCenter, QString::number(m_friends.count()));
+    painter->setPen(Qt::black);
+    painter->setFont(NOKIA_FONT_SMALL);
+    painter->drawText(QRect(GROUP_ITEM_FRIENDS_COUNT_X, GROUP_ITEM_FRIENDS_COUNT_Y,
+                            GROUP_ITEM_FRIENDS_COUNT_WIDTH, GROUP_ITEM_FRIENDS_COUNT_HEIGHT),
+                      Qt::AlignCenter, QString::number(m_friends.count()));
 }
index b8349cb..06f26f7 100644 (file)
@@ -39,6 +39,11 @@ const int MIN_MAP_SCENE_NORMAL_LEVEL = MAX_MAP_ZOOM_LEVEL + 1;
 */
 const int FRIEND_LOCATION_ICON_Z_LEVEL = MIN_MAP_SCENE_NORMAL_LEVEL + MAX_MAP_ZOOM_LEVEL + 1;
 
+const int GROUP_ITEM_FRIENDS_COUNT_X = 13;  ///< Group item friends count x value
+const int GROUP_ITEM_FRIENDS_COUNT_Y = 13;  ///< Group item friends count y value
+const int GROUP_ITEM_FRIENDS_COUNT_WIDTH = 17;  ///< Group item friends count width value
+const int GROUP_ITEM_FRIENDS_COUNT_HEIGHT = 17; ///< Group item friends count height value
+
 /**
 * @var OWN_LOCATION_ICON_Z_LEVEL
 * @brief layer of own location icon
index 7eae647..60c82e2 100644 (file)
 #include "friendlistitem.h"
 #include "../user/user.h"
 #include "imagebutton.h"
+#include "common.h"
 
 const int BACKGROUND_TOP_HEIGHT = 20;
 const int BACKGROUND_BOTTOM_HEIGHT = 15;
-const QColor COLOR_GRAY = QColor(152, 152, 152);    ///< Gray color
-const QFont NOKIA_FONT_NORMAL = QFont("Nokia Sans", 18, QFont::Normal);    ///< Normal font
-const QFont NOKIA_FONT_SMALL = QFont("Nokia Sans", 13, QFont::Normal);     ///< Small font
 const int ICON_HEIGHT = 24;     ///< Icon height
 const int ICON_WIDTH = 24;       ///< Icon width
 const int IMAGE_HEIGHT = 60; ///< Friend image height