Merge branch 'master' into new_panels_with_context_buttons
[situare] / src / ui / routingpanel.cpp
index f730136..017c10e 100644 (file)
@@ -2,6 +2,7 @@
 #include "locationlistitem.h"
 #include "locationlistview.h"
 #include "extendedlistitemdelegate.h"
+#include "imagebutton.h"
 #include "routing/location.h"
 #include "routing/route.h"
 #include "routewaypointlistview.h"
@@ -11,7 +12,7 @@
 #include "routingpanel.h"
 
 RoutingPanel::RoutingPanel(QWidget *parent)
-    : QWidget(parent)
+    : PanelBase(parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
@@ -28,7 +29,10 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     listViewLayout->setContentsMargins(PANEL_MARGIN_LEFT, PANEL_MARGIN_TOP,
                                        PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
 
-    m_searchLocationButton = new QPushButton(tr("Search location"));
+    ImageButton *searchLocationButton = new ImageButton(0, ":/res/images/search.png",
+                                                             ":/res/images/search_s.png");
+
+    m_contextButtonList.append(searchLocationButton);
 
     m_routeButton = new QPushButton(tr("Route to location"));
     m_routeButton->setDisabled(true);
@@ -57,7 +61,6 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     listViewLayout->addWidget(m_locationListView);
     listViewLayout->addWidget(m_routeWaypointListView);
 
-    routingLayout->addWidget(m_searchLocationButton);
     routingLayout->addWidget(m_routeButton);
     routingLayout->addWidget(m_locationListHeaderWidget);
     routingLayout->addLayout(listViewLayout);
@@ -76,7 +79,7 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     connect(m_routeButton, SIGNAL(clicked()),
             this, SLOT(routeToSelectedLocation()));
 
-    connect(m_searchLocationButton, SIGNAL(clicked()),
+    connect(searchLocationButton, SIGNAL(clicked()),
             this, SIGNAL(requestSearchLocation()));
 }