mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 16:32:16 -07:00
use consistent naming
This commit is contained in:
parent
3b57a626d6
commit
ee87cdd77e
4 changed files with 9 additions and 9 deletions
|
|
@ -357,7 +357,7 @@ QPixmap LockPixmapGenerator::generatePixmap(int height)
|
|||
|
||||
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);
|
||||
if (pmCache.contains(key))
|
||||
|
|
@ -370,7 +370,7 @@ QPixmap ExpandIconPixmapGenerator::generatePixmap(int height, bool expanded)
|
|||
return pixmap;
|
||||
}
|
||||
|
||||
QMap<QString, QPixmap> ExpandIconPixmapGenerator::pmCache;
|
||||
QMap<QString, QPixmap> DropdownIconPixmapGenerator::pmCache;
|
||||
|
||||
QPixmap loadColorAdjustedPixmap(const QString &name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class ExpandIconPixmapGenerator
|
||||
class DropdownIconPixmapGenerator
|
||||
{
|
||||
private:
|
||||
static QMap<QString, QPixmap> pmCache;
|
||||
|
|
|
|||
|
|
@ -46,23 +46,23 @@ void BannerWidget::setText(const QString &text) const
|
|||
void BannerWidget::setClickable(bool _clickable)
|
||||
{
|
||||
clickable = _clickable;
|
||||
setExpandIconState(true);
|
||||
setDropdownIconState(true);
|
||||
}
|
||||
|
||||
void BannerWidget::toggleBuddyVisibility() const
|
||||
{
|
||||
if (buddy) {
|
||||
buddy->setVisible(!buddy->isVisible());
|
||||
setExpandIconState(buddy->isVisible());
|
||||
setDropdownIconState(buddy->isVisible());
|
||||
} else {
|
||||
setExpandIconState(false);
|
||||
setDropdownIconState(false);
|
||||
}
|
||||
}
|
||||
|
||||
void BannerWidget::setExpandIconState(bool expanded) const
|
||||
void BannerWidget::setDropdownIconState(bool expanded) const
|
||||
{
|
||||
if (clickable) {
|
||||
iconLabel->setPixmap(ExpandIconPixmapGenerator::generatePixmap(24, expanded));
|
||||
iconLabel->setPixmap(DropdownIconPixmapGenerator::generatePixmap(24, expanded));
|
||||
} else {
|
||||
// we cannot directly hide the iconLabel, since it's needed to center the text; set an empty image instead
|
||||
iconLabel->setPixmap(QPixmap());
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ signals:
|
|||
void buddyVisibilityChanged();
|
||||
private slots:
|
||||
void toggleBuddyVisibility() const;
|
||||
void setExpandIconState(bool expanded) const;
|
||||
void setDropdownIconState(bool expanded) const;
|
||||
};
|
||||
|
||||
#endif // BANNER_WIDGET_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue