USA.
*/
-#include "userinfo.h"
+#include <QFormLayout>
+#include <QLabel>
+#include <QMouseEvent>
+#include <QPainter>
+#include <QSettings>
+#include <QVBoxLayout>
-#include "../user/user.h"
#include "common.h"
#include "imagebutton.h"
+#include "user/user.h"
+
+#include "userinfo.h"
const int BACKGROUND_WIDTH = 368; ///< Width for item
const int BACKGROUND_TOP_HEIGHT = 20; ///< Height for item top
infoLayout->setMargin(0);
infoLayout->setSpacing(0);
- QHBoxLayout *buttonLayout = new QHBoxLayout();
- buttonLayout->setMargin(0);
- buttonLayout->setSpacing(0);
-
QLabel *envelopeLabel = new QLabel();
envelopeLabel->setPixmap(QPixmap(":/res/images/envelope.png"));
envelopeLabel->setContentsMargins(0, 0, MARGIN, 0);
m_updatedLabel = new QLabel();
m_updatedLabel->setWordWrap(true);
- ImageButton *updateFriendsButton = new ImageButton(this, ":/res/images/refresh.png",
- ":/res/images/refresh_s.png");
- ImageButton *updateStatusMessageButton = new ImageButton(this, ":/res/images/send_position.png",
- ":/res/images/send_position_s.png");
-
- buttonLayout->addWidget(updateFriendsButton);
- buttonLayout->addWidget(updateStatusMessageButton);
-
infoLayout->addRow(envelopeLabel, m_statusTextLabel);
infoLayout->addRow(compassLabel, m_locationLabel);
infoLayout->addRow(clockLabel, m_updatedLabel);
verticalLayout->addWidget(m_findButton, 0, Qt::AlignHCenter);
verticalLayout->addWidget(m_nameLabel, 0, Qt::AlignHCenter);
verticalLayout->addLayout(infoLayout);
- verticalLayout->addLayout(buttonLayout);
-
- connect(updateStatusMessageButton,SIGNAL(clicked()),
- this,SLOT(messageUpdate()));
-
- connect(updateFriendsButton,SIGNAL(clicked()),
- this, SIGNAL(refreshUserData()));
connect(m_findButton, SIGNAL(clicked()),
this, SLOT(findButtonClicked()));
QPainter painter(this);
QRect topRect = QRect(0, MARGIN, BACKGROUND_WIDTH, BACKGROUND_TOP_HEIGHT);
+///< @todo Overlaps with topRect?
QRect middleRect = QRect(0, topRect.bottom(), BACKGROUND_WIDTH,
this->height() - BACKGROUND_TOP_HEIGHT - BACKGROUND_BOTTOM_HEIGHT);
+///< @todo Overlaps with middleRect
QRect bottomRect = QRect(topRect.left(), middleRect.bottom(), BACKGROUND_WIDTH,
BACKGROUND_BOTTOM_HEIGHT);
textParam.truncate(index);
textParam.append("...");
}
- if (textWidth > 250)
+ if (textWidth > 250) ///< @todo magic number
textParam.insert(LINE_LENGTH, QString("\n"));
return labelMetrics.elidedText(textParam, Qt::ElideRight, textMaxWidth);