Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezestyle.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 4301 Lines • ▼ Show 20 Line(s) | 4300 | } else if( toolButtonOption->toolButtonStyle == Qt::ToolButtonTextUnderIcon ) { | |||
---|---|---|---|---|---|
4302 | const int contentsHeight( iconSize.height() + textSize.height() + Metrics::ToolButton_ItemSpacing ); | 4302 | const int contentsHeight( iconSize.height() + textSize.height() + Metrics::ToolButton_ItemSpacing ); | ||
4303 | iconRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - iconSize.width())/2, contentsRect.top() + (contentsRect.height() - contentsHeight)/2 ), iconSize ); | 4303 | iconRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - iconSize.width())/2, contentsRect.top() + (contentsRect.height() - contentsHeight)/2 ), iconSize ); | ||
4304 | textRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - textSize.width())/2, iconRect.bottom() + Metrics::ToolButton_ItemSpacing + 1 ), textSize ); | 4304 | textRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - textSize.width())/2, iconRect.bottom() + Metrics::ToolButton_ItemSpacing + 1 ), textSize ); | ||
4305 | textFlags |= Qt::AlignCenter; | 4305 | textFlags |= Qt::AlignCenter; | ||
4306 | 4306 | | |||
4307 | } else { | 4307 | } else { | ||
4308 | 4308 | | |||
4309 | const bool leftAlign( widget && widget->property( PropertyNames::toolButtonAlignment ).toInt() == Qt::AlignLeft ); | 4309 | const bool leftAlign( widget && widget->property( PropertyNames::toolButtonAlignment ).toInt() == Qt::AlignLeft ); | ||
4310 | if( leftAlign ) iconRect = QRect( QPoint( contentsRect.left(), contentsRect.top() + (contentsRect.height() - iconSize.height())/2 ), iconSize ); | 4310 | if( leftAlign ) { | ||
4311 | const int marginWidth( Metrics::Button_MarginWidth + Metrics::Frame_FrameWidth + 1 ); | ||||
4312 | iconRect = QRect( QPoint( contentsRect.left() + marginWidth, contentsRect.top() + (contentsRect.height() - iconSize.height())/2 ), iconSize ); | ||||
4313 | } | ||||
4311 | else { | 4314 | else { | ||
4312 | 4315 | | |||
4313 | const int contentsWidth( iconSize.width() + textSize.width() + Metrics::ToolButton_ItemSpacing ); | 4316 | const int contentsWidth( iconSize.width() + textSize.width() + Metrics::ToolButton_ItemSpacing ); | ||
4314 | iconRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - contentsWidth )/2, contentsRect.top() + (contentsRect.height() - iconSize.height())/2 ), iconSize ); | 4317 | iconRect = QRect( QPoint( contentsRect.left() + (contentsRect.width() - contentsWidth )/2, contentsRect.top() + (contentsRect.height() - iconSize.height())/2 ), iconSize ); | ||
4315 | 4318 | | |||
4316 | } | 4319 | } | ||
4317 | 4320 | | |||
4318 | textRect = QRect( QPoint( iconRect.right() + Metrics::ToolButton_ItemSpacing + 1, contentsRect.top() + (contentsRect.height() - textSize.height())/2 ), textSize ); | 4321 | textRect = QRect( QPoint( iconRect.right() + Metrics::ToolButton_ItemSpacing + 1, contentsRect.top() + (contentsRect.height() - textSize.height())/2 ), textSize ); | ||
▲ Show 20 Lines • Show All 2806 Lines • Show Last 20 Lines |