<qresource prefix="/">
<file>resources/facebook_user_64.png</file>
<file>resources/compas_small.png</file>
- <file>resources/personal_infotab_background.png</file>
<file>resources/reload_icon.png</file>
<file>resources/sendPosition_icon.png</file>
<file>resources/list_small.png</file>
<file>resources/clock_small.png</file>
+ <file>resources/arrow_left.png</file>
+ <file>resources/arrow_right.png</file>
</qresource>
</RCC>
map/maptile.cpp \
map/mapfetcher.cpp \
ui/pixmap.cpp \
- ui/personalinfotab.cpp
+ ui/infotab.cpp
HEADERS += ui/mainwindow.h \
ui/mapviewscreen.h \
ui/listviewscreen.h \
map/mapfetcher.h \
common.h \
ui/pixmap.h \
- ui/personalinfotab.h
+ ui/infotab.h
QT += network \
webkit
--- /dev/null
+#include "infotab.h"
+
+InfoTab::InfoTab(QWidget *parent)
+ : QWidget(parent, Qt::FramelessWindowHint)
+{
+ layout = new QGridLayout(this);
+ userPicture = new QLabel;
+ userNameLabel = new QLabel;
+ messageLabel = new QLabel;
+ addressLabel = new QLabel;
+ timeLabel = new QLabel;
+ QLabel *clockLabel = new QLabel;
+ QLabel *envelopeLabel = new QLabel;
+ QLabel *compassLabel = new QLabel;
+ QToolButton *sendLocationButton = new QToolButton;
+ QToolButton *updateStatusMessageButton = new QToolButton;
+
+ sendLocationButton->setIcon(QIcon(QPixmap(":/resources/reload_icon.png")));
+ updateStatusMessageButton->setIcon(QIcon(QPixmap(":/resources/sendPosition_icon.png")));
+
+
+ clockLabel->setPixmap(QPixmap(":/resources/clock_small.png"));
+ envelopeLabel->setPixmap(QPixmap(":/resources/list_small.png"));
+ compassLabel->setPixmap(QPixmap(":/resources/compas_small.png"));
+ layout->addWidget(userPicture,0,0,4,1);
+ layout->addWidget(userNameLabel,0,2,1,2);
+ layout->addWidget(clockLabel,1,1,1,1);
+ layout->addWidget(envelopeLabel,2,1,1,1);
+ layout->addWidget(compassLabel,3,1,1,1);
+ layout->addWidget(timeLabel,1,2,1,1);
+ layout->addWidget(messageLabel,2,2,1,1);
+ layout->addWidget(addressLabel,3,2,1,1);
+ layout->addWidget(sendLocationButton,0,3,2,1);
+ layout->addWidget(updateStatusMessageButton,1,3,2,1);
+
+}
+
+InfoTab::~InfoTab()
+{
+ if (userPicture)
+ delete userPicture;
+ if (userNameLabel)
+ delete userNameLabel;
+ if (messageLabel)
+ delete messageLabel;
+ if (addressLabel)
+ delete addressLabel;
+ if (timeLabel)
+ delete timeLabel;
+ if (layout)
+ delete layout;
+ userPicture=NULL;
+ userNameLabel=NULL;
+ messageLabel=NULL;
+ addressLabel=NULL;
+ timeLabel=NULL;
+ layout=NULL;
+}
+
+void InfoTab::paintEvent(QPaintEvent *aPaintEvent)
+{
+ //Look and feel settings
+ //setAutoFillBackground(true);
+ QPalette qpalette;
+ QColor myColor(Qt::lightGray);
+ myColor.setAlpha(100);
+ qpalette.setColor(QPalette::Background,myColor);
+ setPalette(qpalette);
+ int roundness(6);
+
+
+ QRect widgetRect = this->rect();
+ QPainter painter(this);
+ painter.save();
+
+ painter.setRenderHint(QPainter::Antialiasing);
+ QPainterPath roundedRect;
+ roundedRect.addRoundedRect(1,1,widgetRect.width() - 2, widgetRect.height()-2,roundness,roundness);
+
+ painter.setClipPath(roundedRect);
+ QRegion maskRegion = painter.clipRegion();
+
+ setMask(maskRegion);
+
+ painter.fillPath(roundedRect,QBrush(myColor));
+ painter.restore();
+}
+
+void InfoTab::setAvatar(const QPixmap &avat)
+{
+ avatar = avat;
+ userPicture->setPixmap(avat);
+}
+
+void InfoTab::setUserName(const QString &usernam)
+{
+ if(userName == usernam)
+ return;
+ userName = usernam;
+ userNameLabel->setText(userName);
+}
+
+void InfoTab::setMessageText(const QString &text)
+{
+ if(messageText == text)
+ return;
+ messageText = text;
+ messageLabel->setText(messageText);
+}
+
+void InfoTab::setAddress(const QString &addr)
+{
+ if(address == addr)
+ return;
+ address = addr;
+ addressLabel->setText(address);
+}
+
+void InfoTab::setTime(const QString &tim)
+{
+ if(time == tim)
+ return;
+ time = tim;
+ timeLabel->setText(time);
+}
--- /dev/null
+#ifndef INFOTAB_H
+#define INFOTAB_H
+
+#include <QtGui>
+#include <QWidget>
+
+class InfoTab : public QWidget
+{
+ Q_OBJECT
+public:
+ InfoTab(QWidget *parent=0);
+ ~InfoTab();
+public slots:
+ void setAvatar(const QPixmap &);
+ void setUserName(const QString &);
+ void setMessageText(const QString &);
+ void setAddress(const QString &);
+ void setTime(const QString &);
+protected:
+ void paintEvent(QPaintEvent *aPaintEvent);
+private:
+ QLabel *userPicture;
+ QLabel *userNameLabel;
+ QLabel *messageLabel;
+ QLabel *addressLabel;
+ QLabel *timeLabel;
+ QGridLayout *layout;
+ QString messageText;
+ QString userName;
+ QString address;
+ QString time;
+ QPixmap avatar;
+};
+
+#endif // INFOTAB_H
*/
#include <QGraphicsScene>
-#include <QGraphicsWidget>
#include <QGraphicsView>
+#include <QGraphicsWidget>
#include <QtGui/QVBoxLayout>
+#include <QGraphicsProxyWidget>
#include <QStateMachine>
#include "listviewscreen.h"
#include "pixmap.h"
-#include "ui/personalinfotab.h"
-#include <QGraphicsProxyWidget>
+#include "infotab.h"
+
ListViewScreen::ListViewScreen(QWidget *parent)
: QWidget(parent)
{
- Pixmap *infoTab = new Pixmap(QPixmap(":/resources/personal_infotab_background.png")); //350x140 pix
- PersonalInfoTab = myTab(this);
- // Pixmap *userPic = new Pixmap(QPixmap(":/resources/facebook_user_64.png")); //64x64 pix
- // Pixmap *envelope = new Pixmap(QPixmap(":/resources/list_small.png"));
- // Pixmap *compass = new Pixmap(QPixmap(":/resources/compas_small.png"));
- // Pixmap *clock = new Pixmap(QPixmap(":/resources/clock_small.png"));
- // Pixmap *reload = new Pixmap(QPixmap(":/resources/reload_icon.png"));
- // Pixmap *reloca = new Pixmap(QPixmap(":/resources/sendPosition_icon.png"));
+ Pixmap *arrowbutton = new Pixmap(QPixmap(":/resources/arrow_right.png"));
+
+ InfoTab *personalInfo = new InfoTab;
+ personalInfo->setAvatar(QPixmap(":/resources/facebook_user_64.png"));
+ personalInfo->setUserName("Fred Facebook");
+ personalInfo->setMessageText("Hello Maemo Situare !");
+ personalInfo->setTime("1 hour ago");
+ personalInfo->setAddress("Kiviharjunlenkki 1E, 91910 Oulu");
- QGraphicsScene *scene= new QGraphicsScene(0,0,700,360);
- scene->setBackgroundBrush(Qt::white);
- scene->addItem(infoTab);
- // scene->addItem(userPic);
- // scene->addItem(envelope);
- // scene->addItem(compass);
- // scene->addItem(clock);
- // scene->addItem(reload);
- // scene->addItem(reloca);
QGraphicsProxyWidget *widgetProxy = new QGraphicsProxyWidget();
- widgetProxy->setWidget(myTab);
+ widgetProxy->setWidget(personalInfo);
+
+ QGraphicsScene *scene= new QGraphicsScene(0,0,700,360);
+ QGraphicsWidget *graphWidget = new QGraphicsWidget();
+ graphLayout = new QGraphicsLinearLayout(graphWidget);
+ graphLayout->setOrientation(Qt::Horizontal);
+ graphLayout->addItem(widgetProxy);
+ scene->setBackgroundBrush(Qt::white);
+ //scene->addItem(widgetProxy);
+ scene->addItem(graphWidget);
+ scene->addItem(arrowbutton);
QGraphicsView *view = new QGraphicsView(scene);
view->setFrameStyle(0);
machine->setInitialState(state1);
// State 1
- state1->assignProperty(infoTab,"pos",QPointF(-330,110));
- //state1->assignProperty(userPic,"pos",QPointF(-320,120));
- //state1->assignProperty(envelope,"pos",QPointF(-246,165));
- //state1->assignProperty(compass,"pos",QPointF(-246,190));
- //state1->assignProperty(clock,"pos",QPointF(-246,220));
- //state1->assignProperty(reload,"pos",QPointF(-60,120));
- //state1->assignProperty(reloca,"pos",QPointF(-60,180));
+ state1->assignProperty(graphWidget,"pos",QPointF(-(personalInfo->width()),(scene->height()/4)));
+ //state1->assignProperty(arrowbutton,"pos",QPointF(0,135));
+ state1->assignProperty(arrowbutton,"pos",QPointF(0,(scene->height()/2 - (arrowbutton->boundingRect().height()/2))));
// State 2
- state2->assignProperty(infoTab,"pos",QPointF(0,110));
- //state2->assignProperty(userPic,"pos",QPointF(10,120));
- //state2->assignProperty(envelope,"pos",QPointF(84,165));
- //state2->assignProperty(compass,"pos",QPointF(84,190));
- //state2->assignProperty(clock,"pos",QPointF(84,220));
- //state2->assignProperty(reload,"pos",QPointF(290,120));
- //state2->assignProperty(reloca,"pos",QPointF(290,180));
-
- QAbstractTransition *trans1 = state1->addTransition(infoTab,SIGNAL(clicked()),state2);
- trans1->addAnimation(new QPropertyAnimation(infoTab,"pos"));
- /*trans1->addAnimation(new QPropertyAnimation(userPic,"pos"));
- trans1->addAnimation(new QPropertyAnimation(envelope,"pos"));
- trans1->addAnimation(new QPropertyAnimation(compass,"pos"));
- trans1->addAnimation(new QPropertyAnimation(clock,"pos"));
- trans1->addAnimation(new QPropertyAnimation(reload,"pos"));
- trans1->addAnimation(new QPropertyAnimation(reloca,"pos"));*/
-
- QAbstractTransition *trans2 = state2->addTransition(infoTab,SIGNAL(clicked()),state1);
- trans2->addAnimation(new QPropertyAnimation(infoTab,"pos"));
- /* trans2->addAnimation(new QPropertyAnimation(userPic,"pos"));
- trans2->addAnimation(new QPropertyAnimation(envelope,"pos"));
- trans2->addAnimation(new QPropertyAnimation(compass,"pos"));
- trans2->addAnimation(new QPropertyAnimation(clock,"pos"));
- trans2->addAnimation(new QPropertyAnimation(reload,"pos"));
- trans2->addAnimation(new QPropertyAnimation(reloca,"pos"));*/
+ state2->assignProperty(graphWidget,"pos",QPointF(0,(scene->height()/4)));
+ //state2->assignProperty(arrowbutton,"pos",QPointF(0,135));
+ state2->assignProperty(arrowbutton,"pos",QPointF(0,(scene->height()/2 - (arrowbutton->boundingRect().height()/2))));
+
+ QAbstractTransition *trans1 = state1->addTransition(arrowbutton,SIGNAL(clicked()),state2);
+ trans1->addAnimation(new QPropertyAnimation(graphWidget,"pos"));
+ trans1->addAnimation(new QPropertyAnimation(arrowbutton,"pos"));
+
+ QAbstractTransition *trans2 = state2->addTransition(arrowbutton,SIGNAL(clicked()),state1);
+ trans2->addAnimation(new QPropertyAnimation(graphWidget,"pos"));
+ trans2->addAnimation(new QPropertyAnimation(arrowbutton,"pos"));
machine->start();
{
if (vbox)
delete vbox;
+ if (graphLayout)
+ delete graphLayout;
+ vbox=NULL;
+ graphLayout=NULL;
}
~ListViewScreen();
private:
QVBoxLayout *vbox;
+ QGraphicsLinearLayout *graphLayout;
};
#endif // LISTVIEWTAB_H
*/
#include "mapviewscreen.h"
+#include "infotab.h"
#include "../map/mapview.h"
#include "../map/mapengine.h"
+#include "infotab.h"
MapViewScreen::MapViewScreen(QWidget *parent)
: QWidget(parent)
+++ /dev/null
-#include "personalinfotab.h"
-
-PersonalInfoTab::PersonalInfoTab(QWidget *parent)
- : QWidget(parent)
-{
- QGridLayout *layout = new QGridLayout(this);
- QLabel *userPicture = new QLabel;
- QLabel *userNameLabel = new QLabel;
- QLabel *messageLabel = new QLabel;
- QLabel *addressLabel = new QLabel;
- QLabel *timeLabel = new QLabel;
- QLabel *clockLabel = new QLabel;
- QLabel *envelopeLabel = new QLabel;
- QLabel *compassLabel = new QLabel;
-
- //QPixmap pixmap(350,140);
- //pixmap.fill(Qt::gray);
- //QPainter painter(&pixmap);
- //painter.setPen(Qt::black);
-
-
- userPicture->setPixmap(QPixmap(":/resources/facebook_user_64.png"));
- clockLabel->setPixmap(QPixmap(":/resources/clock_small.png"));
- envelopeLabel->setPixmap(QPixmap(":/resources/list_small.png"));
- compassLabel->setPixmap(QPixmap(":/resources/compas_small.png"));
- layout->addWidget(userPicture,0,0,4,1);
- layout->addWidget(userNameLabel,0,1,1,2);
- layout->addWidget(clockLabel,1,1,1,1);
- layout->addWidget(envelopeLabel,2,1,1,1);
- layout->addWidget(compassLabel,3,1,1,1);
- layout->addWidget(timeLabel,1,2,1,1);
- layout->addWidget(messageLabel,2,2,1,1);
- layout->addWidget(addressLabel,3,2,1,1);
-
-}
-
-void PersonalInfoTab::setUserName(const QString &username)
-{
- userName = username;
-}
-
-void PersonalInfoTab::setMessageText(const QString &text)
-{
- message = text;
-}
-
-void PersonalInfoTab::setAddress(const QString &address)
-{
- this->address = address;
-}
-
-void PersonalInfoTab::setTime(const QString &time)
-{
- this->time = time;
-}
+++ /dev/null
-#ifndef PERSONALINFOTAB_H
-#define PERSONALINFOTAB_H
-
-#include <QtGui>
-
-class PersonalInfoTab : public QWidget
-{
- Q_OBJECT
-public:
- PersonalInfoTab(QWidget *parent=0);
-public slots:
- void setUserName(const QString &);
- void setMessageText(const QString &);
- void setAddress(const QString &);
- void setTime(const QString &);
-private:
- QString message;
- QString userName;
- QString address;
- QString time;
-};
-
-#endif // PERSONALINFOTAB_H
USA.
*/
-#ifndef PERSONALINFOTAB_H
-#define PERSONALINFOTAB_H
+#ifndef PIXMAP_H
+#define PIXMAP_H
#include <QtCore>
#include <QtGui>
QPixmap p;
};
-#endif // PERSONALINFOTAB_H
+#endif // PIXMAP_H