Started to modify personalinfoarea to "final" version
[situare] / src / ui / infotab.cpp
index a3ab6a5..0bf5cb0 100644 (file)
 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);
@@ -41,20 +46,27 @@ InfoTab::InfoTab(QWidget *parent)
     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()));
 }
@@ -66,6 +78,12 @@ void InfoTab::paintEvent(QPaintEvent *aPaintEvent)
     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);
 
@@ -75,7 +93,7 @@ void InfoTab::paintEvent(QPaintEvent *aPaintEvent)
 
     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();