Added show_position images to res/images and images.qrc.
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Mon, 10 May 2010 13:22:10 +0000 (16:22 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Mon, 10 May 2010 13:22:10 +0000 (16:22 +0300)
res/images/show_position.png [new file with mode: 0755]
res/images/show_position_s.png [new file with mode: 0755]
src/src.pro
src/ui/friendlistitem.cpp
src/ui/friendlistpanel.cpp

diff --git a/res/images/show_position.png b/res/images/show_position.png
new file mode 100755 (executable)
index 0000000..fcc4dcf
Binary files /dev/null and b/res/images/show_position.png differ
diff --git a/res/images/show_position_s.png b/res/images/show_position_s.png
new file mode 100755 (executable)
index 0000000..96a99f8
Binary files /dev/null and b/res/images/show_position_s.png differ
index 373d872..923b96f 100644 (file)
@@ -84,7 +84,7 @@ HEADERS += ui/mainwindow.h \
 QT += network \
     webkit
 
-#DEFINES += QT_NO_DEBUG_OUTPUT
+DEFINES += QT_NO_DEBUG_OUTPUT
 
 !maemo5 {
     message(QJson built in)
index 26361b2..032626f 100644 (file)
@@ -128,19 +128,17 @@ void FriendListItem::setData(User *user)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if (user) {
-        m_user = user;
+    m_user = user;
 
-        m_imageLabel->setPixmap(AvatarImage::create(m_user->profileImage()));
+    m_imageLabel->setPixmap(AvatarImage::create(m_user->profileImage()));
 
-        QString unit;
-        double value;
-        user->distance(value, unit);
-        m_distanceLabel->setText(QString::number(value) + " " + unit);
+    QString unit;
+    double value;
+    user->distance(value, unit);
+    m_distanceLabel->setText(QString::number(value) + " " + unit);
 
-        shortenTexts();
-        setText(false);
-    }
+    shortenTexts();
+    setText(false);
 }
 
 void FriendListItem::shortenTexts()
@@ -238,10 +236,10 @@ void FriendListItem::paintEvent(QPaintEvent *event)
 
     QPainter painter(this);
 
-    QRect topRect = QRect(0, 0, event->rect().width(), BACKGROUND_TOP_HEIGHT);
-    QRect middleRect = QRect(0, topRect.bottom(), event->rect().width(),
+    QRect topRect = QRect(0, 0, ITEM_MIN_WIDTH, BACKGROUND_TOP_HEIGHT);
+    QRect middleRect = QRect(0, topRect.bottom(), ITEM_MIN_WIDTH,
                              height() - BACKGROUND_TOP_HEIGHT - BACKGROUND_BOTTOM_HEIGHT);
-    QRect bottomRect = QRect(topRect.left(), middleRect.bottom(), event->rect().width(),
+    QRect bottomRect = QRect(topRect.left(), middleRect.bottom(), ITEM_MIN_WIDTH,
                              BACKGROUND_BOTTOM_HEIGHT);
 
     painter.drawPixmap(topRect, m_backgroundTopImage);
index 8ec73a1..7378d12 100644 (file)
@@ -31,7 +31,7 @@ FriendListPanel::FriendListPanel(QWidget *parent)
     qDebug() << __PRETTY_FUNCTION__;
     m_friendsPanelVBox = new QVBoxLayout(this);
     m_friendsPanelVBox->setMargin(0);
-    m_friendsPanelVBox->setContentsMargins(SLIDINGBAR_WIDTH, 0, SIDEBAR_WIDTH, 0);
+    m_friendsPanelVBox->setContentsMargins(SLIDINGBAR_WIDTH+1, 0, SIDEBAR_WIDTH, 0);
     m_friendsPanelVBox->setSpacing(0);
     setLayout(m_friendsPanelVBox);