InfoTab::InfoTab(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint)
{
- QWidget *widget = new QWidget(this);
- QGridLayout *layout = new QGridLayout(widget);
+ 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);
m_userPicture = new QLabel(widget);
+ m_userPicture->setAlignment(Qt::AlignCenter);
+ m_userPicture->setMargin(2);
m_userNameLabel = new QLabel(widget);
m_messageLabel = new QLabel(widget);
m_addressLabel = new QLabel(widget);
updateFriendsButton->setIcon(QIcon(QPixmap(":/resources/reload_icon.png")));
updateStatusMessageButton->setIcon(QIcon(QPixmap(":/resources/sendPosition_icon.png")));
- m_clockLabel->setPixmap(QPixmap(":/resources/clock_small.png"));
- m_envelopeLabel->setPixmap(QPixmap(":/resources/list_small.png"));
- m_compassLabel->setPixmap(QPixmap(":/resources/compas_small.png"));
- layout->addWidget(m_userPicture,0,0,4,1);
- layout->addWidget(m_userNameLabel,0,2,1,2);
- layout->addWidget(m_clockLabel,1,1,1,1);
- layout->addWidget(m_envelopeLabel,2,1,1,1);
- layout->addWidget(m_compassLabel,3,1,1,1);
- layout->addWidget(m_timeLabel,1,2,1,1);
- layout->addWidget(m_messageLabel,2,2,1,1);
- layout->addWidget(m_addressLabel,3,2,1,1);
- layout->addWidget(updateFriendsButton,0,3,1,1);
- layout->addWidget(updateStatusMessageButton,2,3,1,1);
+ m_clockLabel->setPixmap(QPixmap(":/resources/clock.png"));
+ m_envelopeLabel->setPixmap(QPixmap(":/resources/envelope.png"));
+ m_compassLabel->setPixmap(QPixmap(":/resources/compass.png"));
+ m_layout->addWidget(m_userPicture,0,0,1,2);
+ m_layout->addWidget(m_userNameLabel,1,0,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->setContentsMargins(-1,0,-1,-1);
+ 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()));
}
QColor myColor(Qt::black);
myColor.setAlpha(50);
qpalette.setColor(QPalette::Background,myColor);
+ //QBrush brush;
+ //brush.setTexture(QPixmap(":/resources/bkg_grid.png"));
+ //brush.setStyle(Qt::TexturePattern);
+ //brush.setColor(myColor);
+ qpalette.setBrush(QPalette::Window,myColor);
+ //qpalette.setBrush(QPalette::Window,brush);
setPalette(qpalette);
int roundness(6);
painter.setRenderHint(QPainter::Antialiasing);
QPainterPath roundedRect;
- roundedRect.addRoundedRect(1,1,widgetRect.width() - 2, widgetRect.height()-2,roundness,roundness);
+ roundedRect.addRoundedRect(1,1,widgetRect.width()-2, widgetRect.height()-2,roundness,roundness);
painter.setClipPath(roundedRect);
QRegion maskRegion = painter.clipRegion();
scene->setBackgroundBrush(Qt::white);
scene->addItem(m_widgetProxy);
scene->addItem(m_arrowbutton);
- qDebug() << "Scene width: " << scene->width();
+ qDebug() << "Infotab heigth: " << m_personalInfo->height();
qDebug() << "Scene heigth: " << scene->height();
QGraphicsView *view = new QGraphicsView(scene);
// State 1
state1->assignProperty(m_widgetProxy,"pos",QPointF(-(m_personalInfo->width()),0));
- state1->assignProperty(m_arrowbutton,"pos",QPointF(0,(m_personalInfo->height()/4)));
+ state1->assignProperty(m_arrowbutton,"pos",QPointF(0,(m_personalInfo->height()/4)+8));
// State 2
state2->assignProperty(m_widgetProxy,"pos",QPointF(0,0));
- state2->assignProperty(m_arrowbutton,"pos",QPointF((m_personalInfo->width()),(m_personalInfo->height()/4)));
+ state2->assignProperty(m_arrowbutton,"pos",QPointF((m_personalInfo->width()-2),(m_personalInfo->height()/4)+8));
m_trans1 = state1->addTransition(m_arrowbutton,SIGNAL(clicked()),state2);
m_anim1 = new QPropertyAnimation(m_widgetProxy,"pos");