KStyle: fix hasIcon calculation for toolbutton labels

It used to check if icon was not null or iconSize was not empty, which was wrong.
wilder-reb-27
Noah Davis 4 years ago
parent 125e36ffe5
commit 0d382307a9
  1. 3
      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;

Loading…
Cancel
Save