Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezestyle.cpp
Show First 20 Lines • Show All 991 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 = false; | ||
5042 | if (widget) { | ||||
5043 | widgetMouseOver = _animations->scrollBarEngine().isHovered(widget, QStyle::SC_ScrollBarGroove); | ||||
5044 | } else if (option->styleObject) { | ||||
5045 | widgetMouseOver = option->styleObject->property("hover").toBool(); | ||||
5046 | } | ||||
5042 | #else | 5047 | #else | ||
5043 | const bool widgetMouseOver( _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ) ); | 5048 | const bool widgetMouseOver( _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ) ); | ||
5044 | #endif | 5049 | #endif | ||
5045 | 5050 | | |||
5046 | qreal grooveAnimationOpacity( _animations->scrollBarEngine().opacity( widget, QStyle::SC_ScrollBarGroove ) ); | 5051 | qreal grooveAnimationOpacity( _animations->scrollBarEngine().opacity( widget, QStyle::SC_ScrollBarGroove ) ); | ||
5047 | if( grooveAnimationOpacity == AnimationData::OpacityInvalid ) grooveAnimationOpacity = (widgetMouseOver ? 1 : 0); | 5052 | 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; | 5053 | const qreal handleSize = StyleConfigData::animationsEnabled() ? ((Metrics::ScrollBar_SliderWidth / 2.0) * (1 - grooveAnimationOpacity) + Metrics::ScrollBar_SliderWidth * grooveAnimationOpacity) : (int)Metrics::ScrollBar_SliderWidth; | ||
5049 | 5054 | | |||
▲ Show 20 Lines • Show All 991 Lines • Show Last 20 Lines |