Use StyleHelper::UiFont()

Change-Id: I0c09578b76c48ddb255f44bb6117089dd092a72c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-11-15 10:37:30 +01:00
parent f8671f3e3c
commit 6c57c51981
16 changed files with 30 additions and 83 deletions

View File

@@ -181,11 +181,9 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
const bool isTitledAction = defaultAction() && defaultAction()->property("titledAction").toBool();
// draw popup texts
if (isTitledAction && !m_iconsOnly) {
QFont normalFont(painter.font());
const QFont normalFont = StyleHelper::UiFont(StyleHelper::UiElementPanelSubtitle);
QRect centerRect = rect();
normalFont.setPointSizeF(StyleHelper::sidebarFontSize());
QFont boldFont(normalFont);
boldFont.setBold(true);
const QFont boldFont = StyleHelper::UiFont(StyleHelper::UiElementPanelTitle);
const QFontMetrics fm(normalFont);
const QFontMetrics boldFm(boldFont);
const int lineHeight = boldFm.height();
@@ -286,9 +284,7 @@ QSize FancyToolButton::sizeHint() const
QSizeF buttonSize = iconSize().expandedTo(QSize(64, 38));
if (defaultAction() && defaultAction()->property("titledAction").toBool()) {
QFont boldFont(font());
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
boldFont.setBold(true);
const QFont boldFont = StyleHelper::UiFont(StyleHelper::UiElementPanelTitle);
const QFontMetrics fm(boldFont);
const qreal lineHeight = fm.height();
const int extraHeight = 10 // Spacing between top and projectName