m_osmLicense->resize(m_osmLicense->fontMetrics().width(OSM_LICENSE),
m_osmLicense->fontMetrics().height());
++ m_ownLocationCrosshair = new QLabel(this);
++ QPixmap crosshairImage(":/res/images/sight.png");
++ m_ownLocationCrosshair->setPixmap(crosshairImage);
++ m_ownLocationCrosshair->setFixedSize(crosshairImage.size());
++
m_friendsListPanel->stackUnder(friendsListPanelSidebar);
userPanelSidebar->stackUnder(m_friendsListPanel);
m_userPanel->stackUnder(userPanelSidebar);
m_zoomButtonPanel->stackUnder(m_userPanel);
m_osmLicense->stackUnder(m_zoomButtonPanel);
-- mapView->stackUnder(m_osmLicense);
++ m_ownLocationCrosshair->stackUnder(m_osmLicense);
++ mapView->stackUnder(m_ownLocationCrosshair);
mapViewLayout->addWidget(mapView);
setLayout(mapViewLayout);
height - m_osmLicense->fontMetrics().height());
}
+
+void MapViewScreen::drawOwnLocationCrosshair(int width, int height)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ if (m_drawOwnLocationCrosshair) {
+ m_ownLocationCrosshair->move(width/2 - m_ownLocationCrosshair->pixmap()->width()/2,
+ height/2 - m_ownLocationCrosshair->pixmap()->height()/2);
+ }
+}
+
+void MapViewScreen::setOwnLocationCrosshairVisibility(bool visibility)
+{
+ if (visibility == false) {
+
+ if (m_ownLocationCrosshair == 0) {
- m_ownLocationCrosshair = new QLabel(this);
- QPixmap crosshairImage(":/res/images/sight.png");
- m_ownLocationCrosshair->setPixmap(crosshairImage);
- m_ownLocationCrosshair->setFixedSize(crosshairImage.size());
++
+ }
+
+ m_ownLocationCrosshair->show();
+ m_drawOwnLocationCrosshair = true;
+ drawOwnLocationCrosshair(m_viewPortWidth, m_viewPortHeight);
+ }
+
+ else {
+ m_ownLocationCrosshair->hide();
+ m_drawOwnLocationCrosshair = false;
+ }
+}
+
+void MapViewScreen::setViewPortSize(int width, int height)
+{
+ m_viewPortWidth = width;
+ m_viewPortHeight = height;
+}
: QWidget(parent)
{
qDebug() << __PRETTY_FUNCTION__;
+
m_userPanelVBox = new QVBoxLayout(this);
+ m_userPanelVBox->setMargin(0);
+ m_userPanelVBox->setContentsMargins(SLIDINGBAR_WIDTH+1, 0, SIDEBAR_WIDTH, 0);
+ m_userPanelVBox->setSpacing(0);
- setLayout(m_userPanelVBox);
+
+ m_userInfo = new UserInfo(this);
+ m_userPanelVBox->addWidget(m_userInfo, 0, Qt::AlignCenter);
+
- setAutoFillBackground(true);
+ m_panelBase = new QWidget(this);
+ m_panelBase->setLayout(m_userPanelVBox);
+ m_panelBase->move(TOP_CORNER_X,PANEL_TOP_Y);
+ m_panelBase->resize(USERPANEL_WIDTH, USERPANEL_HEIGHT);
+
QPalette pal = palette();
pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
- setPalette(pal);
+ m_panelBase->setPalette(pal);
+ m_panelBase->setAutoFillBackground(true);
PanelSliderBar *m_userPanelSlidingBar = new PanelSliderBar(this, LEFT);
m_userPanelSlidingBar->move(USERPANEL_WIDTH - SLIDINGBAR_WIDTH, PANEL_TOP_Y);
{
qDebug() << __PRETTY_FUNCTION__;
Q_UNUSED(width);
- resize(USERPANEL_WIDTH,height + MARGIN_CORRECTION);
++ m_panelBase->resize(USERPANEL_WIDTH, height + MARGIN_CORRECTION);
+ resize(USERPANEL_WIDTH + SLIDINGBAR_WIDTH,height + MARGIN_CORRECTION);
}