}
else if(replyArray == "") {
qDebug() << "No error, update was successful";
- emit updateWasSuccessful();
+ if (url.toString().contains(UPDATE_LOCATION.toAscii()))
+ emit updateWasSuccessful();
}
else {
// Street address ready
ui/panelcommon.h
QT += network \
webkit
-DEFINES += QT_NO_DEBUG_OUTPUT
+#DEFINES += QT_NO_DEBUG_OUTPUT
!maemo5 {
message(QJson built in)
message(Make sure you have QJson development headers installed)
#include "../user/user.h"
const QString BACKGROUND_PATH = ":/res/images/list_item.png"; ///< Background image path
-const QString BACKGROUND_TOP_PATH = ":/res/images/list_item_top.png"; ///< Background image path
-const QString BACKGROUND_MIDDLE_PATH = ":/res/images/list_item_middle.png"; ///< Background image path
-const QString BACKGROUND_BOTTOM_PATH = ":/res/images/list_item_bottom.png"; ///< Background image path
+//const QString BACKGROUND_TOP_PATH = ":/res/images/list_item_top.png"; ///< Background image path
+//const QString BACKGROUND_MIDDLE_PATH = ":/res/images/list_item_middle.png"; ///< Background image path
+//const QString BACKGROUND_BOTTOM_PATH = ":/res/images/list_item_bottom.png"; ///< Background image path
const QString CLOCK_PATH = ":/res/images/clock.png"; ///< Clock image path
const QString COMPASS_PATH = ":/res/images/compass.png"; ///< Compass image path
const QString ENVELOPE_PATH = ":/res/images/envelope.png"; ///< Envelope image path
*/
const QString STYLESHEET = "QWidget#listItem { border-image: url(:/res/images/list_item.png) 20%; " \
"border-width: 20px 14px 16px 14px; } " \
- "QLabel { color: #989898; }" \
- "#nameLabel { color: #ffffff }";
+ "QLabel { font-size: 13pt; color: #989898; }" \
+ "#nameLabel { font-size: 18pt; color: #ffffff }";
FriendListItem::FriendListItem(QWidget *parent)
: QWidget(parent)
setFont(NOKIA_FONT_SMALL);
- setStyleSheet(STYLESHEET);
+// setStyleSheet(STYLESHEET);
setMinimumSize(ITEM_MIN_WIDTH, ITEM_MIN_HEIGHT);
setMaximumSize(ITEM_MIN_WIDTH, ITEM_MAX_HEIGHT);
+
+ BACKGROUND_TOP_PATH.load(":/res/images/list_item_top.png"); ///< Background image path
+ BACKGROUND_MIDDLE_PATH.load(":/res/images/list_item_middle.png"); ///< Background image path
+ BACKGROUND_BOTTOM_PATH.load(":/res/images/list_item_bottom.png"); ///< Background image path
}
void FriendListItem::setData(User *user)
void FriendListItem::paintEvent(QPaintEvent *event)
{
-// qDebug() << __PRETTY_FUNCTION__ << " " << event->rect();
- Q_UNUSED(event);
+ qDebug() << __PRETTY_FUNCTION__ << " " << event->rect();
+
+ QPainter painter(this);
+
+// QRect topRect = QRect(event->rect().left(), event->rect().y(), event->rect().width(), 20);
+// QRect middleRect = QRect(topRect.left(), topRect.bottom() + 1, event->rect().width(),
+// event->rect().height() - 20 - 15);
+// QRect bottomRect = QRect(topRect.left(), middleRect.bottom() + 1, event->rect().width(),
+// 15);
+
+ int height = event->rect().height();
+
+ if (event->rect().height() < 148)
+ height = 148;
- QStyleOption option;
- option.init(this);
+ QRect topRect = QRect(0, 0, event->rect().width(), 20);
+ QRect middleRect = QRect(0, topRect.bottom() + 1, event->rect().width(),
+ height - 20 - 15);
+ QRect bottomRect = QRect(topRect.left(), middleRect.bottom() + 1, event->rect().width(),
+ 15);
- QStylePainter painter(this);
- style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+ painter.drawPixmap(topRect, BACKGROUND_TOP_PATH);
+ painter.drawPixmap(middleRect, BACKGROUND_MIDDLE_PATH);
+ painter.drawPixmap(bottomRect, BACKGROUND_BOTTOM_PATH);
}
QLabel *m_updatedLabel; ///< Updated label
User *m_user; ///< User data
+
+ QPixmap BACKGROUND_TOP_PATH; ///< Background image path
+ QPixmap BACKGROUND_MIDDLE_PATH; ///< Background image path
+ QPixmap BACKGROUND_BOTTOM_PATH; ///< Background image path
};
#endif // FRIENDLISTITEM_H
{
qDebug() << __PRETTY_FUNCTION__;
m_friendsPanelVBox = new QVBoxLayout(this);
+ m_friendsPanelVBox->setMargin(0);
+ m_friendsPanelVBox->setSpacing(0);
this->setLayout(m_friendsPanelVBox);
m_friendsPanelExpandButton = new QPushButton("Friends", this);
m_friendsPanelVBox->addWidget(m_friendsPanelExpandButton);
friendListScroll->setWidget(m_friendListView);
friendListScroll->setWidgetResizable(true);
friendListScroll->viewport()->setAutoFillBackground(false);
-
- this->setAutoFillBackground(true);
+ friendListScroll->widget()->setAutoFillBackground(false);
m_friendsPanelVBox->addWidget(friendListScroll);
m_friendsPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos"));
m_friendsPanelStateMachine->start();
+
+ //Debug
+ QList<User *> friendList;
+ for (int i = 0; i < 10; ++i)
+ friendList.append(new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
+ QString("Hello world! Hello world! Hello world! Hello world! "),
+ QUrl(), QString("2 days ago"), false, QString("id")));
+ friendInfoReceived(friendList);
+
+ this->setObjectName("UserPanel");
+ //this->setStyleSheet(QString("#UserPanel{background-image: url(:/res/images/personal_info_bckgrnd.png)}"));
+
+ this->setAutoFillBackground(true);
+ QPalette pal = palette();
+ pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
+ setPalette(pal);
}
void FriendListPanel::friendInfoReceived(QList<User *> &friendList)
FriendListItem *item = new FriendListItem(m_friendListView);
item->setData(user);
m_friendListView->addWidget(item);
+ FriendListItem *item2 = new FriendListItem(m_friendListView);
+ item2->setData(user);
+ m_friendListView->addWidget(item2);
+ FriendListItem *item3 = new FriendListItem(m_friendListView);
+ item3->setData(user);
+ m_friendListView->addWidget(item3);
+ FriendListItem *item4 = new FriendListItem(m_friendListView);
+ item4->setData(user);
+ m_friendListView->addWidget(item4);
}
}
width - FRIENDPANEL_WIDTH + MARGIN_CORRECTION, PANEL_TOP_Y));
this->move(width-PANEL_PEEK_AMOUNT, PANEL_TOP_Y);
}
+
+void FriendListPanel::paintEvent(QPaintEvent *)
+{
+ QStyleOption option;
+ option.init(this);
+
+ QStylePainter painter(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+}
*/
FriendListPanel(QWidget *parent = 0);
+protected:
+ void paintEvent(QPaintEvent *);
+
/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
QHBoxLayout *mapViewLayout = new QHBoxLayout;
- //DEBUG
-// QVBoxLayout *mapControlLayout = new QVBoxLayout;
-// QWidget *mapControl = new QWidget(this);
-// mapControl->setLayout(mapControlLayout);
-// search = new QPushButton("Search", this);
-// zoomOut = new QPushButton("-", this);
-// zoomIn = new QPushButton("+", this);
-// mapControlLayout->addWidget(&latLine);
-// mapControlLayout->addWidget(&lonLine);
-// mapControlLayout->addWidget(search);
-// mapControlLayout->addWidget(zoomIn);
-// mapControlLayout->addWidget(zoomOut);
-// mapViewLayout->addWidget(mapControl);
-// connect(search, SIGNAL(clicked()), this, SLOT(searchMap()));
-// connect(zoomIn, SIGNAL(clicked()), mapEngine, SLOT(zoomIn()));
-// connect(zoomOut, SIGNAL(clicked()), mapEngine, SLOT(zoomOut()));
- //DEBUG
osmLicense = new QLabel(this);
osmLicense->setAttribute(Qt::WA_TranslucentBackground, true);
#include <QtCore>
#include "map/mapcommon.h"
-const int PANEL_PEEK_AMOUNT = 30; ///< Amount of pixels shown when panel is closed
+const int PANEL_PEEK_AMOUNT = 60; ///< Amount of pixels shown when panel is closed
const int FRIENDPANEL_WIDTH = 420; ///< Width of the friends list panel
const int FRIENDPANEL_HEIGHT = DEFAULT_SCREEN_HEIGHT; ///< Height of the friends list panel