Refactored Insight GUI to accommodate the many changes made to Bloom's internals
Also lots of tidying.
This commit is contained in:
@@ -11,25 +11,25 @@ namespace Widgets
|
||||
}
|
||||
|
||||
void LabeledSeparator::paintEvent(QPaintEvent* event) {
|
||||
auto painter = QPainter(this);
|
||||
auto painter = QPainter{this};
|
||||
this->drawWidget(painter);
|
||||
}
|
||||
|
||||
void LabeledSeparator::drawWidget(QPainter& painter) {
|
||||
const auto fontMetrics = painter.fontMetrics();
|
||||
const auto titleSize = fontMetrics.size(Qt::TextFlag::TextSingleLine, this->title);
|
||||
const auto titleRect = QRect(
|
||||
QPoint(this->marginLeft, (this->height() - titleSize.height()) / 2),
|
||||
const auto titleRect = QRect{
|
||||
QPoint{this->marginLeft, (this->height() - titleSize.height()) / 2},
|
||||
titleSize
|
||||
);
|
||||
};
|
||||
|
||||
const auto lineYPosition = titleRect.y() + (titleRect.height() / 2);
|
||||
const auto line = QLine(
|
||||
const auto line = QLine{
|
||||
titleRect.right() + 8,
|
||||
lineYPosition,
|
||||
this->width() - this->marginRight,
|
||||
lineYPosition
|
||||
);
|
||||
};
|
||||
|
||||
painter.drawText(titleRect, Qt::AlignCenter, this->title);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user