From: Jussi Laitinen Date: Mon, 17 May 2010 10:37:23 +0000 (+0300) Subject: Modified FriendGroupItem paint event. Changed friend_group.png image. X-Git-Tag: v0.4~13^2 X-Git-Url: http://git.maemo.org/git/?p=situare;a=commitdiff_plain;h=fc42b672a8d969a96456a834c055cd28bc8b39e1 Modified FriendGroupItem paint event. Changed friend_group.png image. --- diff --git a/images.qrc b/images.qrc index 067614e..6d7adaf 100644 --- a/images.qrc +++ b/images.qrc @@ -21,10 +21,10 @@ res/images/sliding_bar_right.png res/images/led_red.png res/images/led_red_s.png - res/images/friend_group.png res/images/list_item.png res/images/list_item_bottom.png res/images/list_item_middle.png res/images/list_item_top.png + res/images/friend_group.png diff --git a/res/images/friend_group.png b/res/images/friend_group.png index 9b8aec7..3d555c6 100644 Binary files a/res/images/friend_group.png and b/res/images/friend_group.png differ diff --git a/src/common.h b/src/common.h index 89b7ea0..9c295f1 100644 --- a/src/common.h +++ b/src/common.h @@ -23,9 +23,15 @@ #define COMMON_H #include +#include +#include // 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 diff --git a/src/map/friendgroupitem.cpp b/src/map/friendgroupitem.cpp index d64558d..bdc3a96 100644 --- a/src/map/friendgroupitem.cpp +++ b/src/map/friendgroupitem.cpp @@ -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())); } diff --git a/src/map/mapcommon.h b/src/map/mapcommon.h index b8349cb..06f26f7 100644 --- a/src/map/mapcommon.h +++ b/src/map/mapcommon.h @@ -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 diff --git a/src/ui/friendlistitem.cpp b/src/ui/friendlistitem.cpp index 7eae647..60c82e2 100644 --- a/src/ui/friendlistitem.cpp +++ b/src/ui/friendlistitem.cpp @@ -34,12 +34,10 @@ #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