Unify the dimensions for all mode/action bar icons

Having icons of all different kinds of sizes makes it difficult to get
the painting right in all cases. It definitely fails when the szsytem is
running in multi-monitor mode with different scaling factors. Unifying
the dimensions makes it possible.

This change should not cause any visual difference in a purely scaled or
unscaled screen.

Task-number: QTCREATORBUG-18869
Change-Id: I3a864c9a86036b4f4f3b350a489077b247ca85b7
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Alessandro Portale
2017-09-12 18:55:14 +02:00
parent be376ae706
commit 5e89fae10f
66 changed files with 496 additions and 399 deletions

View File

@@ -178,7 +178,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
const QIcon::Mode iconMode = isEnabled() ? ((isDown() || isChecked()) ? QIcon::Active : QIcon::Normal)
: QIcon::Disabled;
QRect iconRect(0, 0, Constants::TARGET_ICON_SIZE, Constants::TARGET_ICON_SIZE);
QRect iconRect(0, 0, Constants::MODEBAR_ICON_SIZE, Constants::MODEBAR_ICON_SIZE);
// draw popup texts
if (isTitledAction) {
@@ -203,7 +203,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
painter.setFont(normalFont);
QPoint textOffset = centerRect.center() - QPoint(iconRect.width()/2, iconRect.height()/2);
textOffset = textOffset - QPoint(0, lineHeight + 4);
textOffset = textOffset - QPoint(0, lineHeight + 3);
QRectF r(0, textOffset.y(), rect().width(), lineHeight);
painter.setPen(creatorTheme()->color(isEnabled()
? Theme::PanelTextColorLight
@@ -218,8 +218,8 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
// draw build configuration name
textOffset = iconRect.center() + QPoint(iconRect.width()/2, iconRect.height()/2);
QRectF buildConfigRect[2];
buildConfigRect[0] = QRectF(0, textOffset.y() + 5, rect().width(), lineHeight);
buildConfigRect[1] = QRectF(0, textOffset.y() + 5 + lineHeight, rect().width(), lineHeight);
buildConfigRect[0] = QRectF(0, textOffset.y() + 4, rect().width(), lineHeight);
buildConfigRect[1] = QRectF(0, textOffset.y() + 4 + lineHeight, rect().width(), lineHeight);
painter.setFont(boldFont);
QVector<QString> splitBuildConfiguration(2);
const QString buildConfiguration = defaultAction()->property("subtitle").toString();