From ba2ea9cb0999467554aab9928ad6b076db34e7b8 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 6 Jan 2018 15:56:09 +0100 Subject: [PATCH] AbstractButtonInterface: Rename badgeLabelText -> badgeText --- src/lib/navigation/navigationbar.cpp | 4 ++-- src/lib/navigation/navigationbartoolbutton.cpp | 6 +++--- src/lib/tools/abstractbuttoninterface.cpp | 12 ++++++------ src/lib/tools/abstractbuttoninterface.h | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib/navigation/navigationbar.cpp b/src/lib/navigation/navigationbar.cpp index b8cdf5d55..c351502b8 100644 --- a/src/lib/navigation/navigationbar.cpp +++ b/src/lib/navigation/navigationbar.cpp @@ -382,8 +382,8 @@ void NavigationBar::aboutToShowToolsMenu() AbstractButtonInterface *button = data.button; if (button && !m_layoutIds.contains(data.id)) { QString title = button->title(); - if (!button->badgeLabelText().isEmpty()) { - title.append(QSL(" (%1)").arg(button->badgeLabelText())); + if (!button->badgeText().isEmpty()) { + title.append(QSL(" (%1)").arg(button->badgeText())); } m_menuTools->addAction(button->icon(), title, this, &NavigationBar::toolActionActivated)->setData(data.id); } diff --git a/src/lib/navigation/navigationbartoolbutton.cpp b/src/lib/navigation/navigationbartoolbutton.cpp index ee928c19d..c5457fe5c 100644 --- a/src/lib/navigation/navigationbartoolbutton.cpp +++ b/src/lib/navigation/navigationbartoolbutton.cpp @@ -43,7 +43,7 @@ NavigationBarToolButton::NavigationBarToolButton(AbstractButtonInterface *button connect(button, &AbstractButtonInterface::iconChanged, this, &NavigationBarToolButton::updateIcon); connect(button, &AbstractButtonInterface::activeChanged, this, &NavigationBarToolButton::updateIcon); connect(button, &AbstractButtonInterface::toolTipChanged, this, &NavigationBarToolButton::setToolTip); - connect(button, &AbstractButtonInterface::badgeLabelTextChanged, this, &NavigationBarToolButton::updateBadge); + connect(button, &AbstractButtonInterface::badgeTextChanged, this, &NavigationBarToolButton::updateBadge); connect(this, &ToolButton::clicked, this, &NavigationBarToolButton::clicked); } @@ -74,10 +74,10 @@ void NavigationBarToolButton::updateIcon() void NavigationBarToolButton::updateBadge() { - if (m_button->badgeLabelText().isEmpty()) { + if (m_button->badgeText().isEmpty()) { m_badgeLabel->hide(); } else { - m_badgeLabel->setText(m_button->badgeLabelText()); + m_badgeLabel->setText(m_button->badgeText()); m_badgeLabel->resize(m_badgeLabel->sizeHint()); m_badgeLabel->move(width() - m_badgeLabel->width(), 0); m_badgeLabel->show(); diff --git a/src/lib/tools/abstractbuttoninterface.cpp b/src/lib/tools/abstractbuttoninterface.cpp index f8e59a198..2171a6ff2 100644 --- a/src/lib/tools/abstractbuttoninterface.cpp +++ b/src/lib/tools/abstractbuttoninterface.cpp @@ -83,19 +83,19 @@ void AbstractButtonInterface::setIcon(const QIcon &icon) emit iconChanged(icon); } -QString AbstractButtonInterface::badgeLabelText() const +QString AbstractButtonInterface::badgeText() const { - return m_badgeLabelText; + return m_badgeText; } -void AbstractButtonInterface::setBadgeLabelText(const QString &badgeLabelText) +void AbstractButtonInterface::setBadgeText(const QString &badgeText) { - if (m_badgeLabelText == badgeLabelText) { + if (m_badgeText == badgeText) { return; } - m_badgeLabelText = badgeLabelText; - emit badgeLabelTextChanged(m_badgeLabelText); + m_badgeText = badgeText; + emit badgeTextChanged(m_badgeText); } WebPage *AbstractButtonInterface::webPage() const diff --git a/src/lib/tools/abstractbuttoninterface.h b/src/lib/tools/abstractbuttoninterface.h index 1bcb444e2..0a589ac6c 100644 --- a/src/lib/tools/abstractbuttoninterface.h +++ b/src/lib/tools/abstractbuttoninterface.h @@ -55,8 +55,8 @@ public: QIcon icon() const; void setIcon(const QIcon &icon); - QString badgeLabelText() const; - void setBadgeLabelText(const QString &badgeLabelText); + QString badgeText() const; + void setBadgeText(const QString &badgeText); WebPage *webPage() const; void setWebPage(WebPage *page); @@ -66,7 +66,7 @@ signals: void titleChanged(const QString &title); void toolTipChanged(const QString &toolTip); void iconChanged(const QIcon &icon); - void badgeLabelTextChanged(const QString &badgeLabelText); + void badgeTextChanged(const QString &badgeText); void webPageChanged(WebPage *page); void clicked(ClickController *controller); @@ -75,6 +75,6 @@ private: QString m_title; QString m_toolTip; QIcon m_icon; - QString m_badgeLabelText; + QString m_badgeText; WebPage *m_page = nullptr; };