InfoTab::InfoTab(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint)
{
- m_layout = new QGridLayout(this);
- m_userPicture = new QLabel;
- m_userNameLabel = new QLabel;
- m_messageLabel = new QLabel;
- m_addressLabel = new QLabel;
- m_timeLabel = new QLabel;
- QLabel *m_clockLabel = new QLabel;
- QLabel *m_envelopeLabel = new QLabel;
- QLabel *m_compassLabel = new QLabel;
- QToolButton *updateFriendsButton = new QToolButton;
- QToolButton *updateStatusMessageButton = new QToolButton;
-
- updateFriendsButton->setIcon(QIcon(QPixmap(":/res/images/reload_icon.png")));
- updateStatusMessageButton->setIcon(QIcon(QPixmap(":/res/images/sendPosition_icon.png")));
-
- m_clockLabel->setPixmap(QPixmap(":/res/images/clock_small.png"));
- m_envelopeLabel->setPixmap(QPixmap(":/res/images/list_small.png"));
- m_compassLabel->setPixmap(QPixmap(":/res/images/compas_small.png"));
- m_layout->addWidget(m_userPicture,0,0,4,1);
- m_layout->addWidget(m_userNameLabel,0,2,1,2);
- m_layout->addWidget(m_clockLabel,1,1,1,1);
- m_layout->addWidget(m_envelopeLabel,2,1,1,1);
- m_layout->addWidget(m_compassLabel,3,1,1,1);
- m_layout->addWidget(m_timeLabel,1,2,1,1);
- m_layout->addWidget(m_messageLabel,2,2,1,1);
- m_layout->addWidget(m_addressLabel,3,2,1,1);
- m_layout->addWidget(updateFriendsButton,0,3,2,1);
- m_layout->addWidget(updateStatusMessageButton,1,3,2,1);
+ widget = new QWidget(this);
+ QVBoxLayout *verticalLayout = new QVBoxLayout(widget);
+ QVBoxLayout *verticalLayout2 = new QVBoxLayout(widget);
+ QHBoxLayout *horizontalLayout = new QHBoxLayout(widget);
+ QGridLayout *m_layout = new QGridLayout(widget);
+ situUser = new SituareUser(widget);
+ situUser->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
+ situUser->setMargin(1);
+
+ //Tex color settings
+ QPalette textPalette;
+ QColor textColor(152,152,152);
+ textPalette.setColor(QPalette::WindowText,textColor);
+ m_userNameLabel = new QLabel(widget);
+ m_userNameLabel->setFont(QFont( "Nokia Sans", 18, QFont::Normal));
+
+ m_messageLabel = new QLabel(widget);
+ m_messageLabel->setFont(QFont( "Nokia Sans", 13, QFont::Normal));
+ m_messageLabel->setPalette(textPalette);
+
+ m_addressLabel = new QLabel(widget);
+ m_addressLabel->setFont(QFont( "Nokia Sans", 13, QFont::Normal));
+ m_addressLabel->setPalette(textPalette);
+
+ m_timeLabel = new QLabel(widget);
+ m_timeLabel->setFont(QFont( "Nokia Sans", 13, QFont::Normal));
+ m_timeLabel->setPalette(textPalette);
+
+ QLabel *m_clockLabel = new QLabel(widget);
+ m_clockLabel->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
+ QLabel *m_envelopeLabel = new QLabel(widget);
+ m_envelopeLabel->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
+ QLabel *m_compassLabel = new QLabel(widget);
+ m_compassLabel->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
+ ButtonItem *updateFriendsButton = new ButtonItem(widget);
+ ButtonItem *updateStatusMessageButton = new ButtonItem(widget);
+
+ updateFriendsButton->setIcon(QIcon(QPixmap(":/resources/refresh.png")));
+ updateStatusMessageButton->setIcon(QIcon(QPixmap(":/resources/send_position.png")));
+
+ m_clockLabel->setPixmap(QPixmap(":/resources/clock.png"));
+ m_envelopeLabel->setPixmap(QPixmap(":/resources/envelope.png"));
+ m_compassLabel->setPixmap(QPixmap(":/resources/compass.png"));
+ m_layout->addWidget(situUser,0,0,1,2,Qt::AlignHCenter);
+ m_layout->addWidget(m_userNameLabel,1,1,1,2);
+ m_layout->addWidget(m_clockLabel,3,0,1,1);
+ m_layout->addWidget(m_envelopeLabel,2,0,1,1);
+ m_layout->addWidget(m_compassLabel,4,0,1,1);
+ m_layout->addWidget(m_timeLabel,3,1,1,1);
+ m_layout->addWidget(m_messageLabel,2,1,1,1);
+ m_layout->addWidget(m_addressLabel,4,1,1,1);
+
+ verticalLayout->addLayout(m_layout);
+ horizontalLayout->setSpacing(0);
+ horizontalLayout->addWidget(updateFriendsButton);
+ horizontalLayout->addWidget(updateStatusMessageButton);
+
+ verticalLayout->addLayout(horizontalLayout);
+
+ verticalLayout2->addLayout(verticalLayout);
+
connect(updateStatusMessageButton,SIGNAL(clicked()),this,SLOT(messageUpdate()));
connect(updateFriendsButton,SIGNAL(clicked()),this,SLOT(updateFriendsStatus()));
}