Commit 2454c120 authored by Jan Blackquill's avatar Jan Blackquill 🌈
Browse files

Remove hover animations

Removing hover animations makes controls feel more responsive due to taking less time to respond to the user.

Stripping out the hover code causes a lot of problems due to the code's architecture being highly dependent on the animation engines to keep track of stuff like subcontrol rects and whatnot, so simply hardcoding the values to 0 will suffice for now.
parent 020cfd14
......@@ -18,7 +18,10 @@ namespace Breeze
if( !widget ) return false;
// create new data class
if( !_hoverData.contains( widget ) ) _hoverData.insert( widget, new TabBarData( this, widget, duration() ), enabled() );
// Stripping out the hover code causes a lot of problems due to the code's architecture being highly dependent on the animation engines to keep track of stuff like
// subcontrol rects and whatnot, so simply hardcoding this value to 0 will suffice for now.
if( !_hoverData.contains( widget ) ) _hoverData.insert( widget, new TabBarData( this, widget, 0 ), enabled() );
if( !_focusData.contains( widget ) ) _focusData.insert( widget, new TabBarData( this, widget, duration() ), enabled() );
// connect destruction signal
......
......@@ -16,7 +16,9 @@ namespace Breeze
{
if( !widget ) return false;
if( mode&AnimationHover && !_hoverData.contains( widget ) ) { _hoverData.insert( widget, new WidgetStateData( this, widget, duration() ), enabled() ); }
// Stripping out the hover code causes a lot of problems due to the code's architecture being highly dependent on the animation engines to keep track of stuff like
// subcontrol rects and whatnot, so simply hardcoding this value to 0 will suffice for now.
if( mode&AnimationHover && !_hoverData.contains( widget ) ) { _hoverData.insert( widget, new WidgetStateData( this, widget, 0 ), enabled() ); }
if( mode&AnimationFocus && !_focusData.contains( widget ) ) { _focusData.insert( widget, new WidgetStateData( this, widget, duration() ), enabled() ); }
if( mode&AnimationEnable && !_enableData.contains( widget ) ) { _enableData.insert( widget, new EnableData( this, widget, duration() ), enabled() ); }
if( mode&AnimationPressed && !_pressedData.contains( widget ) ) { _pressedData.insert( widget, new WidgetStateData( this, widget, duration() ), enabled() ); }
......@@ -74,6 +76,9 @@ namespace Breeze
//____________________________________________________________
bool WidgetStateEngine::isAnimated( const QObject* object, AnimationMode mode )
{
// Stripping out the hover code causes a lot of problems due to the code's architecture being highly dependent on the animation engines to keep track of stuff like
// subcontrol rects and whatnot, so simply hardcoding this value to false will suffice for now.
if (mode == AnimationHover) return false;
DataMap<WidgetStateData>::Value data( WidgetStateEngine::data( object, mode ) );
return ( data && data.data()->animation() && data.data()->animation().data()->isRunning() );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment