Moved context buttons of friend list to context button area
authorSami Rämö <sami.ramo@ixonos.com>
Thu, 19 Aug 2010 11:56:23 +0000 (14:56 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Thu, 19 Aug 2010 11:56:23 +0000 (14:56 +0300)
src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h

index fe7acfa..5e5e802 100644 (file)
@@ -32,6 +32,7 @@
 #include "friendlistitem.h"
 #include "friendlistitemdelegate.h"
 #include "friendlistview.h"
+#include "imagebutton.h"
 #include "panelcommon.h"
 #include "user/user.h"
 
@@ -62,7 +63,7 @@ FriendListPanel::FriendListPanel(QWidget *parent)
     m_friendListHeaderWidget->setLayout(filterLayout);
     m_friendListHeaderWidget->setAutoFillBackground(true);
 
-    m_routeButton = new QPushButton(tr("Route to friend"));
+    m_routeButton = new ImageButton(this, ":res/images/routing.png", ":res/images/routing.png");
     m_routeButton->setDisabled(true);
 
     QPalette labelPalette = m_friendListHeaderWidget->palette();
@@ -71,10 +72,11 @@ FriendListPanel::FriendListPanel(QWidget *parent)
     m_friendListHeaderWidget->setPalette(labelPalette);
     m_friendListHeaderWidget->hide();
     m_friendListLabel = new QLabel(this);
-    m_clearFilterButton = new QPushButton(tr("Show all"));
+    ImageButton *clearFilterButton = new ImageButton(this, ":res/images/friend_list.png",
+                                                     ":res/images/friend_list.png");
 
     filterLayout->addWidget(m_friendListLabel);
-    filterLayout->addWidget(m_clearFilterButton);
+    filterLayout->addWidget(clearFilterButton);
 
     m_friendListView = new FriendListView(this);
     m_friendListView->setItemDelegate(new FriendListItemDelegate(this));
@@ -91,7 +93,7 @@ FriendListPanel::FriendListPanel(QWidget *parent)
     connect(m_friendListView, SIGNAL(friendItemClicked(GeoCoordinate)),
             this, SIGNAL(findFriend(GeoCoordinate)));
 
-    connect(m_clearFilterButton, SIGNAL(clicked()),
+    connect(clearFilterButton, SIGNAL(clicked()),
             this, SLOT(clearFiltering()));
 
     connect(m_routeButton, SIGNAL(clicked()),
@@ -130,6 +132,11 @@ FriendListPanel::FriendListPanel(QWidget *parent)
 
     connect(qApp, SIGNAL(topmostWindowChanged(bool)),
             this, SLOT(topmostWindowChanged(bool)));
+
+
+    // CONTEXT BUTTONS
+    m_contextButtonList.append(m_routeButton);
+    m_contextButtonList.append(clearFilterButton);
 }
 
 void FriendListPanel::anyPanelClosed()
index e8fbda1..5fea3b7 100644 (file)
@@ -33,8 +33,9 @@ class QLineEdit;
 class QPushButton;
 
 class FriendListItemDelegate;
-class GeoCoordinate;
 class FriendListView;
+class GeoCoordinate;
+class ImageButton;
 class User;
 
 /**
@@ -220,13 +221,12 @@ private:
 
     QLineEdit *m_filterField;           ///< Text field for the filter text
 
-    QPushButton *m_clearFilterButton;   ///< Button to clear list filtering
     QPushButton *m_filterClearButton;   ///< Button for clearing the filtering
-    QPushButton *m_routeButton;         ///< Button to route to friend
 
     QWidget *m_friendListHeaderWidget;  ///< Friend list header widget
 
     FriendListView *m_friendListView;   ///< Friend list view
+    ImageButton *m_routeButton;         ///< Button to route to friend
 };
 
 #endif // FRIENDLISTPANEL_H