Removed old MapZoomPanel/MapButton classes and fixed dependencies. Did some other...
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 12 May 2010 13:51:34 +0000 (16:51 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 12 May 2010 13:51:34 +0000 (16:51 +0300)
17 files changed:
src/map/mapbutton.cpp [deleted file]
src/map/mapbutton.h [deleted file]
src/map/mapcommon.h
src/map/mapengine.cpp
src/map/mapengine.h
src/map/mapview.cpp
src/map/mapview.h
src/map/mapzoompanel.cpp [deleted file]
src/map/mapzoompanel.h [deleted file]
src/src.pro
src/ui/imagebutton.cpp
src/ui/imagebutton.h
src/ui/mainwindow.cpp
src/ui/mapviewscreen.cpp
src/ui/mapviewscreen.h
src/ui/panelcommon.h
src/ui/panelsidebar.h

diff --git a/src/map/mapbutton.cpp b/src/map/mapbutton.cpp
deleted file mode 100644 (file)
index 55c6d24..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-   Situare - A location system for Facebook
-   Copyright (C) 2010  Ixonos Plc. Authors:
-
-       Pekka Nissinen - pekka.nissinen@ixonos.com
-
-   Situare is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as published by the Free Software Foundation.
-
-   Situare is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with Situare; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-   USA.
-*/
-
-#include <QDebug>
-#include <QPixmap>
-
-#include "mapbutton.h"
-#include "mapcommon.h"
-
-MapButton::MapButton(QString fileName)
-    : m_buttonMode(QIcon::Normal)
-    , m_buttonWidth(MAP_ZOOM_PANEL_BUTTON_SIZE)
-    , m_buttonHeight(MAP_ZOOM_PANEL_BUTTON_SIZE)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    addFile(fileName);
-}
-
-void MapButton::draw(QPainter *painter, int x, int y)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    paint(painter, x, y, m_buttonWidth, m_buttonHeight, NULL, m_buttonMode);
-}
-
-void MapButton::setMode(QIcon::Mode mode)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    m_buttonMode = mode;
-}
diff --git a/src/map/mapbutton.h b/src/map/mapbutton.h
deleted file mode 100644 (file)
index 8b4872b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-   Situare - A location system for Facebook
-   Copyright (C) 2010  Ixonos Plc. Authors:
-
-       Pekka Nissinen - pekka.nissinen@ixonos.com
-
-   Situare is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as published by the Free Software Foundation.
-
-   Situare is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with Situare; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-   USA.
-*/
-
-#ifndef MAPBUTTON_H
-#define MAPBUTTON_H
-
-#include <QIcon>
-#include <QString>
-#include <QPainter>
-
-/**
-* @brief A simple class for icon button
-*
-* @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
-*/
-class MapButton : public QIcon
-{
-public:
-    /**
-    * @brief Constructor
-    *
-    * @param fileName Icon image file name
-    */
-    MapButton(QString fileName);
-
-/*******************************************************************************
- * MEMBER FUNCTIONS AND SLOTS
- ******************************************************************************/
-public:
-    /**
-    * @brief Draws the button
-    *
-    * @param painter Painter
-    * @param x Button x coordinate
-    * @param y Button y coordinate
-    */
-    void draw(QPainter *painter, int x, int y);
-
-    /**
-    * @brief Sets the button icon mode
-    *
-    * @param mode Button icon mode
-    */
-    void setMode(QIcon::Mode mode);
-
-/*******************************************************************************
- * DATA MEMBERS
- ******************************************************************************/
-private:
-    QIcon::Mode m_buttonMode; ///< Button mode (Normal, Selected etc...)
-    int m_buttonWidth; ///< Button width
-    int m_buttonHeight; ///< Button height
-};
-
-#endif // MAPBUTTON_H
index 264d2c7..edcfa90 100644 (file)
@@ -49,12 +49,6 @@ const int MAP_OWN_LOCATION_ICON_SIZE = 24; ///< Size of own location item icon
 const int ZOOM_FPS = 30; ///< FPS for the zoom effect
 const qreal ZOOM_TIME = 250; ///< Length of the zoom effect (ms)
 
-const int MAP_ZOOM_PANEL_POSITION_X = 10 + 25; ///< Horizontal position of zoom panel
-const int MAP_ZOOM_PANEL_POSITION_Y = 10; ///< Vertical position of zoom panel
-const int MAP_ZOOM_PANEL_LEVEL = OWN_LOCATION_ICON_Z_LEVEL + 1; ///< Zepth of zoom panel (Z-axis)
-const int MAP_ZOOM_PANEL_BUTTON_SIZE = 74; ///< Size of a zoom panel button
-const int MAP_ZOOM_PANEL_BUTTON_SPACING = 4; ///< Size of a zoom button spacing
-
 const qreal MAX_LATITUDE = 85.05112877980659237802;  ///< Maximum latitude value
 const qreal MIN_LATITUDE = -MAX_LATITUDE; ///< Minimum latitude value
 const qreal MIN_LONGITUDE = -180.0;  ///< Minimum longitude value
index 6d221c2..4ab6e81 100644 (file)
@@ -52,11 +52,6 @@ MapEngine::MapEngine(QObject *parent)
     connect(m_mapFetcher, SIGNAL(mapImageReceived(int,int,int,QPixmap)),
             this, SLOT(mapImageReceived(int,int,int,QPixmap)));
 
-    m_mapZoomPanel = new MapZoomPanel(NULL, MAP_ZOOM_PANEL_POSITION_X, MAP_ZOOM_PANEL_POSITION_Y);
-    m_mapScene->addItem(m_mapZoomPanel);
-    connect(m_mapZoomPanel, SIGNAL(zoomInPressed()), this, SLOT(zoomIn()));
-    connect(m_mapZoomPanel, SIGNAL(zoomOutPressed()), this, SLOT(zoomOut()));
-
     m_ownLocation = new OwnLocationItem();
     m_ownLocation->hide(); // hide until first location info is received
     m_mapScene->addItem(m_ownLocation);
@@ -134,8 +129,6 @@ QRect MapEngine::calculateTileGrid(QPoint sceneCoordinate)
 void MapEngine::alignImmovableItems(QPoint viewTopLeft)
 {
     qDebug() << __PRETTY_FUNCTION__ << "viewTopLeft:" << viewTopLeft;
-
-    m_mapZoomPanel->setPos(viewTopLeft);
 }
 
 void MapEngine::setLocation(QPoint sceneCoordinate)
index 450d22b..e97d8e3 100644 (file)
@@ -31,7 +31,6 @@
 #include "mapfetcher.h"
 #include "mapscene.h"
 #include "maptile.h"
-#include "mapzoompanel.h"
 #include "ownlocationitem.h"
 #include "user/user.h"
 
@@ -42,6 +41,7 @@ class FriendItemsHandler;
 *
 * Logic for controlling map functionality. Does also include static methods for
 * converting coordinates.
+*
 * @author Sami Rämö - sami.ramo (at) ixonos.com
 * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
 * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
@@ -270,7 +270,6 @@ private:
     FriendItemsHandler *m_friendItemsHandler; ///< Handler for friend and group items
     MapFetcher *m_mapFetcher; ///< Fetcher for map tiles
     MapScene *m_mapScene; ///< Scene for map tiles
-    MapZoomPanel *m_mapZoomPanel; ///< Toolbar for zoom buttons
     OwnLocationItem *m_ownLocation; ///< Item to show own location
     QPoint m_sceneCoordinate; ///< Current center coordinate
     QRect m_viewTilesGrid; ///< Current grid of tiles in view (includes margin)
index 351e714..baaafe1 100644 (file)
@@ -3,6 +3,7 @@
    Copyright (C) 2010  Ixonos Plc. Authors:
 
        Sami Rämö - sami.ramo@ixonos.com
+       Pekka Nissinen - pekka.nissinen@ixonos.com
 
    Situare is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
index 128543e..8ddff7c 100644 (file)
@@ -3,6 +3,7 @@
    Copyright (C) 2010  Ixonos Plc. Authors:
 
        Sami Rämö - sami.ramo@ixonos.com
+       Pekka Nissinen - pekka.nissinen@ixonos.com
 
    Situare is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -29,6 +30,7 @@
 * @brief Map view widget
 *
 * @author Sami Rämö - sami.ramo (at) ixonos.com
+* @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
 */
 class MapView : public QGraphicsView
 {
diff --git a/src/map/mapzoompanel.cpp b/src/map/mapzoompanel.cpp
deleted file mode 100644 (file)
index 812077d..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-   Situare - A location system for Facebook
-   Copyright (C) 2010  Ixonos Plc. Authors:
-
-       Pekka Nissinen - pekka.nissinen@ixonos.com
-
-   Situare is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as published by the Free Software Foundation.
-
-   Situare is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with Situare; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-   USA.
-*/
-
-#include <QDebug>
-
-#include "mapcommon.h"
-#include "mapzoompanel.h"
-
-MapZoomPanel::MapZoomPanel(QGraphicsItem *parent, int x, int y) : QGraphicsItem(parent)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    m_x = x;
-    m_y = y;
-    m_width = MAP_ZOOM_PANEL_BUTTON_SIZE;
-    m_height = MAP_ZOOM_PANEL_BUTTON_SIZE + MAP_ZOOM_PANEL_BUTTON_SPACING
-               + MAP_ZOOM_PANEL_BUTTON_SIZE;
-
-    m_zoomInBtn = new MapButton(":/res/images/zoom_in.png");
-    m_zoomOutBtn = new MapButton(":/res/images/zoom_out.png");
-
-    setFlag(QGraphicsItem::ItemIgnoresTransformations);
-    setZValue(static_cast<qreal>(MAP_ZOOM_PANEL_LEVEL));
-}
-
-MapZoomPanel::~MapZoomPanel()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    delete m_zoomInBtn;
-    delete m_zoomOutBtn;
-    m_zoomInBtn = 0;
-    m_zoomOutBtn = 0;
-}
-
-QRectF MapZoomPanel::boundingRect() const
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    return QRectF(m_x, m_y, m_width, m_height);
-}
-
-void MapZoomPanel::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    Q_UNUSED(option);
-    Q_UNUSED(widget);
-
-    m_zoomInBtn->draw(painter, m_x, m_y);
-    m_zoomOutBtn->draw(painter, m_x, m_y + MAP_ZOOM_PANEL_BUTTON_SPACING
-                        + MAP_ZOOM_PANEL_BUTTON_SIZE);
-}
-
-void MapZoomPanel::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    if ( event->pos().y() < (m_y + MAP_ZOOM_PANEL_BUTTON_SPACING + MAP_ZOOM_PANEL_BUTTON_SIZE) )
-        m_zoomInBtn->setMode(QIcon::Selected);
-    else
-        m_zoomOutBtn->setMode(QIcon::Selected);
-
-    update();
-}
-
-void MapZoomPanel::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    Q_UNUSED(event);
-
-    m_zoomInBtn->setMode(QIcon::Normal);
-    m_zoomOutBtn->setMode(QIcon::Normal);
-
-    if ( event->pos().y() < (m_y + MAP_ZOOM_PANEL_BUTTON_SPACING + MAP_ZOOM_PANEL_BUTTON_SIZE) )
-        emit zoomInPressed();
-    else
-        emit zoomOutPressed();
-
-    update();
-}
diff --git a/src/map/mapzoompanel.h b/src/map/mapzoompanel.h
deleted file mode 100644 (file)
index da8cae4..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-   Situare - A location system for Facebook
-   Copyright (C) 2010  Ixonos Plc. Authors:
-
-       Pekka Nissinen - pekka.nissinen@ixonos.com
-
-   Situare is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as published by the Free Software Foundation.
-
-   Situare is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with Situare; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-   USA.
-*/
-
-#ifndef MAPZOOMPANEL_H
-#define MAPZOOMPANEL_H
-
-#include <QRectF>
-#include <QWidget>
-#include <QPainter>
-#include <QGraphicsItem>
-#include <QStyleOptionGraphicsItem>
-#include <QGraphicsSceneMouseEvent>
-
-#include "mapbutton.h"
-
-/**
-* @brief Panel for zoom buttons
-*
-* @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
-*/
-class MapZoomPanel : public QObject, public QGraphicsItem
-{
-    Q_OBJECT
-
-public:
-    /**
-    * @brief Constructor
-    *
-    * @param parent Parent
-    * @param x Panel x coordinate
-    * @param y Panel y coordinate
-    */
-    MapZoomPanel(QGraphicsItem *parent = 0, int x = 0, int y = 0);
-
-    /**
-    * @brief Destructor
-    */
-    ~MapZoomPanel();
-
-/*******************************************************************************
- * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
- ******************************************************************************/
-public:
-    /**
-    * @brief Returns the outer bounds of the panel
-    */
-    QRectF boundingRect() const;
-
-    /**
-    * @brief Paints the panel and its content
-    *
-    * @param painter Painter
-    * @param option Style options
-    * @param widget Widget
-    */
-    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-
-protected:
-    /**
-    * @brief Event handler for mouse press events
-    *
-    * @param event Mouse event
-    */
-    void mousePressEvent(QGraphicsSceneMouseEvent *event);
-
-    /**
-    * @brief Event handler for mouse release events
-    *
-    * @param event Mouse event
-    */
-    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-
-/*******************************************************************************
- * SIGNALS
- ******************************************************************************/
-signals:
-    /**
-    * @brief Signal for zoom in button click
-    */
-    void zoomInPressed();
-
-    /**
-    * @brief Signal for zoom out button click
-    */
-    void zoomOutPressed();
-
-/*******************************************************************************
- * DATA MEMBERS
- ******************************************************************************/
-private:
-    MapButton *m_zoomInBtn; ///< Button for zoom in
-    MapButton *m_zoomOutBtn; ///< Button for zoom out
-    qreal m_x; ///< Panel x coordinate
-    qreal m_y; ///< Panel y coordinate
-    qreal m_width; ///< Panel width
-    qreal m_height; ///< Panel height
-};
-
-#endif // MAPZOOMPANEL_H
index bf3e3e7..8865459 100644 (file)
@@ -18,8 +18,6 @@ SOURCES += main.cpp \
     map/mapscene.cpp \
     map/maptile.cpp \
     map/mapfetcher.cpp \
-    map/mapzoompanel.cpp \
-    map/mapbutton.cpp \
     map/ownlocationitem.cpp \
     map/baselocationitem.cpp \
     map/friendlocationitem.cpp \
@@ -40,7 +38,8 @@ SOURCES += main.cpp \
     ui/panelsliderbar.cpp \
     map/friendgroupitem.cpp \
     map/frienditemshandler.cpp \
-    gps/gpspositioninterface.cpp
+    gps/gpspositioninterface.cpp \
+    ui/zoombuttonpanel.cpp
 HEADERS += ui/mainwindow.h \
     ui/mapviewscreen.h \
     map/mapengine.h \
@@ -49,8 +48,6 @@ HEADERS += ui/mainwindow.h \
     map/maptile.h \
     map/mapfetcher.h \
     map/mapcommon.h \
-    map/mapzoompanel.h \
-    map/mapbutton.h \
     map/ownlocationitem.h \
     map/baselocationitem.h \
     map/friendlocationitem.h \
@@ -78,7 +75,8 @@ HEADERS += ui/mainwindow.h \
     ui/panelsliderbar.h \
     map/friendgroupitem.h \
     map/frienditemshandler.h \
-    gps/gpspositioninterface.h
+    gps/gpspositioninterface.h \
+    ui/zoombuttonpanel.h
 QT += network \
     webkit
 DEFINES += QT_NO_DEBUG_OUTPUT
index 7a9f003..41f2c13 100644 (file)
@@ -73,5 +73,11 @@ void ImageButton::paintEvent(QPaintEvent *event)
     Q_UNUSED(event);
 
     QPainter painter(this);
+
+    // Temporary border
+    painter.setPen(Qt::white);
+    painter.drawRect(this->rect().x(), this->rect().y(),
+                     this->rect().width() - 1, this->rect().height() - 1);
+
     icon().paint(&painter, this->rect(), NULL, m_buttonMode);
 }
index b748d41..c024503 100644 (file)
@@ -47,7 +47,7 @@ public:
     * @param selectedIconPictureFileName Selected state Icon image file name (optional)
     */
     ImageButton(QWidget *parent = 0, QString normalIconPictureFileName = "",
-              QString selectedIconPictureFileName = "");
+                QString selectedIconPictureFileName = "");
 
 /*******************************************************************************
  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
index a95dbd1..b3f2a62 100644 (file)
@@ -80,15 +80,18 @@ void MainWindow::createMenus()
 
     m_toSettingsAct = new QAction(tr("Settings"), this);
     m_toSettingsAct->setObjectName(tr("Settings"));
-    connect(m_toSettingsAct, SIGNAL(triggered()), this, SLOT(openSettingsDialog()));
-        m_gpsToggleAct = new QAction(tr("GPS"), this);
+    connect(m_toSettingsAct, SIGNAL(triggered()),
+        this, SLOT(openSettingsDialog()));
+    m_gpsToggleAct = new QAction(tr("GPS"), this);
     m_gpsToggleAct->setCheckable(true);
     m_gpsToggleAct->setChecked(true);
-    connect(m_gpsToggleAct, SIGNAL(toggled(bool)), this, SLOT(gpsActionToggled(bool)));
+    connect(m_gpsToggleAct, SIGNAL(toggled(bool)),
+        this, SLOT(gpsActionToggled(bool)));
     m_autoCenteringAct = new QAction(tr("Auto centering"), this);
     m_autoCenteringAct->setCheckable(true);
     m_autoCenteringAct->setChecked(true);
-    connect(m_autoCenteringAct, SIGNAL(toggled(bool)), this, SLOT(autoCenteringToggled(bool)));    
+    connect(m_autoCenteringAct, SIGNAL(toggled(bool)),
+        this, SLOT(autoCenteringToggled(bool)));    
        
        m_viewMenu = menuBar()->addMenu(tr("Main"));
 
index e367a6c..b2e02eb 100644 (file)
 #include "mapviewscreen.h"
 #include "../map/mapview.h"
 #include "../map/mapengine.h"
-#include "friendlistpanel.h"
-#include "userpanel.h"
 #include "panelcommon.h"
-
 #include "panelsidebar.h"
 
 MapViewScreen::MapViewScreen(QWidget *parent)
@@ -33,67 +30,75 @@ MapViewScreen::MapViewScreen(QWidget *parent)
      m_autoCenteringEnabled(false)
 {
     MapView *mapView = new MapView(this);
-    mapEngine = new MapEngine(this);
-    mapView->setScene(mapEngine->scene());
+    m_mapEngine = new MapEngine(this);
+    mapView->setScene(m_mapEngine->scene());
 
-    FriendListPanel *friendsListPanel = new FriendListPanel(this);
-    UserInfoPanel *userPanel = new UserInfoPanel(this);
+    m_friendsListPanel = new FriendListPanel(this);
+    m_userPanel = new UserInfoPanel(this);
     PanelSideBar *userPanelSidebar = new PanelSideBar(this, LEFT);
     PanelSideBar *friendsListPanelSidebar = new PanelSideBar(this, RIGHT);
 
+    m_zoomButtonPanel = new ZoomButtonPanel(this, ZOOM_BUTTON_PANEL_POSITION_X,
+                                            ZOOM_BUTTON_PANEL_POSITION_Y);
+
     connect(mapView, SIGNAL(viewScrolled(QPoint)),
-            mapEngine, SLOT(setLocation(QPoint)));
-    connect(mapEngine, SIGNAL(locationChanged(QPoint)),
+            m_mapEngine, SLOT(setLocation(QPoint)));
+    connect(m_mapEngine, SIGNAL(locationChanged(QPoint)),
             mapView, SLOT(centerToSceneCoordinates(QPoint)));
-    connect(mapEngine, SIGNAL(zoomLevelChanged(int)),
+    connect(m_mapEngine, SIGNAL(zoomLevelChanged(int)),
             mapView, SLOT(setZoomLevel(int)));
     connect(mapView, SIGNAL(viewResized(QSize)),
-            mapEngine, SLOT(viewResized(QSize)));
+            m_mapEngine, SLOT(viewResized(QSize)));
     connect(mapView, SIGNAL(viewContentChanged(QPoint)),
-            mapEngine, SLOT(alignImmovableItems(QPoint)));
+            m_mapEngine, SLOT(alignImmovableItems(QPoint)));
     connect(mapView, SIGNAL(viewZoomFinished()),
-            mapEngine, SLOT(viewZoomFinished()));
+            m_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)));
+            m_friendsListPanel, SLOT(reDrawFriendsPanel(int,int)));
     connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
-            userPanel, SLOT(reDrawUserPanel(int,int)));
+            m_userPanel, SLOT(reDrawUserPanel(int,int)));
     connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
             friendsListPanelSidebar, SLOT(reDrawSidebar(int,int)));
 
+    connect(m_zoomButtonPanel->m_zoomInBtn, SIGNAL(clicked()),
+            m_mapEngine, SLOT(zoomIn()));
+    connect(m_zoomButtonPanel->m_zoomOutBtn, SIGNAL(clicked()),
+            m_mapEngine, SLOT(zoomOut()));
+
     connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
-            friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
+            m_friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
 
     connect(this, SIGNAL(userLocationReady(User*)),
-            mapEngine, SLOT(receiveOwnLocation(User*)));
+            m_mapEngine, SLOT(receiveOwnLocation(User*)));
     connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
-            mapEngine, SIGNAL(friendsLocationsReady(QList<User*>&)));
+            m_mapEngine, SIGNAL(friendsLocationsReady(QList<User*>&)));
 
     QHBoxLayout *mapViewLayout = new QHBoxLayout;
 
-    osmLicense = new QLabel(this);
-    osmLicense->setAttribute(Qt::WA_TranslucentBackground, true);
-    osmLicense->setAttribute(Qt::WA_TransparentForMouseEvents, true);
-    osmLicense->setText("<font color='black'>"+OSM_LICENSE+"</font>");
-    osmLicense->setFont(QFont("Nokia Sans", 9));
-    osmLicense->resize(osmLicense->fontMetrics().width(OSM_LICENSE),
-                       osmLicense->fontMetrics().height());
-
-    friendsListPanel->stackUnder(friendsListPanelSidebar);
-    userPanelSidebar->stackUnder(friendsListPanel);
-    userPanel->stackUnder(userPanelSidebar);
-    osmLicense->stackUnder(userPanel);
-    mapView->stackUnder(osmLicense);
+    m_osmLicense = new QLabel(this);
+    m_osmLicense->setAttribute(Qt::WA_TranslucentBackground, true);
+    m_osmLicense->setAttribute(Qt::WA_TransparentForMouseEvents, true);
+    m_osmLicense->setText("<font color='black'>"+OSM_LICENSE+"</font>");
+    m_osmLicense->setFont(QFont("Nokia Sans", 9));
+    m_osmLicense->resize(m_osmLicense->fontMetrics().width(OSM_LICENSE),
+                            m_osmLicense->fontMetrics().height());
+
+    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);
 
     mapViewLayout->addWidget(mapView);
     setLayout(mapViewLayout);
 
     mapViewLayout->setMargin(0);
 
-    mapEngine->init();
+    m_mapEngine->init();
 
     setObjectName("Map view");
 }
@@ -101,8 +106,8 @@ MapViewScreen::MapViewScreen(QWidget *parent)
 void MapViewScreen::drawOsmLicense(int width, int height)
 {
     qDebug() << __PRETTY_FUNCTION__ << width << "x" << height;
-    osmLicense->move(width - osmLicense->fontMetrics().width(OSM_LICENSE) - PANEL_PEEK_AMOUNT,
-                     height - osmLicense->fontMetrics().height());
+    m_osmLicense->move(width - m_osmLicense->fontMetrics().width(OSM_LICENSE) - PANEL_PEEK_AMOUNT,
+                        height - m_osmLicense->fontMetrics().height());
 }
 
 void MapViewScreen::positionReceived(QPointF position)
@@ -110,7 +115,7 @@ void MapViewScreen::positionReceived(QPointF position)
     qDebug() << __PRETTY_FUNCTION__;
 
     if (m_autoCenteringEnabled)
-        mapEngine->setViewLocation(position);
+        m_mapEngine->setViewLocation(position);
 }
 
 void MapViewScreen::enableAutoCentering(bool enabled)
index f62cc54..d282b12 100644 (file)
@@ -28,6 +28,7 @@
 #include "map/mapengine.h"
 #include "friendlistpanel.h"
 #include "userpanel.h"
+#include "zoombuttonpanel.h"
 
 /**
 * @brief Map View class. Used to display Map
@@ -97,11 +98,12 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    bool m_autoCenteringEnabled;        ///< Enable
-    FriendListPanel *friendsListPanel; ///< Instance of friends list panel
-    MapEngine *mapEngine; ///< MapEngine
-    QLabel *osmLicense; ///< Label for Open Street Map license
-    UserInfoPanel *userPanel; ///< Instance of the user information panel
+    MapEngine *m_mapEngine;                 ///< MapEngine
+    UserInfoPanel *m_userPanel;             ///< Instance of the user information panel
+    FriendListPanel *m_friendsListPanel;    ///< Instance of friends list panel
+    ZoomButtonPanel *m_zoomButtonPanel;     ///< Instance of zoom button panel
+    QLabel *m_osmLicense;                   ///< Label for Open Street Map license
+    bool m_autoCenteringEnabled;            ///< Enable
 };
 
 #endif // MAPVIEWTAB_H
index 97bed57..17a330d 100644 (file)
@@ -25,7 +25,6 @@
 #include <QtCore>
 #include "map/mapcommon.h"
 
-
 enum Side{LEFT, RIGHT};  ///< Enumerator for panel sideness
 
 const int PANEL_PEEK_AMOUNT = 25; ///< Amount of pixels shown when panel is closed
@@ -58,4 +57,8 @@ const int SIDEBAR_HEIGHT = 424;
 const int SLIDINGBAR_WIDTH = 24;
 const int SLIDINGBAR_HEIGHT = 424;
 
+const int ZOOM_BUTTON_PANEL_POSITION_X = 10 + PANEL_PEEK_AMOUNT; ///< Horizontal position of zoom panel
+const int ZOOM_BUTTON_PANEL_POSITION_Y = 10; ///< Vertical position of zoom panel
+const int ZOOM_BUTTON_PANEL_BUTTON_SPACING = 4; ///< Size of a zoom button spacing
+
 #endif // PANELCOMMON_H
index c1293af..0550b64 100644 (file)
@@ -35,7 +35,6 @@ class PanelSideBar : public QWidget
 {
     Q_OBJECT
 
-
 public:
     /**
     * @brief Constructor