m_drawOwnLocationCrosshair(false),
m_loggedIn(false),
m_refresh(false),
+ m_ownLocationCrosshair(0),
m_email(),
m_password(),
+ m_fullScreenButton(0),
m_webView(0),
m_cookieJar(0)
{
// set stacking order of widgets
m_zoomButtonPanel->stackUnder(m_userPanel);
- m_osmLicense->stackUnder(m_zoomButtonPanel);
+ if(m_fullScreenButton) {
+ m_fullScreenButton->stackUnder(m_zoomButtonPanel);
+ m_osmLicense->stackUnder(m_fullScreenButton);
+ } else
+ m_osmLicense->stackUnder(m_zoomButtonPanel);
m_ownLocationCrosshair->stackUnder(m_osmLicense);
m_mapView->stackUnder(m_ownLocationCrosshair);
delete m_webView;
}
+void MainWindow::buildFullScreenButton()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+#ifdef Q_WS_MAEMO_5
+ m_fullScreenButton = new QToolButton(this);
+ m_fullScreenButton->setIcon(QIcon::fromTheme(QLatin1String("general_fullsize")));
+ m_fullScreenButton->setFixedSize(m_fullScreenButton->sizeHint());
+ connect(m_fullScreenButton, SIGNAL(clicked()),
+ this, SLOT(toggleFullScreen()));
+#endif // Q_WS_MAEMO_5
+
+}
+
void MainWindow::buildFriendListPanel()
{
qDebug() << __PRETTY_FUNCTION__;
m_mapView = new MapView(this);
buildZoomButtonPanel();
-
- m_ownLocationCrosshair = 0;
buildOsmLicense();
buildManualLocationCrosshair();
+ buildFullScreenButton();
connect(m_mapView, SIGNAL(viewScrolled(QPoint)),
this, SIGNAL(mapViewScrolled(QPoint)));
connect(m_mapView, SIGNAL(viewResized(QSize)),
this, SIGNAL(mapViewResized(QSize)));
+ connect(m_mapView, SIGNAL(viewResized(QSize)),
+ this, SLOT(drawFullScreenButton(QSize)));
+
connect(m_mapView, SIGNAL(viewResizedNewSize(int, int)),
this, SLOT(setViewPortSize(int, int)));
m_viewMenu->setObjectName(tr("Menu"));
}
+void MainWindow::drawFullScreenButton(const QSize &size)
+{
+ qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height();
+
+ if(m_fullScreenButton) {
+ m_fullScreenButton->move(size.width() - m_fullScreenButton->size().width()
+ - PANEL_PEEK_AMOUNT,
+ size.height() - m_fullScreenButton->size().height());
+ }
+}
+
void MainWindow::drawOsmLicense(const QSize &size)
{
qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height();
m_osmLicense->move(size.width() - m_osmLicense->fontMetrics().width(OSM_LICENSE)
- PANEL_PEEK_AMOUNT,
size.height() - m_osmLicense->fontMetrics().height());
-
}
void MainWindow::drawOwnLocationCrosshair(int width, int height)
#endif
}
+void MainWindow::toggleFullScreen()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ if(windowState() == Qt::WindowNoState)
+ showFullScreen();
+ else
+ showNormal();
+}
+
void MainWindow::startLoginProcess(const QUrl &url)
{
qDebug() << __PRETTY_FUNCTION__;
class UserInfoPanel;
class ZoomButtonPanel;
class SettingsDialog;
+class QToolButton;
/**
* @brief Main Window Class
private:
/**
+ * @brief Build fullscreen toggle button and connect slots
+ */
+ void buildFullScreenButton();
+
+ /**
* @brief Build friend list panel and connect slots
*/
void buildFriendListPanel();
private slots:
/**
+ * @brief Slot for drawing the fullscreen toggle button
+ *
+ * @param size Size of the screen
+ */
+ void drawFullScreenButton(const QSize &size);
+
+ /**
* @brief Slot for drawing the Open Street Map license text
*
* @param size Size of the screen
*/
void setViewPortSize(const int width, const int height);
+ /**
+ * @brief Toggle between fullscreen and normal window mode
+ */
+ void toggleFullScreen();
+
/*******************************************************************************
* SIGNALS
******************************************************************************/
QString m_email; ///< Placeholder for email
QString m_password; ///< Placeholder for password
+ QToolButton *m_fullScreenButton; ///< Instance of the fullscreen toggle button
+
QWebView *m_webView; ///< Shows facebook login page
FriendListPanel *m_friendsListPanel; ///< Instance of friends list panel