forked from qt-creator/qt-creator
tune the project pane's detail widget
Done with dt
This commit is contained in:
@@ -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,7 +35,7 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent)
|
|||||||
{
|
{
|
||||||
//TL--> ___________ <-- TR
|
//TL--> ___________ <-- TR
|
||||||
// | |
|
// | |
|
||||||
//ML-> ______________| <--MM |
|
//ML-> ______________| <--MM | <--MR
|
||||||
// | |
|
// | |
|
||||||
//BL-> |_________________________| <-- BR
|
//BL-> |_________________________| <-- BR
|
||||||
|
|
||||||
@@ -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(c);
|
|
||||||
//p.setBrush(palette().button());
|
|
||||||
|
|
||||||
// QPolygon polygon;
|
p.setBrush(palette().dark());
|
||||||
// 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)
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user