Commit da41de92 authored by Alessandro Portale's avatar Alessandro Portale

Core: Improved layout of the progress toggle button

Horizontally centered. Vertically less unbalanced. And now also it also
works nicely in High-Dpi mode.

Change-Id: Ie02794fcda251c054f4f0a24b1f14f8f5a8e8847
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@digia.com>
parent d1a8347e
......@@ -706,18 +706,17 @@ ToggleButton::ToggleButton(QWidget *parent)
QSize ToggleButton::sizeHint() const
{
return QSize(12, 12);
return QSize(13, 12); // Uneven width, because the arrow's width is also uneven.
}
void ToggleButton::paintEvent(QPaintEvent *event)
{
QToolButton::paintEvent(event);
QPainter p(this);
QStyle *s = style();
QStyleOption arrowOpt;
arrowOpt.initFrom(this);
arrowOpt.rect = QRect(rect().center().x() - 3, rect().center().y() - 6, 9, 9);
s->drawPrimitive(QStyle::PE_IndicatorArrowUp, &arrowOpt, &p, this);
arrowOpt.rect.adjust(2, 0, -1, -2);
Utils::StyleHelper::drawArrow(QStyle::PE_IndicatorArrowUp, &p, &arrowOpt);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment