Skip to content
Snippets Groups Projects
Commit 0de78aa6 authored by mae's avatar mae
Browse files

tune the project pane's detail widget

Done with dt
parent aff42fec
No related branches found
No related tags found
No related merge requests found
...@@ -15,11 +15,12 @@ DetailsWidget::DetailsWidget(QWidget *parent) ...@@ -15,11 +15,12 @@ DetailsWidget::DetailsWidget(QWidget *parent)
m_grid = new QGridLayout(this); m_grid = new QGridLayout(this);
//m_grid->setMargin(0); //m_grid->setMargin(0);
m_summaryLabel = new QLabel(this); m_summaryLabel = new QLabel(this);
m_summaryLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
m_summaryLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); m_summaryLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
m_detailsButton = new DetailsButton(this); m_detailsButton = new DetailsButton(this);
m_grid->addWidget(m_summaryLabel, 0, 0, 2, 0); m_grid->addWidget(m_summaryLabel, 0, 0, 2, 0);
m_grid->addWidget(m_detailsButton, 0, 2); m_grid->addWidget(m_detailsButton, 1, 2);
connect(m_detailsButton, SIGNAL(clicked()), connect(m_detailsButton, SIGNAL(clicked()),
this, SLOT(detailsButtonClicked())); this, SLOT(detailsButtonClicked()));
...@@ -34,9 +35,9 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent) ...@@ -34,9 +35,9 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent)
{ {
//TL--> ___________ <-- TR //TL--> ___________ <-- TR
// | | // | |
//ML-> ______________| <--MM | //ML-> ______________| <--MM | <--MR
// | | // | |
//BL-> |_________________________| <-- BR //BL-> |_________________________| <-- BR
QWidget::paintEvent(paintEvent); QWidget::paintEvent(paintEvent);
...@@ -57,20 +58,17 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent) ...@@ -57,20 +58,17 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent)
QPoint ml(1, mm.y()); QPoint ml(1, mm.y());
QPoint mr(tr.x(), mm.y());
int bottom = geometry().height() - 3; int bottom = geometry().height() - 3;
QPoint bl(1, bottom); QPoint bl(1, bottom);
QPoint br(tr.x(), bottom); QPoint br(tr.x(), bottom);
QPainter p(this); QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
p.setPen(Qt::NoPen); p.setPen(Qt::NoPen);
QColor c = palette().color(QPalette::Background);
c = c.darker(115); p.setBrush(palette().dark());
p.setBrush(c);
//p.setBrush(palette().button());
// QPolygon polygon;
// polygon << tl << tr << br << bl << ml << mm;
// p.drawConvexPolygon(polygon);
p.drawRoundedRect(QRect(tl, br), 5, 5); p.drawRoundedRect(QRect(tl, br), 5, 5);
p.drawRoundedRect(QRect(ml, br), 5, 5); p.drawRoundedRect(QRect(ml, br), 5, 5);
} }
...@@ -104,7 +102,7 @@ void DetailsWidget::setToolWidget(QWidget *widget) ...@@ -104,7 +102,7 @@ void DetailsWidget::setToolWidget(QWidget *widget)
return; return;
if (m_toolWidget) if (m_toolWidget)
m_grid->removeWidget(m_toolWidget); m_grid->removeWidget(m_toolWidget);
m_grid->addWidget(widget, 0, 1); m_grid->addWidget(widget, 1, 1);
m_toolWidget = widget; m_toolWidget = widget;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment