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 2318 Lines • ▼ Show 20 Line(s) | 2261 | { | |||
---|---|---|---|---|---|
2319 | 2319 | | |||
2320 | return ParentStyleClass::subControlRect( CC_SpinBox, option, subControl, widget ); | 2320 | return ParentStyleClass::subControlRect( CC_SpinBox, option, subControl, widget ); | ||
2321 | 2321 | | |||
2322 | } | 2322 | } | ||
2323 | 2323 | | |||
2324 | //___________________________________________________________________________________________________________________ | 2324 | //___________________________________________________________________________________________________________________ | ||
2325 | QRect Style::scrollBarInternalSubControlRect( const QStyleOptionComplex* option, SubControl subControl ) const | 2325 | QRect Style::scrollBarInternalSubControlRect( const QStyleOptionComplex* option, SubControl subControl ) const | ||
2326 | { | 2326 | { | ||
2327 | | ||||
2328 | const auto& rect = option->rect; | | |||
2329 | const State& state( option->state ); | 2327 | const State& state( option->state ); | ||
2330 | const bool horizontal( state & State_Horizontal ); | 2328 | const bool horizontal( state & State_Horizontal ); | ||
2331 | 2329 | | |||
2330 | QRect rect = option->rect; | ||||
2331 | if (horizontal) { | ||||
2332 | rect.setTop(PenWidth::Frame); | ||||
2333 | } else { | ||||
2334 | rect.setLeft(PenWidth::Frame); | ||||
2335 | } | ||||
2336 | | ||||
2332 | switch( subControl ) | 2337 | switch( subControl ) | ||
2333 | { | 2338 | { | ||
2334 | 2339 | | |||
2335 | case SC_ScrollBarSubLine: | 2340 | case SC_ScrollBarSubLine: | ||
2336 | { | 2341 | { | ||
2337 | int majorSize( scrollBarButtonHeight( _subLineButtons ) ); | 2342 | int majorSize( scrollBarButtonHeight( _subLineButtons ) ); | ||
2338 | if( horizontal ) return visualRect( option, QRect( rect.left(), rect.top(), majorSize, rect.height() ) ); | 2343 | if( horizontal ) return visualRect( option, QRect( rect.left(), rect.top(), majorSize, rect.height() ) ); | ||
2339 | else return visualRect( option, QRect( rect.left(), rect.top(), rect.width(), majorSize ) ); | 2344 | else return visualRect( option, QRect( rect.left(), rect.top(), rect.width(), majorSize ) ); | ||
▲ Show 20 Lines • Show All 4213 Lines • ▼ Show 20 Line(s) | 6557 | { | |||
6553 | //the animation for QStyle::SC_ScrollBarGroove is special: it will animate | 6558 | //the animation for QStyle::SC_ScrollBarGroove is special: it will animate | ||
6554 | //the opacity of everything else as well, included slider and arrows | 6559 | //the opacity of everything else as well, included slider and arrows | ||
6555 | qreal opacity( _animations->scrollBarEngine().opacity( widget, QStyle::SC_ScrollBarGroove ) ); | 6560 | qreal opacity( _animations->scrollBarEngine().opacity( widget, QStyle::SC_ScrollBarGroove ) ); | ||
6556 | const bool animated( StyleConfigData::animationsEnabled() && _animations->scrollBarEngine().isAnimated( widget, AnimationHover, QStyle::SC_ScrollBarGroove ) ); | 6561 | const bool animated( StyleConfigData::animationsEnabled() && _animations->scrollBarEngine().isAnimated( widget, AnimationHover, QStyle::SC_ScrollBarGroove ) ); | ||
6557 | const bool mouseOver( option->state & State_MouseOver ); | 6562 | const bool mouseOver( option->state & State_MouseOver ); | ||
6558 | 6563 | | |||
6559 | if( opacity == AnimationData::OpacityInvalid ) opacity = 1; | 6564 | if( opacity == AnimationData::OpacityInvalid ) opacity = 1; | ||
6560 | 6565 | | |||
6566 | QRect separatorRect; | ||||
6567 | if ( option->state & State_Horizontal ) { | ||||
6568 | separatorRect = QRect(0, 0, option->rect.width(), 1); | ||||
6569 | } else { | ||||
6570 | separatorRect = alignedRect(option->direction, | ||||
6571 | Qt::AlignLeft, | ||||
6572 | QSize(1, option->rect.height()), option->rect); | ||||
ndavis: Use PenWidth::Frame instead of hardcoding 1. | |||||
6573 | } | ||||
6574 | | ||||
6575 | _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… | |||||
6576 | | ||||
6561 | // render full groove directly, rather than using the addPage and subPage control element methods | 6577 | // render full groove directly, rather than using the addPage and subPage control element methods | ||
6562 | if( (!StyleConfigData::animationsEnabled() || mouseOver || animated) && option->subControls & SC_ScrollBarGroove ) | 6578 | if( (!StyleConfigData::animationsEnabled() || mouseOver || animated) && option->subControls & SC_ScrollBarGroove ) | ||
6563 | { | 6579 | { | ||
6564 | // retrieve groove rectangle | 6580 | // retrieve groove rectangle | ||
6565 | auto grooveRect( subControlRect( CC_ScrollBar, option, SC_ScrollBarGroove, widget ) ); | 6581 | auto grooveRect( subControlRect( CC_ScrollBar, option, SC_ScrollBarGroove, widget ) ); | ||
6566 | 6582 | | |||
6567 | const auto& palette( option->palette ); | 6583 | const auto& palette( option->palette ); | ||
6568 | const auto color( _helper->alphaColor( palette.color( QPalette::WindowText ), 0.3 * (animated ? opacity : 1) ) ); | 6584 | 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.