reduced icon to text spacing in toolbuttons, to be consistent with pushbuttons

moved CheckBoxContentsRect to .cpp
wilder-pre-rebase
Hugo Pereira Da Costa 12 years ago
parent 17246e0924
commit 1669b384ab
  1. 3
      kstyle/breeze.h
  2. 10
      kstyle/breezestyle.cpp
  3. 3
      kstyle/breezestyle.h

@ -92,7 +92,8 @@ namespace Breeze
// tool buttons
ToolButton_MarginWidth = 6,
ToolButton_ItemSpacing = 12,
ToolButton_ItemSpacing = 4,
ToolButton_InlineIndicatorWidth = 12,
// checkboxes and radio buttons
CheckBox_Size = 22,

@ -1246,6 +1246,10 @@ namespace Breeze
}
//___________________________________________________________________________________________________________________
QRect Style::checkBoxContentsRect( const QStyleOption* option, const QWidget* ) const
{ return visualRect( option, option->rect.adjusted( Metrics::CheckBox_Size + Metrics::CheckBox_ItemSpacing, 0, 0, 0 ) ); }
//___________________________________________________________________________________________________________________
QRect Style::lineEditContentsRect( const QStyleOption* option, const QWidget* widget ) const
{
@ -2355,7 +2359,7 @@ namespace Breeze
const bool hasInlineIndicator( toolButtonOption->features & QStyleOptionToolButton::HasMenu && !hasPopupMenu );
const int marginWidth( autoRaise ? Metrics::ToolButton_MarginWidth : Metrics::Button_MarginWidth + Metrics::Frame_FrameWidth );
if( hasInlineIndicator ) size.rwidth() += Metrics::ToolButton_ItemSpacing;
if( hasInlineIndicator ) size.rwidth() += Metrics::ToolButton_InlineIndicatorWidth;
size = expandSize( size, marginWidth );
return size;
@ -3879,7 +3883,7 @@ namespace Breeze
iconRect.setWidth( iconSize.width() );
textRect = rect;
textRect.adjust( iconRect.width() + 8, 0, 0, 0);
textRect.adjust( iconRect.width() + Metrics::ToolButton_ItemSpacing, 0, 0, 0);
// handle right to left layouts
iconRect = visualRect( option, iconRect );
@ -5251,7 +5255,7 @@ namespace Breeze
contentsRect= insideMargin( contentsRect, marginWidth );
if( hasInlineIndicator )
{
contentsRect.setRight( contentsRect.right() - Metrics::ToolButton_ItemSpacing );
contentsRect.setRight( contentsRect.right() - Metrics::ToolButton_InlineIndicatorWidth );
contentsRect = visualRect( option, contentsRect );
}

@ -165,8 +165,7 @@ namespace Breeze
{ return option->rect; }
//* checkbox contents
QRect checkBoxContentsRect( const QStyleOption* option, const QWidget* ) const
{ return visualRect( option, option->rect.adjusted( Metrics::CheckBox_Size + Metrics::CheckBox_BoxTextSpace, 0, 0, 0 ) ); }
QRect checkBoxContentsRect( const QStyleOption* option, const QWidget* ) const;
//* line edit contents
QRect lineEditContentsRect( const QStyleOption*, const QWidget* ) const;

Loading…
Cancel
Save