this point.
Reviewed by:
ui/settingsdialog.cpp \
map/maptilerequest.cpp \
ui/friendlistpanel.cpp \
- ui/userpanel.cpp
+ ui/userpanel.cpp \
+ ui/panelsidebar.cpp
HEADERS += ui/mainwindow.h \
ui/mapviewscreen.h \
ui/listviewscreen.h \
map/maptilerequest.h \
ui/friendlistpanel.h \
ui/userpanel.h \
- ui/panelcommon.h
+ ui/panelcommon.h \
+ ui/panelsidebar.h
QT += network \
webkit
DEFINES += QT_NO_DEBUG_OUTPUT
#include "userpanel.h"
#include "panelcommon.h"
+#include "panelsidebar.h"
+
MapViewScreen::MapViewScreen(QWidget *parent)
: QWidget(parent)
{
FriendListPanel *friendsListPanel = new FriendListPanel(this);
UserInfoPanel *userPanel = new UserInfoPanel(this);
+ PanelSideBar *userPanelSidebar = new PanelSideBar(this, "left");
+ PanelSideBar *friendsListPanelSidebar = new PanelSideBar(this, "right");
connect(mapView, SIGNAL(viewScrolled(QPoint)),
mapEngine, SLOT(setLocation(QPoint)));
friendsListPanel, SLOT(reDrawFriendsPanel(int,int)));
connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
userPanel, SLOT(reDrawUserPanel(int,int)));
+ connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
+ friendsListPanelSidebar, SLOT(reDrawSidebar(int,int)));
+
connect(this, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)),
friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
osmLicense->resize(osmLicense->fontMetrics().width(OSM_LICENSE),
osmLicense->fontMetrics().height());
- userPanel->stackUnder(friendsListPanel);
+ friendsListPanel->stackUnder(friendsListPanelSidebar);
+ userPanelSidebar->stackUnder(friendsListPanel);
+ userPanel->stackUnder(userPanelSidebar);
osmLicense->stackUnder(userPanel);
mapView->stackUnder(osmLicense);
--- /dev/null
+ /*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ 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 <QtGui>
+#include "panelsidebar.h"
+#include "panelcommon.h"
+
+PanelSideBar::PanelSideBar(QWidget *parent, QString side)
+ : QWidget(parent)
+{
+ if(side == "left") {
+ this->setObjectName("SidePanelLeft");
+ this->setStyleSheet(QString(
+ "#SidePanelLeft{background-image: url(:/res/images/side_bar_left.png)}"));
+ this->move(QPoint(0,0));
+ }
+ else if(side == "right"){
+ this->setObjectName("SidePanelRight");
+ this->setStyleSheet(QString(
+ "#SidePanelRight{background-image: url(:/res/images/side_bar_right.png)}"));
+ this->move(QPoint(851-21,0));
+ }
+ else {
+ qFatal("Illegal PanelSideBar 2nd argument");
+ }
+ this->resize(23,424);
+ this->setAttribute(Qt::WA_TransparentForMouseEvents, true);
+}
+
+void PanelSideBar::paintEvent(QPaintEvent *)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ QStyleOption option;
+ option.init(this);
+
+ QStylePainter painter(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+}
+
+void PanelSideBar::reDrawSidebar(int width, int height)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+ if(this->objectName() == "left");
+ this->move(width-21,0);
+}
--- /dev/null
+ /*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ 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 PANELSIDEBAR_H
+#define PANELSIDEBAR_H
+
+#include <QWidget>
+
+class PanelSideBar : public QWidget
+{
+ Q_OBJECT
+
+public:
+ PanelSideBar(QWidget *parent, QString side);
+
+/*******************************************************************************
+ * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ ******************************************************************************/
+protected:
+ /**
+ * @brief Draws stylesheet used in this class.
+ *
+ * @param * QPaintEvent unused
+ */
+ void paintEvent(QPaintEvent *);
+
+/*******************************************************************************
+ * MEMBER FUNCTIONS AND SLOTS
+ ******************************************************************************/
+public slots:
+ /**
+ * @brief Slot to redraw the sidebar after window resize event
+ *
+ * @param width Width of the window after resize
+ * @param height Height of the window after resize
+ */
+ void reDrawSidebar(int width, int height);
+};
+
+#endif // PANELSIDEBAR_H
m_userPanelVBox->addWidget(m_userPanelExpandButton);
m_userPanelVBox->addWidget(m_userPanelLabel);
- this->setAutoFillBackground(true);
+ // this->setAutoFillBackground(true);
// this->setAttribute(Qt::WA_TranslucentBackground);
// this->setWindowOpacity(0.5); //DEFUNCT
+// QPalette userPanelPalette;
+// userPanelPalette.setBrush(this->backgroundRole(),
+// QBrush(QImage(":/res/personal_info_bckgrnd.png")));
+// this->setPalette(userPanelPalette);
+
m_userPanelStateMachine = new QStateMachine(this);
m_userPanelStateClosed = new QState(m_userPanelStateMachine);
m_userPanelStateClosed->assignProperty(this, "pos", QPoint(
m_userPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos"));
m_userPanelStateMachine->start();
+ this->setObjectName("UserPanel");
+ this->setStyleSheet(QString(
+ "#UserPanel{background-image: url(:/res/images/personal_info_bckgrnd.png)}"));
}
void UserInfoPanel::reDrawUserPanel(int width, int height)
Q_UNUSED(width);
this->resize(USERPANEL_WIDTH,height + MARGIN_CORRECTION);
}
+
+void UserInfoPanel::paintEvent(QPaintEvent *)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ QStyleOption option;
+ option.init(this);
+
+ QStylePainter painter(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+}
UserInfoPanel(QWidget *parent = 0);
/*******************************************************************************
+ * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ ******************************************************************************/
+protected:
+ /**
+ * @brief Draws stylesheet used in this class.
+ *
+ * @param * QPaintEvent unused
+ */
+ void paintEvent(QPaintEvent *);
+
+/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
public slots: