From 9d093782a61bafa05d3c8e2cc506bb4c0930ed7c Mon Sep 17 00:00:00 2001 From: RickyRister Date: Sun, 2 Mar 2025 02:21:22 -0800 Subject: [PATCH] don't show icon if there's no buddy --- .../src/client/ui/widgets/general/display/banner_widget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/client/ui/widgets/general/display/banner_widget.cpp b/cockatrice/src/client/ui/widgets/general/display/banner_widget.cpp index eda7aebc7..1d70a72b5 100644 --- a/cockatrice/src/client/ui/widgets/general/display/banner_widget.cpp +++ b/cockatrice/src/client/ui/widgets/general/display/banner_widget.cpp @@ -67,9 +67,8 @@ void BannerWidget::toggleBuddyVisibility() const void BannerWidget::updateDropdownIconState() const { - if (clickable) { - bool expanded = buddy && !buddy->isHidden(); - iconLabel->setPixmap(DropdownIconPixmapGenerator::generatePixmap(24, expanded)); + if (clickable && buddy) { + iconLabel->setPixmap(DropdownIconPixmapGenerator::generatePixmap(24, !buddy->isHidden())); } else { // we cannot directly hide the iconLabel, since it's needed to center the text; set an empty image instead iconLabel->setPixmap(QPixmap());