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 3568 Lines • ▼ Show 20 Line(s) | 3553 | { | |||
---|---|---|---|---|---|
3569 | * no need to update, this was already done in drawToolButtonComplexControl | 3569 | * no need to update, this was already done in drawToolButtonComplexControl | ||
3570 | */ | 3570 | */ | ||
3571 | const AnimationMode mode( _animations->widgetStateEngine().buttonAnimationMode( widget ) ); | 3571 | const AnimationMode mode( _animations->widgetStateEngine().buttonAnimationMode( widget ) ); | ||
3572 | const qreal opacity( _animations->widgetStateEngine().buttonOpacity( widget ) ); | 3572 | const qreal opacity( _animations->widgetStateEngine().buttonOpacity( widget ) ); | ||
3573 | 3573 | | |||
3574 | if( !autoRaise ) | 3574 | if( !autoRaise ) | ||
3575 | { | 3575 | { | ||
3576 | 3576 | | |||
3577 | // need to check widget for popup mode, because option is not set properly | | |||
3578 | const auto toolButton( qobject_cast<const QToolButton*>( widget ) ); | | |||
3579 | const bool hasPopupMenu( toolButton && toolButton->popupMode() == QToolButton::MenuButtonPopup ); | | |||
3580 | | ||||
3581 | // render as push button | 3577 | // render as push button | ||
3582 | const auto shadow( _helper->shadowColor( palette ) ); | 3578 | const auto shadow( _helper->shadowColor( palette ) ); | ||
3583 | const auto outline( _helper->buttonOutlineColor( palette, mouseOver, hasFocus, opacity, mode ) ); | 3579 | const auto outline( _helper->buttonOutlineColor( palette, mouseOver, hasFocus, opacity, mode ) ); | ||
3584 | const auto background( _helper->buttonBackgroundColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); | 3580 | const auto background( _helper->buttonBackgroundColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); | ||
3585 | 3581 | | |||
3586 | // adjust frame in case of menu | | |||
3587 | if( hasPopupMenu ) | | |||
3588 | { | | |||
3589 | painter->setClipRect( rect ); | | |||
3590 | rect.adjust( 0, 0, Metrics::Frame_FrameRadius + 2, 0 ); | | |||
3591 | rect = visualRect( option, rect ); | | |||
3592 | } | | |||
3593 | | ||||
3594 | // render | 3582 | // render | ||
3595 | _helper->renderButtonFrame( painter, rect, background, outline, shadow, hasFocus, sunken ); | 3583 | _helper->renderButtonFrame( painter, rect, background, outline, shadow, hasFocus, sunken ); | ||
3596 | 3584 | | |||
3597 | } else { | 3585 | } else { | ||
3598 | 3586 | | |||
3599 | const auto color( _helper->toolButtonColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); | 3587 | const auto color( _helper->toolButtonColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); | ||
3600 | _helper->renderToolButtonFrame( painter, rect, color, sunken ); | 3588 | _helper->renderToolButtonFrame( painter, rect, color, sunken ); | ||
3601 | 3589 | | |||
▲ Show 20 Lines • Show All 358 Lines • ▼ Show 20 Line(s) | 3908 | { | |||
3960 | 3948 | | |||
3961 | // render | 3949 | // render | ||
3962 | _helper->renderButtonFrame( painter, frameRect, background, outline, shadow, hasFocus, sunken ); | 3950 | _helper->renderButtonFrame( painter, frameRect, background, outline, shadow, hasFocus, sunken ); | ||
3963 | 3951 | | |||
3964 | // also render separator | 3952 | // also render separator | ||
3965 | auto separatorRect( rect.adjusted( 0, 2, -2, -2 ) ); | 3953 | auto separatorRect( rect.adjusted( 0, 2, -2, -2 ) ); | ||
3966 | separatorRect.setWidth( 1 ); | 3954 | separatorRect.setWidth( 1 ); | ||
3967 | separatorRect = visualRect( option, separatorRect ); | 3955 | separatorRect = visualRect( option, separatorRect ); | ||
3956 | if( sunken ) separatorRect.translate( 1, 1 ); | ||||
3968 | _helper->renderSeparator( painter, separatorRect, outline, true ); | 3957 | _helper->renderSeparator( painter, separatorRect, outline, true ); | ||
3969 | 3958 | | |||
3970 | return true; | 3959 | return true; | ||
3971 | 3960 | | |||
3972 | } | 3961 | } | ||
3973 | 3962 | | |||
3974 | //___________________________________________________________________________________ | 3963 | //___________________________________________________________________________________ | ||
3975 | bool Style::drawIndicatorTabClosePrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const | 3964 | bool Style::drawIndicatorTabClosePrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const | ||
▲ Show 20 Lines • Show All 3289 Lines • Show Last 20 Lines |