ui/listitem.cpp \
ui/listitemdelegate.cpp \
ui/friendlistitemdelegate.cpp \
- ui/searchdialog.cpp
+ ui/searchdialog.cpp \
+ ui/indicatorbuttonpanel.cpp
HEADERS += application.h \
common.h \
engine/engine.h \
ui/listitemdelegate.h \
ui/friendlistitemdelegate.h \
ui/listcommon.h \
- ui/searchdialog.h
+ ui/searchdialog.h \
+ ui/indicatorbuttonpanel.h
QT += network \
webkit
IndicatorButton::IndicatorButton(QWidget *parent)
: QToolButton(parent),
m_drawTriangle(false),
- m_isDraggable(false),
+// m_isDraggable(false),
m_direction(0),
m_distance(0),
m_distanceText("")
m_indicatorLeds[ON].load(":res/images/led_red_s.png");
setFixedSize(BUTTON_WIDTH, BUTTON_HEIGHT);
- QSettings settings(DIRECTORY_NAME, FILE_NAME);
- QPoint savedLocation = settings.value(DIRECTION_INDICATOR_BUTTON_POSITION,
- QPoint(DIRECTION_INDICATOR_POSITION_X,
- DIRECTION_INDICATOR_POSITION_Y)).toPoint();
+// QSettings settings(DIRECTORY_NAME, FILE_NAME);
+// QPoint savedLocation = settings.value(DIRECTION_INDICATOR_BUTTON_POSITION,
+// QPoint(DIRECTION_INDICATOR_POSITION_X,
+// DIRECTION_INDICATOR_POSITION_Y)).toPoint();
- if(savedLocation.x() > DEFAULT_SCREEN_WIDTH || savedLocation.y() > DEFAULT_SCREEN_HEIGHT) {
- savedLocation.rx() = DIRECTION_INDICATOR_POSITION_X;
- savedLocation.ry() = DIRECTION_INDICATOR_POSITION_Y;
- }
+// if(savedLocation.x() > DEFAULT_SCREEN_WIDTH || savedLocation.y() > DEFAULT_SCREEN_HEIGHT) {
+// savedLocation.rx() = DIRECTION_INDICATOR_POSITION_X;
+// savedLocation.ry() = DIRECTION_INDICATOR_POSITION_Y;
+// }
- move(savedLocation);
+// move(savedLocation);
// Normal background
m_normalColor = new QColor(Qt::black);
m_selectedGradient->setColorAt(0.75, QColor(82, 195, 255));
m_selectedGradient->setColorAt(0.98, QColor(115, 215, 255));
- m_dragStartTimer = new QTimer(this);
- m_dragStartTimer->setSingleShot(true);
- m_dragStartTimer->setInterval(DRAG_INIT_TIME);
+// m_dragStartTimer = new QTimer(this);
+// m_dragStartTimer->setSingleShot(true);
+// m_dragStartTimer->setInterval(DRAG_INIT_TIME);
+
+// m_forceReleaseTimer = new QTimer(this);
+// m_forceReleaseTimer->setSingleShot(true);
+// m_forceReleaseTimer->setInterval(FORCE_RELEASE_TIME);
- m_forceReleaseTimer = new QTimer(this);
- m_forceReleaseTimer->setSingleShot(true);
- m_forceReleaseTimer->setInterval(FORCE_RELEASE_TIME);
+// connect(this, SIGNAL(pressed()),
+// m_dragStartTimer, SLOT(start()));
+// connect(this, SIGNAL(released()),
+// m_dragStartTimer, SLOT(stop()));
- connect(this, SIGNAL(pressed()),
- m_dragStartTimer, SLOT(start()));
- connect(this, SIGNAL(released()),
- m_dragStartTimer, SLOT(stop()));
connect(this, SIGNAL(clicked(bool)),
this, SIGNAL(autoCenteringTriggered(bool)));
- connect(m_dragStartTimer, SIGNAL(timeout()),
- this, SLOT(timerExpired()));
- connect(m_forceReleaseTimer, SIGNAL(timeout()),
- this, SLOT(forceMouseRelease()));
+// connect(m_dragStartTimer, SIGNAL(timeout()),
+// this, SLOT(timerExpired()));
+// connect(m_forceReleaseTimer, SIGNAL(timeout()),
+// this, SLOT(forceMouseRelease()));
setCheckable(true);
}
m_dragPosition = event->pos();
m_eventPosition = mapToParent(event->pos());
- m_dragStartTimer->start();
- setDown(true);
+// m_dragStartTimer->start();
+// setDown(true);
}
void IndicatorButton::mouseMoveEvent(QMouseEvent *event)
{
+// qDebug() << __PRETTY_FUNCTION__;
+
+// if(m_isDraggable) {
+// if (event->buttons() & Qt::LeftButton) {
+// QPoint newLocation = mapToParent(event->pos()) - m_dragPosition;
+
+// if (newLocation.x() < SIDEBAR_WIDTH)
+// newLocation.rx() = SIDEBAR_WIDTH;
+// else if (newLocation.x() > m_screenSize.width() - width() - SIDEBAR_WIDTH)
+// newLocation.rx() = m_screenSize.width() - width() - SIDEBAR_WIDTH;
+
+// if (newLocation.y() < 0)
+// newLocation.ry() = 0;
+// else if (newLocation.y() > m_screenSize.height() - height())
+// newLocation.ry() = m_screenSize.height() - height();
+
+// move(newLocation);
+// }
+// } else {
+// if(!rect().contains(event->pos())) {
+// m_dragStartTimer->stop();
+// setDown(false);
+// }
+// }
qDebug() << __PRETTY_FUNCTION__;
- if(m_isDraggable) {
- if (event->buttons() & Qt::LeftButton) {
- QPoint newLocation = mapToParent(event->pos()) - m_dragPosition;
-
- if (newLocation.x() < SIDEBAR_WIDTH)
- newLocation.rx() = SIDEBAR_WIDTH;
- else if (newLocation.x() > m_screenSize.width() - width() - SIDEBAR_WIDTH)
- newLocation.rx() = m_screenSize.width() - width() - SIDEBAR_WIDTH;
+ if(rect().contains(event->pos()))
+ m_eventPosition = mapToParent(event->pos());
- if (newLocation.y() < 0)
- newLocation.ry() = 0;
- else if (newLocation.y() > m_screenSize.height() - height())
- newLocation.ry() = m_screenSize.height() - height();
-
- move(newLocation);
- }
- } else {
- if(!rect().contains(event->pos())) {
- m_dragStartTimer->stop();
- setDown(false);
- }
- }
+// QToolButton::mouseMoveEvent(event);
}
void IndicatorButton::mouseReleaseEvent(QMouseEvent *event)
{
qDebug() << __PRETTY_FUNCTION__;
- m_dragStartTimer->stop();
+// m_dragStartTimer->stop();
- if(m_isDraggable) {
- setDraggable(false);
- QSettings settings(DIRECTORY_NAME, FILE_NAME);
- settings.setValue(DIRECTION_INDICATOR_BUTTON_POSITION, pos());
- } else {
+// if(m_isDraggable) {
+// setDraggable(false);
+// QSettings settings(DIRECTORY_NAME, FILE_NAME);
+// settings.setValue(DIRECTION_INDICATOR_BUTTON_POSITION, pos());
+// } else {
if(this->rect().contains(event->pos())) {
if(isChecked()) {
setChecked(false);
}
}
}
- setDown(false);
-}
+// setDown(false);
+//}
void IndicatorButton::setDraggable(bool mode, QPoint eventPosition)
{
- qDebug() << __PRETTY_FUNCTION__;
+// qDebug() << __PRETTY_FUNCTION__;
- m_isDraggable = mode;
+// m_isDraggable = mode;
- if(mode) {
- m_forceReleaseTimer->start();
- m_dragPosition = eventPosition;
- } else {
- m_forceReleaseTimer->stop();
- }
- update();
+// if(mode) {
+// m_forceReleaseTimer->start();
+// m_dragPosition = eventPosition;
+// } else {
+// m_forceReleaseTimer->stop();
+// }
+// update();
}
void IndicatorButton::screenResized(const QSize &newSize)
{
qDebug() << __PRETTY_FUNCTION__;
- int oldHeight = 0;
- int oldWidth = 0;
+// int oldHeight = 0;
+// int oldWidth = 0;
- if(m_screenSize.height() < 0)
- oldHeight = DEFAULT_NON_FULLSCREEN_HEIGHT;
- else
- oldHeight = m_screenSize.height();
+// if(m_screenSize.height() < 0)
+// oldHeight = DEFAULT_NON_FULLSCREEN_HEIGHT;
+// else
+// oldHeight = m_screenSize.height();
- if(m_screenSize.width() < 0)
- oldWidth = DEFAULT_SCREEN_WIDTH;
- else
- oldWidth = m_screenSize.width();
+// if(m_screenSize.width() < 0)
+// oldWidth = DEFAULT_SCREEN_WIDTH;
+// else
+// oldWidth = m_screenSize.width();
- m_screenSize = newSize;
+// m_screenSize = newSize;
- QPoint resizedPosition = pos();
- if(resizedPosition.x() > (newSize.width() - rect().width()))
- resizedPosition.rx() = newSize.width() - rect().width();
- else if (resizedPosition.x() < SIDEBAR_WIDTH)
- resizedPosition.rx() = SIDEBAR_WIDTH;
- if(resizedPosition.y() > (newSize.height() - rect().height()))
- resizedPosition.ry() = newSize.height() - rect().height();
- else if (resizedPosition.y() < 0)
- resizedPosition.ry() = 0;
+// QPoint resizedPosition = pos();
+// if(resizedPosition.x() > (newSize.width() - rect().width()))
+// resizedPosition.rx() = newSize.width() - rect().width();
+// else if (resizedPosition.x() < SIDEBAR_WIDTH)
+// resizedPosition.rx() = SIDEBAR_WIDTH;
+// if(resizedPosition.y() > (newSize.height() - rect().height()))
+// resizedPosition.ry() = newSize.height() - rect().height();
+// else if (resizedPosition.y() < 0)
+// resizedPosition.ry() = 0;
- if((pos().y() + rect().center().y()) > (oldHeight/2))
- resizedPosition.ry() = newSize.height() - (oldHeight - pos().y());
+// if((pos().y() + rect().center().y()) > (oldHeight/2))
+// resizedPosition.ry() = newSize.height() - (oldHeight - pos().y());
- if((pos().x() + rect().center().x()) > (oldWidth/2))
- resizedPosition.rx() = newSize.width() - (oldWidth - pos().x());
+// if((pos().x() + rect().center().x()) > (oldWidth/2))
+// resizedPosition.rx() = newSize.width() - (oldWidth - pos().x());
- move(resizedPosition);
+// move(resizedPosition);
}
const QPoint& IndicatorButton::eventPosition()
void IndicatorButton::forceMouseRelease()
{
- qDebug() << __PRETTY_FUNCTION__;
+// qDebug() << __PRETTY_FUNCTION__;
- releaseMouse();
- setDraggable(false);
+// releaseMouse();
+// setDraggable(false);
}
void IndicatorButton::paintEvent(QPaintEvent *event)
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
- if(m_isDraggable)
- painter.fillPath(backgroundPath, QBrush(Qt::Dense4Pattern));
- else if (isDown())
+// if(m_isDraggable)
+// painter.fillPath(backgroundPath, QBrush(Qt::Dense4Pattern));
+ if (isDown())
painter.fillPath(backgroundPath, QBrush(*m_selectedGradient));
else
painter.fillPath(backgroundPath, QBrush(*m_normalColor));
}
// Distance text
- painter.setFont(QFont(NOKIA_FONT_SMALL));
- painter.setPen(Qt::white);
- painter.drawText(2, 60, m_distanceText);
+// painter.setFont(QFont(NOKIA_FONT_SMALL));
+// painter.setPen(Qt::white);
+// painter.drawText(4, 60, m_distanceText);
// draw the direction indicator triangle only when autocentering is disabled and MapEngine
// doesn't deny drawing (because GPS location item is visible)
void IndicatorButton::timerExpired()
{
- qDebug() << __PRETTY_FUNCTION__;
+// qDebug() << __PRETTY_FUNCTION__;
- setDraggable(true, m_dragPosition);
+// setDraggable(true, m_dragPosition);
}
void IndicatorButton::updateValues(qreal direction, qreal distance, bool draw)
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Pekka Nissinen - pekka.nissinen@ixonos.com
+ Kaj Wallin - kaj.wallin@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 <QPainter>
+#include <QSettings>
+
+#include "indicatorbuttonpanel.h"
+
+#include "common.h"
+#include "panelcommon.h"
+#include "indicatorbutton.h"
+
+const int ROUNDING_RADIUS = 9; ///< Roundness of the background edges
+
+IndicatorButtonPanel::IndicatorButtonPanel(QWidget *parent)
+ : QWidget(parent),
+ m_isDraggable(false),
+ m_indicatorButton(0)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ QGridLayout *gridLayout = new QGridLayout(this);
+
+
+ m_indicatorButton = new IndicatorButton(this);
+
+ m_distanceTextLabel = new QLabel();
+ m_distanceTextLabel->setFixedWidth(85);
+ m_distanceTextLabel->setFrameStyle(QFrame::Panel | QFrame::Raised);
+ m_distanceTextLabel->setFont(QFont(NOKIA_FONT_SMALL));
+ m_distanceTextLabel->setText("<font color='black'> 88888 km");
+
+ gridLayout->addWidget(m_indicatorButton, 0, 0);
+ gridLayout->addWidget(m_distanceTextLabel, 1, 0);
+ setFixedSize(85, 100);
+
+ setLayout(gridLayout);
+
+ QSettings settings(DIRECTORY_NAME, FILE_NAME);
+ QPoint savedLocation = settings.value(DIRECTION_INDICATOR_BUTTON_POSITION,
+ QPoint(DIRECTION_INDICATOR_POSITION_X,
+ DIRECTION_INDICATOR_POSITION_Y)).toPoint();
+
+ if(savedLocation.x() > DEFAULT_SCREEN_WIDTH || savedLocation.y() > DEFAULT_SCREEN_HEIGHT) {
+ savedLocation.rx() = DIRECTION_INDICATOR_POSITION_X;
+ savedLocation.ry() = DIRECTION_INDICATOR_POSITION_Y;
+ }
+
+ move(savedLocation);
+
+ m_dragStartTimer = new QTimer(this);
+ m_dragStartTimer->setSingleShot(true);
+ m_dragStartTimer->setInterval(DRAG_INIT_TIME);
+
+ m_forceReleaseTimer = new QTimer(this);
+ m_forceReleaseTimer->setSingleShot(true);
+ m_forceReleaseTimer->setInterval(FORCE_RELEASE_TIME);
+
+ connect(m_indicatorButton, SIGNAL(pressed()),
+ m_dragStartTimer, SLOT(start()));
+ connect(m_indicatorButton, SIGNAL(released()),
+ m_dragStartTimer, SLOT(stop()));
+
+ connect(m_dragStartTimer, SIGNAL(timeout()),
+ this, SLOT(timerExpired()));
+ connect(m_forceReleaseTimer, SIGNAL(timeout()),
+ this, SLOT(forceMouseRelease()));
+}
+
+void IndicatorButtonPanel::mouseMoveEvent(QMouseEvent *event)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ if(m_isDraggable) {
+ if (event->buttons() & Qt::LeftButton) {
+ QPoint newLocation = mapToParent(event->pos()) - m_dragPosition;
+
+ if (newLocation.x() < SIDEBAR_WIDTH)
+ newLocation.rx() = SIDEBAR_WIDTH;
+ else if (newLocation.x() > m_screenSize.width() - width() - SIDEBAR_WIDTH)
+ newLocation.rx() = m_screenSize.width() - width() - SIDEBAR_WIDTH;
+
+ if (newLocation.y() < 0)
+ newLocation.ry() = 0;
+ else if (newLocation.y() > m_screenSize.height() - height())
+ newLocation.ry() = m_screenSize.height() - height();
+
+ move(newLocation);
+ }
+ } else {
+ if(!rect().contains(event->pos()))
+ m_dragStartTimer->stop();
+ }
+}
+
+void IndicatorButtonPanel::mousePressEvent(QMouseEvent *event)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ if (event->button() == Qt::LeftButton)
+ m_dragPosition = event->pos();
+
+ m_dragStartTimer->start();
+}
+
+void IndicatorButtonPanel::mouseReleaseEvent(QMouseEvent *event)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_dragStartTimer->stop();
+
+ Q_UNUSED(event);
+ if(m_isDraggable) {
+ setDraggable(false);
+
+// QSettings settings(DIRECTORY_NAME, FILE_NAME);
+// settings.setValue(DIRECTION_INDICATOR_BUTTON_POSITION, pos());
+
+ releaseMouse();
+
+ m_indicatorButton->setDown(false);
+ }
+}
+
+void IndicatorButtonPanel::paintEvent(QPaintEvent *event)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ Q_UNUSED(event);
+
+ QPainter painter(this);
+
+ if(m_isDraggable) {
+ QPainterPath backgroundPath;
+ backgroundPath.addRoundedRect(this->rect(), ROUNDING_RADIUS, ROUNDING_RADIUS);
+ painter.setRenderHint(QPainter::Antialiasing);
+ painter.fillPath(backgroundPath, QBrush(Qt::Dense4Pattern));
+ painter.setPen(Qt::black);
+ }
+
+// painter.setFont(QFont(NOKIA_FONT_SMALL));
+// painter.setPen(Qt::black);
+// painter.drawText(m_distanceTextLabel);
+}
+
+void IndicatorButtonPanel::setDraggable(bool mode, QPoint eventPosition)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_isDraggable = mode;
+
+ if(mode) {
+ grabMouse();
+ m_forceReleaseTimer->start();
+ m_dragPosition = eventPosition;
+ } else {
+ m_forceReleaseTimer->stop();
+ }
+ update();
+}
+
+void IndicatorButtonPanel::screenResized(const QSize &newSize)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ int oldHeight = 0;
+ int oldWidth = 0;
+
+ if(m_screenSize.height() < 0)
+ oldHeight = DEFAULT_NON_FULLSCREEN_HEIGHT;
+ else
+ oldHeight = m_screenSize.height();
+
+ if(m_screenSize.width() < 0)
+ oldWidth = DEFAULT_SCREEN_WIDTH;
+ else
+ oldWidth = m_screenSize.width();
+
+ m_screenSize = newSize;
+
+ QPoint resizedPosition = pos();
+ if(resizedPosition.x() > (newSize.width() - rect().width()))
+ resizedPosition.rx() = newSize.width() - rect().width();
+ else if (resizedPosition.x() < SIDEBAR_WIDTH)
+ resizedPosition.rx() = SIDEBAR_WIDTH;
+ if(resizedPosition.y() > (newSize.height() - rect().height()))
+ resizedPosition.ry() = newSize.height() - rect().height();
+ else if (resizedPosition.y() < 0)
+ resizedPosition.ry() = 0;
+
+ if((pos().y() + rect().center().y()) > (oldHeight/2))
+ resizedPosition.ry() = newSize.height() - (oldHeight - pos().y());
+
+ if((pos().x() + rect().center().x()) > (oldWidth/2))
+ resizedPosition.rx() = newSize.width() - (oldWidth - pos().x());
+
+ move(resizedPosition);
+}
+
+void IndicatorButtonPanel::forceMouseRelease()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ releaseMouse();
+ setDraggable(false);
+}
+
+void IndicatorButtonPanel::timerExpired()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ setDraggable(true, m_dragPosition);
+}
+
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Pekka Nissinen - pekka.nissinen@ixonos.com
+ Kaj Wallin - kaj.wallin@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 INDICATORBUTTONPANEL_H
+#define INDICATORBUTTONPANEL_H
+
+#include <QGraphicsItem>
+#include <QGridLayout>
+#include <QTimer>
+#include <QWidget>
+#include <QLabel>
+#include <QLineEdit>
+
+#include "indicatorbutton.h"
+
+/**
+ * @brief Panel for zoom buttons
+ *
+ * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
+ * @author Kaj Wallin - kaj.wallin (at) ixonos.com
+ */
+class IndicatorButtonPanel : public QWidget
+{
+ Q_OBJECT
+
+public:
+ /**
+ * @brief Constructor
+ *
+ * @param parent Parent
+ */
+ IndicatorButtonPanel(QWidget *parent = 0);
+
+/*******************************************************************************
+ * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ ******************************************************************************/
+protected:
+ /**
+ * @brief Move event for the zoom button panel
+ *
+ * @param event Event
+ */
+ void mouseMoveEvent(QMouseEvent *event);
+
+ /**
+ * @brief Press event for the zoom button panel
+ *
+ * @param event Event
+ */
+ void mousePressEvent(QMouseEvent *event);
+
+ /**
+ * @brief Event handler for mouse release events
+ *
+ * @param event Mouse event
+ */
+ void mouseReleaseEvent(QMouseEvent *event);
+
+ /**
+ * @brief Event handler for paint events
+ *
+ * Paints the panel
+ * @param event Paint event
+ */
+ void paintEvent(QPaintEvent *event);
+
+/*******************************************************************************
+ * MEMBER FUNCTIONS AND SLOTS
+ ******************************************************************************/
+public:
+// /**
+// * @brief Getter for the zoom in button
+// *
+// * @return Pointer to the zoomInButton
+// */
+// const IndicatorButton* IndicatorButtonPanel::indicatorButton();
+
+public slots:
+// /**
+// * @brief Disables the zoom in button
+// */
+// void disableZoomInButton();
+
+// /**
+// * @brief Disables the zoom out button
+// */
+// void disableZoomOutButton();
+
+// /**
+// * @brief Reset zoom button states to normal
+// */
+// void resetButtons();
+
+ /**
+ * @brief Toggle zoom panel draggability
+ */
+ void setDraggable(bool mode, QPoint eventPosition = QPoint(0,0));
+
+ /**
+ * @brief Slot to redraw the panel after window resize event
+ *
+ * @param size Size of the new screen
+ */
+ void screenResized(const QSize &size);
+
+private slots:
+ /**
+ * @brief Safeguard slot to release mouse grab if something goes horribly wrong
+ */
+ void forceMouseRelease();
+
+ /**
+ * @brief Slot that handles drag initialization once timer has timed out
+ */
+ void timerExpired();
+
+/*******************************************************************************
+ * DATA MEMBERS
+ ******************************************************************************/
+private:
+ bool m_isDraggable; ///< Boolean for tracking the draggability state
+
+ QLabel *m_distanceTextLabel; ///< Pointer to locationLabel
+
+ QPoint m_dragPosition; ///< Location from where the widget is grabbed
+
+// QIcon::Mode m_zoomInMode; ///< Store for zoom in button mode before dragging
+// QIcon::Mode m_zoomOutMode; ///< Store for zoom out button mode before dragging
+
+ QSize m_screenSize; ///< Store for the screen size
+
+ QTimer *m_dragStartTimer; ///< Timer to init draggability of the zoom panel
+ QTimer *m_forceReleaseTimer; ///< Timer to run forceMouseRelease;
+
+ IndicatorButton *m_indicatorButton; ///< Button for zoom in
+
+};
+
+#endif // INDICATORBUTTONPANEL_H
#include "settingsdialog.h"
#include "userinfopanel.h"
#include "zoombuttonpanel.h"
+#include "indicatorbuttonpanel.h"
#include "mainwindow.h"
m_password(),
m_webView(0),
m_fullScreenButton(0),
- m_indicatorButton(0),
+// m_indicatorButton(0),
+ m_indicatorButtonPanel(0),
m_mapScale(0),
m_cookieJar(0)
{
m_osmLicense->stackUnder(m_zoomButtonPanel);
}
m_ownLocationCrosshair->stackUnder(m_osmLicense);
- m_indicatorButton->stackUnder(m_ownLocationCrosshair);
- m_mapScale->stackUnder(m_indicatorButton);
+ m_indicatorButtonPanel->stackUnder(m_ownLocationCrosshair);
+ m_mapScale->stackUnder(m_indicatorButtonPanel);
m_mapView->stackUnder(m_mapScale);
grabZoomKeys(true);
m_friendsListPanel, SLOT(friendImageReady(User*)));
}
-void MainWindow::buildIndicatorButton()
+void MainWindow::buildIndicatorButtonPanel()
{
qDebug() << __PRETTY_FUNCTION__;
- m_indicatorButton = new IndicatorButton(this);
+ m_indicatorButtonPanel = new IndicatorButtonPanel(this);
- connect(m_indicatorButton, SIGNAL(autoCenteringTriggered(bool)),
- this, SIGNAL(autoCenteringTriggered(bool)));
+// connect(m_indicatorButton, SIGNAL(autoCenteringTriggered(bool)),
+// this, SIGNAL(autoCenteringTriggered(bool)));
- connect(m_mapView, SIGNAL(viewResized(QSize)),
- m_indicatorButton, SLOT(screenResized(QSize)));
+// connect(m_mapView, SIGNAL(viewResized(QSize)),
+// m_indicatorButton, SLOT(screenResized(QSize)));
- connect(this, SIGNAL(directionIndicatorValuesUpdate(qreal, qreal, bool)),
- m_indicatorButton, SLOT(updateValues(qreal, qreal, bool)));
+// connect(this, SIGNAL(directionIndicatorValuesUpdate(qreal, qreal, bool)),
+// m_indicatorButton, SLOT(updateValues(qreal, qreal, bool)));
}
void MainWindow::buildInformationBox(const QString &message, bool modal)
buildOsmLicense();
buildManualLocationCrosshair();
buildFullScreenButton();
- buildIndicatorButton();
+ buildIndicatorButtonPanel();
buildMapScale();
connect(m_mapView, SIGNAL(viewScrolled(SceneCoordinate)),
{
qDebug() << __PRETTY_FUNCTION__;
- m_indicatorButton->setChecked(enabled);
+// m_indicatorButton->setChecked(enabled);
}
class FacebookAuthentication;
class FullScreenButton;
class FriendListPanel;
-class IndicatorButton;
+class IndicatorButtonPanel;
class GeoCoordinate;
class MapScale;
class MapScene;
/**
* @brief Build direction indicator button and connect slots
*/
- void buildIndicatorButton();
+ void buildIndicatorButtonPanel();
/**
* @brief Builds information box with message.
FriendListPanel *m_friendsListPanel; ///< Instance of friends list panel
FullScreenButton *m_fullScreenButton; ///< Instance of the fullscreen toggle button
- IndicatorButton *m_indicatorButton; ///< Instance of direction indicator button
+ IndicatorButtonPanel *m_indicatorButtonPanel; ///< Instance of direction indicator button
MapScale *m_mapScale; ///< Instance of the map scale
MapView *m_mapView; ///< Instance of the map view
NetworkCookieJar *m_cookieJar; ///< Placeholder for QNetworkCookies
* @var DIRECTION_INDICATOR_POSITION_X
*/
const int DIRECTION_INDICATOR_POSITION_X = 10 + PANEL_PEEK_AMOUNT;
-const int DIRECTION_INDICATOR_POSITION_Y = 315; ///< Vertical position of direction indicator button
+const int DIRECTION_INDICATOR_POSITION_Y = 290; ///< Vertical position of direction indicator button
const QString DIRECTION_INDICATOR_BUTTON_POSITION = "Direction_Indicator_Position";