QVBoxLayout *friendListPanelLayout = new QVBoxLayout();
friendListPanelLayout->setMargin(0);
friendListPanelLayout->setSpacing(0);
- friendListPanelLayout->setContentsMargins(PANEL_MARGIN_LEFT, 0, PANEL_MARGIN_RIGHT, 0);
setLayout(friendListPanelLayout);
QHBoxLayout *filterLayout = new QHBoxLayout();
m_friendListView = new FriendListView(this);
m_friendListView->setItemDelegate(new FriendListItemDelegate(this));
+ QVBoxLayout *listViewLayout = new QVBoxLayout;
+ listViewLayout->setContentsMargins(PANEL_MARGIN_LEFT, 0, PANEL_MARGIN_RIGHT, 0);
+ listViewLayout->addWidget(m_friendListView);
+
friendListPanelLayout->addWidget(m_friendListHeaderWidget);
- friendListPanelLayout->addWidget(m_friendListView);
+ friendListPanelLayout->addLayout(listViewLayout);
connect(m_friendListView, SIGNAL(friendItemClicked(GeoCoordinate)),
this, SIGNAL(findFriend(GeoCoordinate)));
qDebug() << __PRETTY_FUNCTION__;
QVBoxLayout *routingLayout = new QVBoxLayout;
- routingLayout->setContentsMargins(PANEL_MARGIN_LEFT, 0, PANEL_MARGIN_RIGHT, 0);
+ routingLayout->setMargin(0);
+ routingLayout->setSpacing(0);
setLayout(routingLayout);
+ QHBoxLayout *headerLayout = new QHBoxLayout();
+ headerLayout->setContentsMargins(FRIENDPANEL_FILTER_MARGIN_LEFT, 0,
+ FRIENDPANEL_FILTER_MARGIN_RIGHT, 0);
+
+ QVBoxLayout *listViewLayout = new QVBoxLayout;
+ listViewLayout->setContentsMargins(PANEL_MARGIN_LEFT, 0, PANEL_MARGIN_RIGHT, 0);
+
+ m_locationListHeaderWidget = new QWidget();
+ m_locationListHeaderWidget->setLayout(headerLayout);
+ m_locationListHeaderWidget->setAutoFillBackground(true);
+ QPalette labelPalette = m_locationListHeaderWidget->palette();
+ labelPalette.setColor(QPalette::Background, Qt::black);
+ m_locationListHeaderWidget->setPalette(labelPalette);
+ m_locationListHeaderWidget->hide();
+
+ m_locationListLabel = new QLabel(this);
+
m_locationListView = new LocationListView(this);
m_locationListView->setItemDelegate(new ExtendedListItemDelegate(this));
- routingLayout->addWidget(m_locationListView);
+
+ headerLayout->addWidget(m_locationListLabel, 0, Qt::AlignCenter);
+
+ listViewLayout->addWidget(m_locationListView);
+
+ routingLayout->addWidget(m_locationListHeaderWidget);
+ routingLayout->addLayout(listViewLayout);
connect(m_locationListView, SIGNAL(locationItemClicked(GeoCoordinate&,GeoCoordinate&)),
this, SIGNAL(locationItemClicked(GeoCoordinate&,GeoCoordinate&)));
{
qDebug() << __PRETTY_FUNCTION__;
+ m_locationListHeaderWidget->show();
+ m_locationListLabel->setText(tr("Search results: %1").arg(locations.count()));
+
m_locationListView->clearList();
for (int i = 0; i < locations.size(); ++i) {