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 5032 Lines • ▼ Show 20 Line(s) | 5029 | { | |||
---|---|---|---|---|---|
5033 | if( !sliderOption ) return true; | 5033 | if( !sliderOption ) return true; | ||
5034 | 5034 | | |||
5035 | // copy rect and palette | 5035 | // copy rect and palette | ||
5036 | const auto& rect( option->rect ); | 5036 | const auto& rect( option->rect ); | ||
5037 | const auto& palette( option->palette ); | 5037 | const auto& palette( option->palette ); | ||
5038 | 5038 | | |||
5039 | //try to understand if anywhere the widget is under mouse, not just the handle, use _animations in case of QWidget, option->styleObject in case of QML | 5039 | //try to understand if anywhere the widget is under mouse, not just the handle, use _animations in case of QWidget, option->styleObject in case of QML | ||
5040 | #if QT_VERSION >= 0x050000 | 5040 | #if QT_VERSION >= 0x050000 | ||
5041 | const bool widgetMouseOver( widget ? _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ) : option->styleObject->property("hover").toBool()); | 5041 | bool widgetMouseOver( ( option->state & State_MouseOver ) ); | ||
5042 | if( widget ) widgetMouseOver = _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ); | ||||
5043 | else if( option->styleObject ) widgetMouseOver = option->styleObject->property("hover").toBool(); | ||||
5042 | #else | 5044 | #else | ||
5043 | const bool widgetMouseOver( _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ) ); | 5045 | const bool widgetMouseOver( _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ) ); | ||
5044 | #endif | 5046 | #endif | ||
5045 | 5047 | | |||
5046 | qreal grooveAnimationOpacity( _animations->scrollBarEngine().opacity( widget, QStyle::SC_ScrollBarGroove ) ); | 5048 | qreal grooveAnimationOpacity( _animations->scrollBarEngine().opacity( widget, QStyle::SC_ScrollBarGroove ) ); | ||
5047 | if( grooveAnimationOpacity == AnimationData::OpacityInvalid ) grooveAnimationOpacity = (widgetMouseOver ? 1 : 0); | 5049 | if( grooveAnimationOpacity == AnimationData::OpacityInvalid ) grooveAnimationOpacity = (widgetMouseOver ? 1 : 0); | ||
5048 | const qreal handleSize = StyleConfigData::animationsEnabled() ? ((Metrics::ScrollBar_SliderWidth / 2.0) * (1 - grooveAnimationOpacity) + Metrics::ScrollBar_SliderWidth * grooveAnimationOpacity) : (int)Metrics::ScrollBar_SliderWidth; | 5050 | const qreal handleSize = StyleConfigData::animationsEnabled() ? ((Metrics::ScrollBar_SliderWidth / 2.0) * (1 - grooveAnimationOpacity) + Metrics::ScrollBar_SliderWidth * grooveAnimationOpacity) : (int)Metrics::ScrollBar_SliderWidth; | ||
5049 | 5051 | | |||
▲ Show 20 Lines • Show All 2115 Lines • Show Last 20 Lines |