|
|
@ -31,13 +31,19 @@ public:
|
|
|
|
slider->setRange( 0, 100 );
|
|
|
|
slider->setRange( 0, 100 );
|
|
|
|
|
|
|
|
|
|
|
|
setFrameStyle( TQFrame::Plain | TQFrame::Box );
|
|
|
|
setFrameStyle( TQFrame::Plain | TQFrame::Box );
|
|
|
|
setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed );
|
|
|
|
setSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Preferred );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Calculate width required for max label size
|
|
|
|
|
|
|
|
label->setText( "100%" );
|
|
|
|
|
|
|
|
adjustSize();
|
|
|
|
|
|
|
|
requiredWidth = width();
|
|
|
|
|
|
|
|
|
|
|
|
hide();
|
|
|
|
hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQLabel *label;
|
|
|
|
TQLabel *label;
|
|
|
|
TQSlider *slider;
|
|
|
|
TQSlider *slider;
|
|
|
|
|
|
|
|
int requiredWidth;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -71,6 +77,10 @@ VolumeAction::toggled( bool const b )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DEBUG_BLOCK
|
|
|
|
DEBUG_BLOCK
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString t = TQString::number(Codeine::engine()->volume()) + "%";
|
|
|
|
|
|
|
|
setToolTip( i18n( "Volume: %1" ).arg( t ) );
|
|
|
|
|
|
|
|
m_widget->label->setText( t );
|
|
|
|
|
|
|
|
|
|
|
|
m_widget->raise();
|
|
|
|
m_widget->raise();
|
|
|
|
m_widget->setShown( b );
|
|
|
|
m_widget->setShown( b );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -80,7 +90,7 @@ VolumeAction::sliderMoved( int v )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
v = 100 - v; //TQt sliders are wrong way round when vertical
|
|
|
|
v = 100 - v; //TQt sliders are wrong way round when vertical
|
|
|
|
|
|
|
|
|
|
|
|
TQString const t = TQString::number( v ) + '%';
|
|
|
|
TQString t = TQString::number( v ) + '%';
|
|
|
|
|
|
|
|
|
|
|
|
setToolTip( i18n( "Volume: %1" ).arg( t ) );
|
|
|
|
setToolTip( i18n( "Volume: %1" ).arg( t ) );
|
|
|
|
m_widget->label->setText( t );
|
|
|
|
m_widget->label->setText( t );
|
|
|
@ -94,8 +104,8 @@ VolumeAction::eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
case TQEvent::Resize: {
|
|
|
|
case TQEvent::Resize: {
|
|
|
|
TQWidget const * const &a = m_anchor;
|
|
|
|
TQWidget const * const &a = m_anchor;
|
|
|
|
|
|
|
|
|
|
|
|
m_widget->move( a->mapTo( m_widget->parentWidget(), TQPoint( 0, a->height() ) ) );
|
|
|
|
m_widget->resize( m_widget->requiredWidth, m_widget->sizeHint().height() );
|
|
|
|
m_widget->resize( a->width(), m_widget->sizeHint().height() );
|
|
|
|
m_widget->move( a->mapTo( m_widget->parentWidget(), TQPoint( a->width() - m_widget->width(), a->height() ) ) );
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|