Commit 87507955 authored by Noah Davis's avatar Noah Davis 🌵
Browse files

KStyle: fix hasIcon calculation for toolbutton labels

It used to check if icon was not null or iconSize was not empty, which was wrong.


(cherry picked from commit 0d382307)
parent 872a6d9c
Pipeline #236838 passed with stage
in 4 minutes and 48 seconds
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment