kstyle: add left padding to menus in the 'no checkboxes or icons' case

This improves the appearance by avoiding having text near directly against a border.
wilder-5.24
Jan Blackquill 5 years ago
parent 5b0ea0f65a
commit e8725e5618
  1. 1
      kstyle/breezemetrics.h
  2. 2
      kstyle/breezestyle.cpp

@ -50,6 +50,7 @@ namespace Breeze
// menu items // menu items
static constexpr int Menu_FrameWidth = 0; static constexpr int Menu_FrameWidth = 0;
static constexpr int MenuItem_MarginWidth = 8; static constexpr int MenuItem_MarginWidth = 8;
static constexpr int MenuItem_ExtraLeftMargin = 4;
static constexpr int MenuItem_MarginHeight = 4; static constexpr int MenuItem_MarginHeight = 4;
static constexpr int MenuItem_ItemSpacing = 4; static constexpr int MenuItem_ItemSpacing = 4;
static constexpr int MenuItem_SeparatorPadding = 0; static constexpr int MenuItem_SeparatorPadding = 0;

@ -4887,6 +4887,8 @@ namespace Breeze
contentsRect.setLeft( iconRect.right() + Metrics::MenuItem_ItemSpacing + 1 ); contentsRect.setLeft( iconRect.right() + Metrics::MenuItem_ItemSpacing + 1 );
const QSize iconSize( pixelMetric( PM_SmallIconSize, option, widget ), pixelMetric( PM_SmallIconSize, option, widget ) ); const QSize iconSize( pixelMetric( PM_SmallIconSize, option, widget ), pixelMetric( PM_SmallIconSize, option, widget ) );
iconRect = centerRect( iconRect, iconSize ); iconRect = centerRect( iconRect, iconSize );
} else {
contentsRect.setLeft( contentsRect.left() + Metrics::MenuItem_ExtraLeftMargin );
} }
if( showIcon && !menuItemOption->icon.isNull() ) if( showIcon && !menuItemOption->icon.isNull() )

Loading…
Cancel
Save