From 0d382307a92b8c4ecba5891449f1959e4efa5534 Mon Sep 17 00:00:00 2001 From: Noah Davis Date: Sun, 25 Sep 2022 05:27:26 -0400 Subject: [PATCH] KStyle: fix hasIcon calculation for toolbutton labels It used to check if icon was not null or iconSize was not empty, which was wrong. --- kstyle/breezestyle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index ba34c839..fdb9593e 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -4640,7 +4640,8 @@ bool Style::drawToolButtonLabelControl(const QStyleOption *option, QPainter *pai const auto toolButtonStyle = toolButtonOption->toolButtonStyle; const bool hasArrow = toolButtonOption->features & QStyleOptionToolButton::Arrow; bool hasIcon = toolButtonStyle != Qt::ToolButtonTextOnly - && (!toolButtonOption->icon.isNull() || !toolButtonOption->iconSize.isEmpty() || hasArrow); + && ((!toolButtonOption->icon.isNull() && !toolButtonOption->iconSize.isEmpty()) + || hasArrow); bool hasText = toolButtonStyle != Qt::ToolButtonIconOnly && !toolButtonOption->text.isEmpty(); const bool textUnderIcon = hasIcon && hasText && toolButtonStyle == Qt::ToolButtonTextUnderIcon;