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 3616 Lines • ▼ Show 20 Line(s) | 3610 | { | |||
---|---|---|---|---|---|
3617 | 3617 | | |||
3618 | const auto& palette( option->palette ); | 3618 | const auto& palette( option->palette ); | ||
3619 | const auto background( _helper->frameBackgroundColor( palette ) ); | 3619 | const auto background( _helper->frameBackgroundColor( palette ) ); | ||
3620 | const auto outline( _helper->frameOutlineColor( palette ) ); | 3620 | const auto outline( _helper->frameOutlineColor( palette ) ); | ||
3621 | 3621 | | |||
3622 | const bool hasAlpha( _helper->hasAlphaChannel( widget ) ); | 3622 | const bool hasAlpha( _helper->hasAlphaChannel( widget ) ); | ||
3623 | _helper->renderMenuFrame( painter, option->rect, background, outline, hasAlpha ); | 3623 | _helper->renderMenuFrame( painter, option->rect, background, outline, hasAlpha ); | ||
3624 | 3624 | | |||
3625 | // draw the vertical separator between the checkbox and the icon | ||||
3626 | const auto color( _helper->separatorColor( palette ) ); | ||||
3627 | const QRect separatorRect(option->rect.x(), option->rect.y(), (Metrics::CheckBox_Size + Metrics::MenuItem_ItemSpacing * 1.5) * 2, option->rect.height()); | ||||
3628 | _helper->renderSeparator(painter, separatorRect, color, true ); | ||||
3629 | | ||||
3625 | return true; | 3630 | return true; | ||
3626 | 3631 | | |||
3627 | } | 3632 | } | ||
3628 | 3633 | | |||
3629 | //___________________________________________________________________________________ | 3634 | //___________________________________________________________________________________ | ||
3630 | bool Style::drawPanelTipLabelPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const | 3635 | bool Style::drawPanelTipLabelPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const | ||
3631 | { | 3636 | { | ||
3632 | 3637 | | |||
▲ Show 20 Lines • Show All 1005 Lines • ▼ Show 20 Line(s) | 4633 | { | |||
4638 | 4643 | | |||
4639 | // deal with separators | 4644 | // deal with separators | ||
4640 | if( menuItemOption->menuItemType == QStyleOptionMenuItem::Separator ) | 4645 | if( menuItemOption->menuItemType == QStyleOptionMenuItem::Separator ) | ||
4641 | { | 4646 | { | ||
4642 | 4647 | | |||
4643 | // normal separator | 4648 | // normal separator | ||
4644 | if( menuItemOption->text.isEmpty() && menuItemOption->icon.isNull() ) | 4649 | if( menuItemOption->text.isEmpty() && menuItemOption->icon.isNull() ) | ||
4645 | { | 4650 | { | ||
4646 | 4651 | const QRect separatorRect = rect.adjusted(Metrics::CheckBox_Size + Metrics::MenuItem_ItemSpacing * 1.5, 0, 0, 0); | |||
4647 | const auto color( _helper->separatorColor( palette ) ); | 4652 | const auto color( _helper->separatorColor( palette ) ); | ||
4648 | _helper->renderSeparator( painter, rect, color ); | 4653 | _helper->renderSeparator( painter, separatorRect, color ); | ||
4649 | return true; | 4654 | return true; | ||
4650 | 4655 | | |||
4651 | } else { | 4656 | } else { | ||
4652 | 4657 | | |||
4653 | /* | 4658 | /* | ||
4654 | * separator can have a title and an icon | 4659 | * separator can have a title and an icon | ||
4655 | * in that case they are rendered as menu title buttons | 4660 | * in that case they are rendered as menu title buttons | ||
4656 | */ | 4661 | */ | ||
▲ Show 20 Lines • Show All 2481 Lines • Show Last 20 Lines |