vlc | branch: master | Francois Cartegnie <[email protected]> | Mon Mar 5 22:24:22 2012 +0100| [c9186e33f299e7045e70f07d8562c4c38b8421ef] | committer: Francois Cartegnie
Qt: SoundSlider: create gradients according to sound max value > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c9186e33f299e7045e70f07d8562c4c38b8421ef --- modules/gui/qt4/util/input_slider.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp index e43560d..3cf5fcd 100644 --- a/modules/gui/qt4/util/input_slider.cpp +++ b/modules/gui/qt4/util/input_slider.cpp @@ -636,10 +636,11 @@ SoundSlider::SoundSlider( QWidget *_parent, int _i_step, bool b_hard, add_color( gradient1, range, c1, c2, c3 ); \ add_desaturated_color( gradient2, range, c1, c2, c3 ); + float f_mid_point = ( 100.0 / maximum() ); QColor * foo; add_colors( gradient, gradient2, 0.0, 0, 1, 2 ); - add_colors( gradient, gradient2, 0.45, 3, 4, 5 ); - add_colors( gradient, gradient2, 0.55, 6, 7, 8 ); + add_colors( gradient, gradient2, f_mid_point - 0.05, 3, 4, 5 ); + add_colors( gradient, gradient2, f_mid_point + 0.05, 6, 7, 8 ); add_colors( gradient, gradient2, 1.0, 9, 10, 11 ); painter.begin( &pixGradient ); _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
