use consistent naming

This commit is contained in:
RickyRister 2025-02-16 22:48:52 -08:00
parent 3b57a626d6
commit ee87cdd77e
4 changed files with 9 additions and 9 deletions

View file

@ -357,7 +357,7 @@ QPixmap LockPixmapGenerator::generatePixmap(int height)
QMap<int, QPixmap> LockPixmapGenerator::pmCache; QMap<int, QPixmap> LockPixmapGenerator::pmCache;
QPixmap ExpandIconPixmapGenerator::generatePixmap(int height, bool expanded) QPixmap DropdownIconPixmapGenerator::generatePixmap(int height, bool expanded)
{ {
QString key = QString::number(expanded) + ":" + QString::number(height); QString key = QString::number(expanded) + ":" + QString::number(height);
if (pmCache.contains(key)) if (pmCache.contains(key))
@ -370,7 +370,7 @@ QPixmap ExpandIconPixmapGenerator::generatePixmap(int height, bool expanded)
return pixmap; return pixmap;
} }
QMap<QString, QPixmap> ExpandIconPixmapGenerator::pmCache; QMap<QString, QPixmap> DropdownIconPixmapGenerator::pmCache;
QPixmap loadColorAdjustedPixmap(const QString &name) QPixmap loadColorAdjustedPixmap(const QString &name)
{ {

View file

@ -106,7 +106,7 @@ public:
} }
}; };
class ExpandIconPixmapGenerator class DropdownIconPixmapGenerator
{ {
private: private:
static QMap<QString, QPixmap> pmCache; static QMap<QString, QPixmap> pmCache;

View file

@ -46,23 +46,23 @@ void BannerWidget::setText(const QString &text) const
void BannerWidget::setClickable(bool _clickable) void BannerWidget::setClickable(bool _clickable)
{ {
clickable = _clickable; clickable = _clickable;
setExpandIconState(true); setDropdownIconState(true);
} }
void BannerWidget::toggleBuddyVisibility() const void BannerWidget::toggleBuddyVisibility() const
{ {
if (buddy) { if (buddy) {
buddy->setVisible(!buddy->isVisible()); buddy->setVisible(!buddy->isVisible());
setExpandIconState(buddy->isVisible()); setDropdownIconState(buddy->isVisible());
} else { } else {
setExpandIconState(false); setDropdownIconState(false);
} }
} }
void BannerWidget::setExpandIconState(bool expanded) const void BannerWidget::setDropdownIconState(bool expanded) const
{ {
if (clickable) { if (clickable) {
iconLabel->setPixmap(ExpandIconPixmapGenerator::generatePixmap(24, expanded)); iconLabel->setPixmap(DropdownIconPixmapGenerator::generatePixmap(24, expanded));
} else { } else {
// we cannot directly hide the iconLabel, since it's needed to center the text; set an empty image instead // we cannot directly hide the iconLabel, since it's needed to center the text; set an empty image instead
iconLabel->setPixmap(QPixmap()); iconLabel->setPixmap(QPixmap());

View file

@ -40,7 +40,7 @@ signals:
void buddyVisibilityChanged(); void buddyVisibilityChanged();
private slots: private slots:
void toggleBuddyVisibility() const; void toggleBuddyVisibility() const;
void setExpandIconState(bool expanded) const; void setDropdownIconState(bool expanded) const;
}; };
#endif // BANNER_WIDGET_H #endif // BANNER_WIDGET_H