friendListScroll->setWidgetResizable(true);
friendListScroll->viewport()->setAutoFillBackground(false);
- m_friendsPanelVBox->addWidget(friendListScroll);
+// this->setAutoFillBackground(true);
- this->resize(420,600);
+ m_friendsPanelVBox->addWidget(friendListScroll);
m_friendsPanelStateMachine = new QStateMachine(this);
m_friendsPanelStateClosed = new QState(m_friendsPanelStateMachine);
- m_friendsPanelStateClosed->assignProperty(this, "pos", QPoint(800,0));
+ m_friendsPanelStateClosed->assignProperty(this, "pos", QPoint(800, 0));
m_friendsPanelStateMachine->setInitialState(m_friendsPanelStateClosed);
m_friendsPanelStateOpened = new QState(m_friendsPanelStateMachine);
- m_friendsPanelStateOpened->assignProperty(this, "pos", QPoint(400,0));
+ m_friendsPanelStateOpened->assignProperty(this, "pos", QPoint(400, 0));
m_friendsPanelTransitionOpen = m_friendsPanelStateClosed->addTransition(
m_friendsPanelExpandButton, SIGNAL(clicked()), m_friendsPanelStateOpened);
void FriendListPanel::reDrawFriendsPanel(int width, int height)
{
qDebug() << __PRETTY_FUNCTION__;
+ this->resize(420,height+1);
+ m_friendsPanelStateClosed->assignProperty(this, "pos", QPoint(width-50, 0));
+ m_friendsPanelStateOpened->assignProperty(this, "pos", QPoint(width-419, 0));
+ this->move(width-50,0);
}
mapEngine = new MapEngine(this);
mapView->setScene(mapEngine->scene());
+ FriendListPanel *friendsListPanel = new FriendListPanel(this);
+ UserInfoPanel *userPanel = new UserInfoPanel(this);
+
connect(mapView, SIGNAL(viewScrolled(QPoint)),
mapEngine, SLOT(setLocation(QPoint)));
connect(mapEngine, SIGNAL(locationChanged(QPoint)),
mapEngine, SLOT(alignImmovableItems(QPoint)));
connect(mapView, SIGNAL(viewZoomFinished()),
mapEngine, SLOT(viewZoomFinished()));
+
connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
this, SLOT(drawOsmLicense(int, int)));
+ connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
+ friendsListPanel, SLOT(reDrawFriendsPanel(int,int)));
+ connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
+ userPanel, SLOT(reDrawUserPanel(int,int)));
+
+ connect(this, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)),
+ friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
+
QHBoxLayout *mapViewLayout = new QHBoxLayout;
//DEBUG
// connect(zoomOut, SIGNAL(clicked()), mapEngine, SLOT(zoomOut()));
//DEBUG
- FriendListPanel *friendsListPanel = new FriendListPanel(this);
- UserInfoPanel *userPanel = new UserInfoPanel(this);
-
- connect(this, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)),
- friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
-
osmLicense = new QLabel(this);
osmLicense->setAttribute(Qt::WA_TranslucentBackground, true);
osmLicense->setAttribute(Qt::WA_TransparentForMouseEvents, true);
osmLicense->resize(osmLicense->fontMetrics().width(OSM_LICENSE),
osmLicense->fontMetrics().height());
- osmLicense->stackUnder(friendsListPanel);
+ userPanel->stackUnder(friendsListPanel);
+ osmLicense->stackUnder(userPanel);
mapView->stackUnder(osmLicense);
mapViewLayout->addWidget(mapView);
void MapViewScreen::drawOsmLicense(int width, int height)
{
- qDebug() << __PRETTY_FUNCTION__ << width << "x" << height;
+ qWarning() << __PRETTY_FUNCTION__ << width << "x" << height;
osmLicense->move(width-osmLicense->fontMetrics().width(OSM_LICENSE),
height-osmLicense->fontMetrics().height());
}
m_userPanelVBox->addWidget(m_userPanelExpandButton);
m_userPanelVBox->addWidget(m_userPanelLabel);
-// m_userPanelSize = new QSize(300,600);
-// m_userPanelCoordinatesClosed = new QPoint(-250,0);
-// m_userPanelCoordinatesOpen = new QPoint(0,0);
-
- this->resize(300,600);
+ this->setAutoFillBackground(true);
+// this->setAttribute(Qt::WA_TranslucentBackground);
+// this->setWindowOpacity(0.5); //DEFUNCT
m_userPanelStateMachine = new QStateMachine(this);
m_userPanelStateClosed = new QState(m_userPanelStateMachine);
void UserInfoPanel::reDrawUserPanel(int width, int height)
{
qDebug() << __PRETTY_FUNCTION__;
+ Q_UNUSED(width);
+ this->resize(300,height+1);
}