|
a/GUI/volumewidget/soundslider.cpp |
|
b/GUI/volumewidget/soundslider.cpp |
|
... |
|
... |
33 |
#include <QPixmap>
|
33 |
#include <QPixmap>
|
34 |
#include <QLinearGradient>
|
34 |
#include <QLinearGradient>
|
35 |
#include <QPainter>
|
35 |
#include <QPainter>
|
36 |
#include <QColor>
|
36 |
#include <QColor>
|
37 |
#include <QPaintEvent>
|
37 |
#include <QPaintEvent>
|
|
|
38 |
#include <QBitmap>
|
|
|
39 |
|
|
|
40 |
#ifndef __MIN
|
|
|
41 |
#define __MIN(A,B) ((A)<(B)?(A):(B))
|
|
|
42 |
#define __MAX(A,B) ((A)>(B)?(A):(B))
|
|
|
43 |
#define qfu( i ) QString::fromUtf8( i )
|
|
|
44 |
#endif
|
38 |
|
45 |
|
39 |
#define WLENGTH_BASE 80 // px
|
46 |
#define WLENGTH_BASE 80 // px
|
40 |
#define WHEIGHT_BASE 22 // px
|
47 |
#define WHEIGHT_BASE 22 // px
|
41 |
#define SOUNDMIN 0 // %
|
48 |
#define SOUNDMIN 0 // %
|
42 |
|
49 |
|
|
... |
|
... |
56 |
setMouseTracking( true );
|
63 |
setMouseTracking( true );
|
57 |
isSliding = false;
|
64 |
isSliding = false;
|
58 |
b_mouseOutside = true;
|
65 |
b_mouseOutside = true;
|
59 |
b_isMuted = false;
|
66 |
b_isMuted = false;
|
60 |
|
67 |
|
61 |
const QPixmap pixOutsideRaw( ":/toolbar/volslide-outside" );
|
68 |
const QPixmap pixOutsideRaw( ":/volslide-outside" );
|
62 |
const QSize pixOutsideSize(
|
69 |
const QSize pixOutsideSize(
|
63 |
static_cast<qreal>(pixOutsideRaw.width()) * scalingFactorX,
|
70 |
static_cast<qreal>(pixOutsideRaw.width()) * scalingFactorX,
|
64 |
static_cast<qreal>(pixOutsideRaw.height()) * scalingFactorY
|
71 |
static_cast<qreal>(pixOutsideRaw.height()) * scalingFactorY
|
65 |
);
|
72 |
);
|
66 |
pixOutside = pixOutsideRaw.scaled(pixOutsideSize);
|
73 |
pixOutside = pixOutsideRaw.scaled(pixOutsideSize);
|
67 |
|
74 |
|
68 |
const QPixmap tempRaw( ":/toolbar/volslide-inside" );
|
75 |
const QPixmap tempRaw( ":/volslide-inside" );
|
69 |
const QSize tempSize(
|
76 |
const QSize tempSize(
|
70 |
static_cast<qreal>(tempRaw.width()) * scalingFactorX,
|
77 |
static_cast<qreal>(tempRaw.width()) * scalingFactorX,
|
71 |
static_cast<qreal>(tempRaw.height()) * scalingFactorY
|
78 |
static_cast<qreal>(tempRaw.height()) * scalingFactorY
|
72 |
);
|
79 |
);
|
73 |
const QPixmap temp = tempRaw.scaled(tempSize);
|
80 |
const QPixmap temp = tempRaw.scaled(tempSize);
|
|
... |
|
... |
118 |
add_desaturated_color( gradient2, range, c1, c2, c3 );
|
125 |
add_desaturated_color( gradient2, range, c1, c2, c3 );
|
119 |
|
126 |
|
120 |
float f_mid_point = ( 100.0 / maximum() );
|
127 |
float f_mid_point = ( 100.0 / maximum() );
|
121 |
QColor * foo;
|
128 |
QColor * foo;
|
122 |
add_colors( gradient, gradient2, 0.0, 0, 1, 2 );
|
129 |
add_colors( gradient, gradient2, 0.0, 0, 1, 2 );
|
|
|
130 |
if (f_mid_point + 0.05 <= 1.0) {
|
123 |
add_colors( gradient, gradient2, f_mid_point - 0.05, 3, 4, 5 );
|
131 |
add_colors( gradient, gradient2, f_mid_point - 0.05, 3, 4, 5 );
|
124 |
add_colors( gradient, gradient2, f_mid_point + 0.05, 6, 7, 8 );
|
132 |
add_colors( gradient, gradient2, f_mid_point + 0.05, 6, 7, 8 );
|
|
|
133 |
}
|
125 |
add_colors( gradient, gradient2, 1.0, 9, 10, 11 );
|
134 |
add_colors( gradient, gradient2, 1.0, 9, 10, 11 );
|
126 |
|
135 |
|
127 |
painter.begin( &pixGradient );
|
136 |
painter.begin( &pixGradient );
|
128 |
painter.setPen( Qt::NoPen );
|
137 |
painter.setPen( Qt::NoPen );
|
129 |
painter.setBrush( gradient );
|
138 |
painter.setBrush( gradient );
|