97
103
TimeSlider *t = new TimeSlider(parent);
98
104
t->setEnabled( isEnabled() );
106
if (custom_style) t->setStyle(custom_style);
107
if (!custom_stylesheet.isEmpty()) t->setStyleSheet(custom_stylesheet);
100
109
connect( t, SIGNAL(posChanged(int)),
101
110
this, SIGNAL(posChanged(int)) );
102
111
connect( t, SIGNAL(draggingPos(int)),
153
void VolumeSliderAction::setTickPosition(QSlider::TickPosition position) {
155
tick_position = position;
157
// Propagate changes to all existing widgets
158
QList<QWidget *> l = createdWidgets();
159
for (int n=0; n < l.count(); n++) {
160
MySlider *s = (MySlider*) l[n];
161
s->setTickPosition(tick_position);
141
165
QWidget * VolumeSliderAction::createWidget ( QWidget * parent ) {
142
166
MySlider *t = new MySlider(parent);
168
if (custom_style) t->setStyle(custom_style);
169
if (!custom_stylesheet.isEmpty()) t->setStyleSheet(custom_stylesheet);
170
if (fixed_size.isValid()) t->setFixedSize(fixed_size);
143
172
t->setMinimum(0);
144
173
t->setMaximum(100);
146
175
t->setOrientation( Qt::Horizontal );
147
176
t->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
148
177
t->setFocusPolicy( Qt::NoFocus );
149
t->setTickPosition( QSlider::TicksBelow );
178
t->setTickPosition( tick_position );
150
179
t->setTickInterval( 10 );
151
180
t->setSingleStep( 1 );
152
181
t->setPageStep( 10 );
153
182
t->setToolTip( tr("Volume") );
154
183
t->setEnabled( isEnabled() );
184
t->setAttribute(Qt::WA_NoMousePropagation);
156
186
connect( t, SIGNAL(valueChanged(int)),
157
187
this, SIGNAL(valueChanged(int)) );
192
TimeLabelAction::TimeLabelAction( QWidget * parent )
193
: MyWidgetAction(parent)
197
TimeLabelAction::~TimeLabelAction() {
200
void TimeLabelAction::setText(QString s) {
205
QWidget * TimeLabelAction::createWidget ( QWidget * parent ) {
206
QLabel * time_label = new QLabel(parent);
207
time_label->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
208
time_label->setAutoFillBackground(true);
210
ColorUtils::setBackgroundColor( time_label, QColor(0,0,0) );
211
ColorUtils::setForegroundColor( time_label, QColor(255,255,255) );
212
time_label->setText( "00:00:00 / 00:00:00" );
213
time_label->setFrameShape( QFrame::Panel );
214
time_label->setFrameShadow( QFrame::Sunken );
216
connect( this, SIGNAL(newText(QString)),
217
time_label, SLOT(setText(QString)) );
161
222
#if MINI_ARROW_BUTTONS
162
223
SeekingButton::SeekingButton( QList<QAction*> actions, QWidget * parent )
163
224
: QWidgetAction(parent)
171
232
QWidget * SeekingButton::createWidget( QWidget * parent ) {
172
233
QToolButton * button = new QToolButton(parent);
173
button->setPopupMode(QToolButton::DelayedPopup);
234
button->setPopupMode(QToolButton::MenuButtonPopup);
175
236
if (_actions.count() > 0 ) {
176
237
button->setDefaultAction( _actions[0] );