diff --git a/ChangeLog b/ChangeLog index e29118619..f3946af29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-21 Paul Giblock + + * include/cusis_style.h: + * src/gui/cusis_style.cpp: + Make ScrollBar-hover work again in Qt-4.5 + 2009-02-20 Paul Giblock * include/gui/tracks/pattern_item.h: @@ -27,6 +33,10 @@ * src/gui/classic_style.cpp: Fix text clipping + * gui/lfo_controller_dialog.cpp: + QT4.5 fixes our error where Controllers couldn't have backgrounds, + re-add artwork. + 2009-02-19 Paul Giblock * include/track.h: diff --git a/include/cusis_style.h b/include/cusis_style.h index dddc29289..9c1dc9a8c 100644 --- a/include/cusis_style.h +++ b/include/cusis_style.h @@ -62,6 +62,9 @@ public: QRect subControlRect( ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget ) const; + virtual void polish( QWidget * widget ); + virtual void unpolish( QWidget * widget ); + virtual void drawFxLine( QPainter * _painter, const QWidget *_fxLine, const QString & _name, bool _active ); diff --git a/src/gui/cusis_style.cpp b/src/gui/cusis_style.cpp index df214f912..016c85b48 100644 --- a/src/gui/cusis_style.cpp +++ b/src/gui/cusis_style.cpp @@ -33,6 +33,8 @@ const int BUTTON_LENGTH = 24; #include #include +#include + #include "cusis_style.h" #include "gui_templates.h" @@ -228,7 +230,7 @@ static QString getTcoCacheKey( const QString & _key, _key.toLatin1().constData(), _option->type | ( _option->selected << 4 ) | ( _option->hovered << 5 ), _option->duration, - _option->userColor.name().constData(), + _option->userColor.name().toLatin1().data(), _option->rect.width(), _option->rect.height()); return tmp; @@ -302,6 +304,7 @@ QPalette CusisStyle::standardPalette( void ) const void CusisStyle::hoverColors( bool sunken, bool hover, bool active, QColor & color, QColor & blend ) const { + printf("SB: %d %d %d\n", sunken, hover, active ); if( active ) { if( sunken ) @@ -829,6 +832,25 @@ void CusisStyle::drawPrimitive( PrimitiveElement _element, } +void CusisStyle::polish( QWidget * widget ) +{ + if( qobject_cast(widget) ) + { + widget->setAttribute(Qt::WA_Hover, true); + } +} + + + +void CusisStyle::unpolish(QWidget *widget) +{ + if( qobject_cast(widget) ) + { + widget->setAttribute(Qt::WA_Hover, false); + } +} + + int CusisStyle::pixelMetric( PixelMetric _metric, const QStyleOption * _option, const QWidget * _widget ) const