Utils: Fix function name case StyleHelper::Uifont -> uifont

Oopsie.

Change-Id: I66c4b56f43c50e3dfc5c17ffd95d778d496b77f2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Alessandro Portale
2023-12-06 13:02:09 +01:00
parent a737ddd931
commit a4a27b8931
19 changed files with 30 additions and 30 deletions

View File

@@ -942,7 +942,7 @@ static QStringList brandFontFamilies()
return families; return families;
} }
QFont StyleHelper::UiFont(UiElement element) QFont StyleHelper::uiFont(UiElement element)
{ {
QFont font; QFont font;

View File

@@ -81,7 +81,7 @@ QTCREATOR_UTILS_EXPORT QColor sidebarShadow();
QTCREATOR_UTILS_EXPORT QColor toolBarDropShadowColor(); QTCREATOR_UTILS_EXPORT QColor toolBarDropShadowColor();
QTCREATOR_UTILS_EXPORT QColor notTooBrightHighlightColor(); QTCREATOR_UTILS_EXPORT QColor notTooBrightHighlightColor();
QTCREATOR_UTILS_EXPORT QFont UiFont(UiElement element); QTCREATOR_UTILS_EXPORT QFont uiFont(UiElement element);
// Sets the base color and makes sure all top level widgets are updated // Sets the base color and makes sure all top level widgets are updated
QTCREATOR_UTILS_EXPORT void setBaseColor(const QColor &color); QTCREATOR_UTILS_EXPORT void setBaseColor(const QColor &color);

View File

@@ -570,7 +570,7 @@ void SettingsDialog::showPage(const Id pageId)
void SettingsDialog::createGui() void SettingsDialog::createGui()
{ {
m_headerLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH4)); m_headerLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH4));
auto headerHLayout = new QHBoxLayout; auto headerHLayout = new QHBoxLayout;
const int leftMargin = QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin); const int leftMargin = QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin);

View File

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

View File

@@ -68,7 +68,7 @@ QSize FancyTabBar::tabSizeHint(bool minimum) const
Core::Constants::MODEBAR_ICONSONLY_BUTTON_SIZE / (minimum ? 3 : 1)}; Core::Constants::MODEBAR_ICONSONLY_BUTTON_SIZE / (minimum ? 3 : 1)};
} }
const QFont boldFont = StyleHelper::UiFont(StyleHelper::UiElementCaptionStrong); const QFont boldFont = StyleHelper::uiFont(StyleHelper::UiElementCaptionStrong);
const QFontMetrics fm(boldFont); const QFontMetrics fm(boldFont);
const int spacing = 8; const int spacing = 8;
const int width = 60 + spacing + 2; const int width = 60 + spacing + 2;
@@ -283,7 +283,7 @@ static void paintIconAndText(QPainter *painter, const QRect &rect,
const QIcon &icon, const QString &text, const QIcon &icon, const QString &text,
bool enabled, bool selected) bool enabled, bool selected)
{ {
const QFont boldFont = StyleHelper::UiFont(StyleHelper::UiElementCaptionStrong); const QFont boldFont = StyleHelper::uiFont(StyleHelper::UiElementCaptionStrong);
painter->setFont(boldFont); painter->setFont(boldFont);
const bool drawIcon = rect.height() > 36; const bool drawIcon = rect.height() > 36;

View File

@@ -178,7 +178,7 @@ void WelcomePageButton::setSize(Size size)
const int hMargin = size == SizeSmall ? 12 : 26; const int hMargin = size == SizeSmall ? 12 : 26;
const int vMargin = size == SizeSmall ? 2 : 4; const int vMargin = size == SizeSmall ? 2 : 4;
d->m_layout->setContentsMargins(hMargin, vMargin, hMargin, vMargin); d->m_layout->setContentsMargins(hMargin, vMargin, hMargin, vMargin);
d->m_label->setFont(size == SizeSmall ? font() : StyleHelper::UiFont(StyleHelper::UiElementH2)); d->m_label->setFont(size == SizeSmall ? font() : StyleHelper::uiFont(StyleHelper::UiElementH2));
} }
void WelcomePageButton::setWithAccentColor(bool withAccent) void WelcomePageButton::setWithAccentColor(bool withAccent)

View File

@@ -166,7 +166,7 @@ QSize ProgressBar::sizeHint() const
int width = 50; int width = 50;
int height = PROGRESSBAR_HEIGHT + 5; int height = PROGRESSBAR_HEIGHT + 5;
if (m_titleVisible) { if (m_titleVisible) {
const QFont font = StyleHelper::UiFont(StyleHelper::UiElementCaptionStrong); const QFont font = StyleHelper::uiFont(StyleHelper::UiElementCaptionStrong);
const QFontMetrics fm(font); const QFontMetrics fm(font);
width = qMax(width, fm.horizontalAdvance(m_title) + 16); width = qMax(width, fm.horizontalAdvance(m_title) + 16);
height += fm.height() + 5; height += fm.height() + 5;
@@ -213,7 +213,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
percent = 1; percent = 1;
QPainter p(this); QPainter p(this);
const QFont fnt = StyleHelper::UiFont(StyleHelper::UiElementCaptionStrong); const QFont fnt = StyleHelper::uiFont(StyleHelper::UiElementCaptionStrong);
const QFontMetrics fm(fnt); const QFontMetrics fm(fnt);
const int titleHeight = m_titleVisible ? fm.height() + 5 : 4; const int titleHeight = m_titleVisible ? fm.height() + 5 : 4;

View File

@@ -661,7 +661,7 @@ void ProgressManagerPrivate::updateStatusDetailsWidget()
} else if (progress->isSubtitleVisibleInStatusBar() && !progress->subtitle().isEmpty()) { } else if (progress->isSubtitleVisibleInStatusBar() && !progress->subtitle().isEmpty()) {
if (!m_statusDetailsLabel) { if (!m_statusDetailsLabel) {
m_statusDetailsLabel = new QLabel(m_summaryProgressWidget); m_statusDetailsLabel = new QLabel(m_summaryProgressWidget);
const QFont font = StyleHelper::UiFont(StyleHelper::UiElementCaptionStrong); const QFont font = StyleHelper::uiFont(StyleHelper::UiElementCaptionStrong);
m_statusDetailsLabel->setFont(font); m_statusDetailsLabel->setFont(font);
} }
m_statusDetailsLabel->setText(progress->subtitle()); m_statusDetailsLabel->setText(progress->subtitle());

View File

@@ -67,7 +67,7 @@ SearchBox::SearchBox(QWidget *parent)
m_lineEdit = new FancyLineEdit; m_lineEdit = new FancyLineEdit;
m_lineEdit->setFiltering(true); m_lineEdit->setFiltering(true);
m_lineEdit->setFrame(false); m_lineEdit->setFrame(false);
m_lineEdit->setFont(StyleHelper::UiFont(StyleHelper::UiElementH2)); m_lineEdit->setFont(StyleHelper::uiFont(StyleHelper::UiElementH2));
m_lineEdit->setMinimumHeight(33); m_lineEdit->setMinimumHeight(33);
m_lineEdit->setAttribute(Qt::WA_MacShowFocusRect, false); m_lineEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
@@ -785,7 +785,7 @@ ListModel *SectionedGridView::addSection(const Section &section, const QList<Lis
}.emerge(); }.emerge();
m_sectionLabels.append(sectionLabel); m_sectionLabels.append(sectionLabel);
sectionLabel->setContentsMargins(0, ItemGap, 0, 0); sectionLabel->setContentsMargins(0, ItemGap, 0, 0);
sectionLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH2)); sectionLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH2));
auto scrollArea = qobject_cast<QScrollArea *>(widget(0)); auto scrollArea = qobject_cast<QScrollArea *>(widget(0));
auto vbox = qobject_cast<QVBoxLayout *>(scrollArea->widget()->layout()); auto vbox = qobject_cast<QVBoxLayout *>(scrollArea->widget()->layout());
@@ -842,7 +842,7 @@ void SectionedGridView::zoomInSection(const Section &section)
noMargin noMargin
}.emerge(); }.emerge();
sectionLabel->setContentsMargins(0, ItemGap, 0, 0); sectionLabel->setContentsMargins(0, ItemGap, 0, 0);
sectionLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH2)); sectionLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH2));
auto gridView = new GridView(zoomedInWidget); auto gridView = new GridView(zoomedInWidget);
gridView->setItemDelegate(m_itemDelegate); gridView->setItemDelegate(m_itemDelegate);

View File

@@ -49,7 +49,7 @@ BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation
warningLayout->addWidget(m_warningIcon); warningLayout->addWidget(m_warningIcon);
warningLayout->addWidget(m_warningLabel); warningLayout->addWidget(m_warningLabel);
const QFont f = Utils::StyleHelper::UiFont(Utils::StyleHelper::UiElementCaptionStrong); const QFont f = Utils::StyleHelper::uiFont(Utils::StyleHelper::UiElementCaptionStrong);
m_errorLabel->setFont(f); m_errorLabel->setFont(f);
m_warningLabel->setFont(f); m_warningLabel->setFont(f);
m_errorLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_errorLabel->palette())); m_errorLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_errorLabel->palette()));

View File

@@ -54,7 +54,7 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) :
if (!BuildConfigurationFactory::find(m_target)) { if (!BuildConfigurationFactory::find(m_target)) {
auto noSettingsLabel = new QLabel(this); auto noSettingsLabel = new QLabel(this);
noSettingsLabel->setText(Tr::tr("No build settings available")); noSettingsLabel->setText(Tr::tr("No build settings available"));
noSettingsLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH4)); noSettingsLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH4));
vbox->addWidget(noSettingsLabel); vbox->addWidget(noSettingsLabel);
return; return;
} }
@@ -126,7 +126,7 @@ void BuildSettingsWidget::addSubWidget(NamedWidget *widget)
auto label = new QLabel(this); auto label = new QLabel(this);
label->setText(widget->displayName()); label->setText(widget->displayName());
label->setFont(StyleHelper::UiFont(StyleHelper::UiElementH4)); label->setFont(StyleHelper::uiFont(StyleHelper::UiElementH4));
label->setContentsMargins(0, 18, 0, 0); label->setContentsMargins(0, 18, 0, 0);

View File

@@ -100,7 +100,7 @@ void PanelsWidget::addPropertiesPanel(const QString &displayName)
auto nameLabel = new QLabel(m_root); auto nameLabel = new QLabel(m_root);
nameLabel->setText(displayName); nameLabel->setText(displayName);
nameLabel->setContentsMargins(0, ABOVE_HEADING_MARGIN, 0, 0); nameLabel->setContentsMargins(0, ABOVE_HEADING_MARGIN, 0, 0);
nameLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH3)); nameLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH3));
m_layout->addWidget(nameLabel); m_layout->addWidget(nameLabel);
m_layout->addWidget(Layouting::createHr()); m_layout->addWidget(Layouting::createHr());
} }

View File

@@ -583,11 +583,11 @@ public:
manageSessionsButton->setOnClicked([] { SessionManager::showSessionManager(); }); manageSessionsButton->setOnClicked([] { SessionManager::showSessionManager(); });
auto sessionsLabel = new QLabel(this); auto sessionsLabel = new QLabel(this);
sessionsLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH2)); sessionsLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH2));
sessionsLabel->setText(Tr::tr("Sessions")); sessionsLabel->setText(Tr::tr("Sessions"));
auto recentProjectsLabel = new QLabel(this); auto recentProjectsLabel = new QLabel(this);
recentProjectsLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH2)); recentProjectsLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH2));
recentProjectsLabel->setText(Tr::tr("Projects")); recentProjectsLabel->setText(Tr::tr("Projects"));
auto sessionsList = new TreeView(this, "Sessions"); auto sessionsList = new TreeView(this, "Sessions");

View File

@@ -570,7 +570,7 @@ public:
selectorView->setAutoFillBackground(true); selectorView->setAutoFillBackground(true);
auto activeLabel = new QLabel(Tr::tr("Active Project")); auto activeLabel = new QLabel(Tr::tr("Active Project"));
activeLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH4)); activeLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH4));
auto innerLayout = new QVBoxLayout; auto innerLayout = new QVBoxLayout;
innerLayout->setSpacing(10); innerLayout->setSpacing(10);
@@ -903,7 +903,7 @@ void SelectorDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
case 2: { case 2: {
QColor col = creatorTheme()->color(Theme::TextColorNormal); QColor col = creatorTheme()->color(Theme::TextColorNormal);
opt.palette.setColor(QPalette::Text, col); opt.palette.setColor(QPalette::Text, col);
opt.font = StyleHelper::UiFont(StyleHelper::UiElementH4); opt.font = StyleHelper::uiFont(StyleHelper::UiElementH4);
break; break;
} }
} }

View File

@@ -69,7 +69,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) :
runLabel->setBuddy(m_runConfigurationCombo); runLabel->setBuddy(m_runConfigurationCombo);
const QFont f = Utils::StyleHelper::UiFont(Utils::StyleHelper::UiElementH4); const QFont f = Utils::StyleHelper::uiFont(Utils::StyleHelper::UiElementH4);
runTitle->setFont(f); runTitle->setFont(f);
deployTitle->setFont(f); deployTitle->setFont(f);
@@ -498,7 +498,7 @@ void RunSettingsWidget::addSubWidget(QWidget *widget, QLabel *label)
{ {
widget->setContentsMargins({}); widget->setContentsMargins({});
label->setFont(Utils::StyleHelper::UiFont(Utils::StyleHelper::UiElementH4)); label->setFont(Utils::StyleHelper::uiFont(Utils::StyleHelper::UiElementH4));
label->setContentsMargins(0, 18, 0, 0); label->setContentsMargins(0, 18, 0, 0);

View File

@@ -185,7 +185,7 @@ void TargetGroupItemPrivate::ensureWidget()
auto label = new QLabel; auto label = new QLabel;
label->setText(Tr::tr("No kit defined in this project.")); label->setText(Tr::tr("No kit defined in this project."));
label->setFont(StyleHelper::UiFont(StyleHelper::UiElementH4)); label->setFont(StyleHelper::uiFont(StyleHelper::UiElementH4));
label->setContentsMargins(10, 10, 10, 10); label->setContentsMargins(10, 10, 10, 10);
label->setAlignment(Qt::AlignTop); label->setAlignment(Qt::AlignTop);

View File

@@ -20,7 +20,7 @@ DragShapeButton::DragShapeButton(QWidget *parent)
setMinimumSize(75, 75); setMinimumSize(75, 75);
setMaximumSize(75, 75); setMaximumSize(75, 75);
setIconSize(QSize(45, 45)); setIconSize(QSize(45, 45));
setFont(Utils::StyleHelper::UiFont(Utils::StyleHelper::UiElementCaption)); setFont(Utils::StyleHelper::uiFont(Utils::StyleHelper::UiElementCaption));
} }
void DragShapeButton::setShapeInfo(int groupIndex, int shapeIndex) void DragShapeButton::setShapeInfo(int groupIndex, int shapeIndex)

View File

@@ -78,7 +78,7 @@ IntroductionWidget::IntroductionWidget(QWidget *parent)
m_continueLabel->setAlignment(Qt::AlignCenter); m_continueLabel->setAlignment(Qt::AlignCenter);
m_continueLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); m_continueLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
m_continueLabel->setWordWrap(true); m_continueLabel->setWordWrap(true);
m_continueLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH3)); m_continueLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH3));
m_continueLabel->setPalette(palette()); m_continueLabel->setPalette(palette());
layout->addWidget(m_continueLabel); layout->addWidget(m_continueLabel);
m_bodyCss = "font-size: 16px;"; m_bodyCss = "font-size: 16px;";

View File

@@ -160,7 +160,7 @@ public:
hbox->addSpacing(16); hbox->addSpacing(16);
const QFont welcomeFont = StyleHelper::UiFont(StyleHelper::UiElementH1); const QFont welcomeFont = StyleHelper::uiFont(StyleHelper::UiElementH1);
auto welcomeLabel = new QLabel("Welcome to"); auto welcomeLabel = new QLabel("Welcome to");
welcomeLabel->setFont(welcomeFont); welcomeLabel->setFont(welcomeFont);
@@ -245,7 +245,7 @@ public:
vbox->addItem(newVBox); vbox->addItem(newVBox);
auto newLabel = new QLabel(Tr::tr("New to Qt?"), mainWidget); auto newLabel = new QLabel(Tr::tr("New to Qt?"), mainWidget);
newLabel->setFont(StyleHelper::UiFont(StyleHelper::UiElementH2)); newLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementH2));
newLabel->setAlignment(Qt::AlignHCenter); newLabel->setAlignment(Qt::AlignHCenter);
newVBox->addWidget(newLabel); newVBox->addWidget(newLabel);