Pre-merge. Also change drawOsmLicense to use QSize
authorKaj Wallin <kaj.wallin@ixonos.com>
Fri, 21 May 2010 12:17:53 +0000 (15:17 +0300)
committerKaj Wallin <kaj.wallin@ixonos.com>
Fri, 21 May 2010 12:17:53 +0000 (15:17 +0300)
Reviewed by: Jussi Laitinen

src/ui/mainwindow.cpp
src/ui/mainwindow.h
src/ui/sidepanel.cpp

index 4527571..125dee1 100644 (file)
@@ -36,7 +36,7 @@
 #include "map/mapview.h"
 #include "panelsidebar.h"
 #include "settingsdialog.h"
-#include "userpanel.h"
+#include "userinfopanel.h"
 #include "zoombuttonpanel.h"
 
 #include "mainwindow.h"
@@ -114,8 +114,8 @@ void MainWindow::buildFriendListPanel()
     connect(m_friendsListPanel, SIGNAL(findFriend(QPointF)),
             this, SIGNAL(findFriend(QPointF)));
 
-    connect(m_mapView, SIGNAL(viewResizedNewSize(int, int)),
-            m_friendsListPanel, SLOT(reDrawFriendsPanel(int, int)));
+    connect(m_mapView, SIGNAL(viewResized(QSize)),
+            m_friendsListPanel, SLOT(screenResized(QSize)));
 
     connect(m_mapView, SIGNAL(viewResizedNewSize(int, int)),
             friendsListPanelSidebar, SLOT(reDrawSidebar(int, int)));
@@ -169,7 +169,7 @@ void MainWindow::buildMap()
 
 void MainWindow::buildOsmLicense()
 {
-    qDebug() << __PRETTY_FUNCTION__;
+    qWarning() << __PRETTY_FUNCTION__;
 
     m_osmLicense = new QLabel(this);
     m_osmLicense->setAttribute(Qt::WA_TranslucentBackground, true);
@@ -179,8 +179,8 @@ void MainWindow::buildOsmLicense()
     m_osmLicense->resize(m_osmLicense->fontMetrics().width(OSM_LICENSE),
                          m_osmLicense->fontMetrics().height());
 
-    connect(m_mapView, SIGNAL(viewResizedNewSize(int, int)),
-            this, SLOT(drawOsmLicense(int, int)));
+    connect(m_mapView, SIGNAL(viewResized(QSize)),
+            this, SLOT(drawOsmLicense(QSize)));
 }
 
 void MainWindow::buildUserInfoPanel()
@@ -208,8 +208,8 @@ void MainWindow::buildUserInfoPanel()
     connect(m_userPanel, SIGNAL(refreshUserData()),
             this, SIGNAL(refreshUserData()));
 
-    connect(m_mapView, SIGNAL(viewResizedNewSize(int, int)),
-            m_userPanel, SLOT(reDrawUserPanel(int, int)));
+    connect(m_mapView, SIGNAL(viewResized(QSize)),
+            m_userPanel, SLOT(screenResized(QSize)));
 }
 
 void MainWindow::buildZoomButtonPanel()
@@ -266,12 +266,13 @@ void MainWindow::createMenus()
     m_viewMenu->setObjectName(tr("Menu"));
 }
 
-void MainWindow::drawOsmLicense(int width, int height)
+void MainWindow::drawOsmLicense(const QSize &size)
 {
-    qDebug() << __PRETTY_FUNCTION__ << width << "x" << height;
+    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());
 
-    m_osmLicense->move(width - m_osmLicense->fontMetrics().width(OSM_LICENSE) - PANEL_PEEK_AMOUNT,
-                        height - m_osmLicense->fontMetrics().height());
 }
 
 void MainWindow::drawOwnLocationCrosshair(int width, int height)
index 1ed213d..c7a4fea 100644 (file)
@@ -208,10 +208,9 @@ private slots:
     /**
     * @brief Slot for drawing the Open Street Map license text
     *
-    * @param width Width of the viewport
-    * @param height Height of the viewport
+    * @param size Size of the screen
     */
-    void drawOsmLicense(int width, int height);
+    void drawOsmLicense(const QSize &size);
 
     /**
     * @brief Slot for drawing the own location crosshair
index beffa6b..8566a64 100644 (file)
@@ -126,7 +126,7 @@ void SidePanel::setType(SidePanel::PanelType type)
                     this, SIGNAL(toggleState()));
 
             // set mask to allow clicking zoom button at their default position
-            setMask(QPixmap(":/res/images/userpanel_mask.png").mask());
+//            setMask(QPixmap(":/res/images/userpanel_mask.png").mask());
 
             m_panelStateClosed->assignProperty(this, "pos", QPoint(
                     USERPANEL_CLOSED_X, PANEL_TOP_Y));
@@ -152,6 +152,7 @@ void SidePanel::setType(SidePanel::PanelType type)
             setObjectName("FriendPanel");
         }
         else {
+            qWarning() << "In" << __PRETTY_FUNCTION__ << ":" << type;
             qFatal("Illegal type set for SidePanel::setType");
         }
         m_panelStateMachine->start();