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 6552 Lines • ▼ Show 20 Line(s) | 6552 | { | |||
---|---|---|---|---|---|
6553 | //the animation for QStyle::SC_ScrollBarGroove is special: it will animate | 6553 | //the animation for QStyle::SC_ScrollBarGroove is special: it will animate | ||
6554 | //the opacity of everything else as well, included slider and arrows | 6554 | //the opacity of everything else as well, included slider and arrows | ||
6555 | qreal opacity( _animations->scrollBarEngine().opacity( widget, QStyle::SC_ScrollBarGroove ) ); | 6555 | qreal opacity( _animations->scrollBarEngine().opacity( widget, QStyle::SC_ScrollBarGroove ) ); | ||
6556 | const bool animated( StyleConfigData::animationsEnabled() && _animations->scrollBarEngine().isAnimated( widget, AnimationHover, QStyle::SC_ScrollBarGroove ) ); | 6556 | const bool animated( StyleConfigData::animationsEnabled() && _animations->scrollBarEngine().isAnimated( widget, AnimationHover, QStyle::SC_ScrollBarGroove ) ); | ||
6557 | const bool mouseOver( option->state & State_MouseOver ); | 6557 | const bool mouseOver( option->state & State_MouseOver ); | ||
6558 | 6558 | | |||
6559 | if( opacity == AnimationData::OpacityInvalid ) opacity = 1; | 6559 | if( opacity == AnimationData::OpacityInvalid ) opacity = 1; | ||
6560 | 6560 | | |||
6561 | QRect separatorRect; | ||||
6562 | if ( option->state & State_Horizontal ) { | ||||
6563 | separatorRect = QRect(0, 0, option->rect.width(), 1); | ||||
6564 | } else { | ||||
6565 | separatorRect = alignedRect(option->direction, | ||||
6566 | Qt::AlignLeft, | ||||
6567 | QSize(1, option->rect.height()), option->rect); | ||||
ndavis: Use PenWidth::Frame instead of hardcoding 1. | |||||
6568 | } | ||||
6569 | | ||||
6570 | _helper->renderScrollBarBorder( painter, separatorRect, _helper->alphaColor( option->palette.color( QPalette::WindowText ), 0.1 )); | ||||
Another thing: hpereiradacosta: Another thing:
Color role should be QPalette::Text rather than WindowText, since the vast… | |||||
6571 | | ||||
6561 | // render full groove directly, rather than using the addPage and subPage control element methods | 6572 | // render full groove directly, rather than using the addPage and subPage control element methods | ||
6562 | if( (!StyleConfigData::animationsEnabled() || mouseOver || animated) && option->subControls & SC_ScrollBarGroove ) | 6573 | if( (!StyleConfigData::animationsEnabled() || mouseOver || animated) && option->subControls & SC_ScrollBarGroove ) | ||
6563 | { | 6574 | { | ||
6564 | // retrieve groove rectangle | 6575 | // retrieve groove rectangle | ||
6565 | auto grooveRect( subControlRect( CC_ScrollBar, option, SC_ScrollBarGroove, widget ) ); | 6576 | auto grooveRect( subControlRect( CC_ScrollBar, option, SC_ScrollBarGroove, widget ) ); | ||
6566 | 6577 | | |||
6567 | const auto& palette( option->palette ); | 6578 | const auto& palette( option->palette ); | ||
6568 | const auto color( _helper->alphaColor( palette.color( QPalette::WindowText ), 0.3 * (animated ? opacity : 1) ) ); | 6579 | const auto color( _helper->alphaColor( palette.color( QPalette::WindowText ), 0.3 * (animated ? opacity : 1) ) ); | ||
▲ Show 20 Lines • Show All 679 Lines • Show Last 20 Lines |
Use PenWidth::Frame instead of hardcoding 1.