Commit c9aa5358 authored by Nate Graham's avatar Nate Graham 🔩

Revert "Reduce the indicator arrow size for press-and-hold menus in QToolButtons"

This reverts commit 27bcd1be.

The change in question has the potential to introduce regressions with
alternative icon themes, and in retrospect is not necessary for the
feature it was created in support of (https://phabricator.kde.org/D19311)
parent 90c6f906
......@@ -234,8 +234,7 @@ namespace Breeze
ArrowUp,
ArrowDown,
ArrowLeft,
ArrowRight,
ArrowDown_Small,
ArrowRight
};
//* button type
......
......@@ -1305,7 +1305,6 @@ namespace Breeze
case ArrowDown: arrow = QVector<QPointF>{QPointF( -4, -2 ), QPointF( 0, 2 ), QPointF( 4, -2 )}; break;
case ArrowLeft: arrow = QVector<QPointF>{QPointF( 2, -4 ), QPointF( -2, 0 ), QPointF( 2, 4 )}; break;
case ArrowRight: arrow = QVector<QPointF>{QPointF( -2, -4 ), QPointF( 2, 0 ), QPointF( -2, 4 )}; break;
case ArrowDown_Small: arrow = QVector<QPointF>{QPointF( 2, 4 ), QPointF( 4, 6 ), QPointF( 6, 4 )}; break;
default: break;
}
......
......@@ -2726,9 +2726,15 @@ namespace Breeze
// get relevant state flags
const State& state( option->state );
const bool autoRaise( state & State_AutoRaise );
const bool hasPopupMenu( toolButtonOption->features & QStyleOptionToolButton::MenuButtonPopup );
const bool hasInlineIndicator(
toolButtonOption->features&QStyleOptionToolButton::HasMenu
&& toolButtonOption->features&QStyleOptionToolButton::PopupDelay
&& !hasPopupMenu );
const int marginWidth( autoRaise ? Metrics::ToolButton_MarginWidth : Metrics::Button_MarginWidth + Metrics::Frame_FrameWidth );
if( hasInlineIndicator ) size.rwidth() += Metrics::ToolButton_InlineIndicatorWidth;
size = expandSize( size, marginWidth );
return size;
......@@ -6093,7 +6099,7 @@ namespace Breeze
copy.rect = menuRect;
if( sunken && !flat ) copy.rect.translate( 1, 1 );
drawIndicatorArrowPrimitive( ArrowDown_Small, &copy, painter, widget );
drawPrimitive( PE_IndicatorArrowDown, &copy, painter, widget );
}
......@@ -6121,6 +6127,7 @@ namespace Breeze
const int marginWidth( flat ? Metrics::ToolButton_MarginWidth : Metrics::Button_MarginWidth + Metrics::Frame_FrameWidth );
contentsRect = insideMargin( contentsRect, marginWidth, 0 );
contentsRect.setRight( contentsRect.right() - Metrics::ToolButton_InlineIndicatorWidth );
contentsRect = visualRect( option, contentsRect );
}
......
Markdown is supported
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