-rw-r--r-- | core/applets/volumeapplet/volume.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp index aec346b..06eec58 100644 --- a/core/applets/volumeapplet/volume.cpp +++ b/core/applets/volumeapplet/volume.cpp @@ -536,97 +536,97 @@ void VolumeControl::micMoved ( int percent ) m_mic_percent = ( m_mic_percent < 0 ) ? 0 : (( m_mic_percent > 100 ) ? 100 : m_mic_percent ); writeConfigEntry ( "Mic", m_mic_percent, UPD_Mic ); } void VolumeControl::alarmMoved ( int percent ) { m_alarm_percent = 100 - percent; // clamp volume percent to be between 0 and 100 m_alarm_percent = ( m_alarm_percent < 0 ) ? 0 : (( m_alarm_percent > 100 ) ? 100 : m_alarm_percent ); writeConfigEntry ( "AlarmPercent", m_alarm_percent, UPD_None ); } void VolumeControl::writeConfigEntry ( const char *entry, int val, eUpdate upd ) { Config cfg ( "qpe" ); cfg. setGroup ( "Volume" ); cfg. writeEntry ( entry, val ); // cfg. write ( ); #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) switch ( upd ) { case UPD_Vol: { QCopEnvelope ( "QPE/System", "volumeChange(bool)" ) << m_vol_muted; break; } case UPD_Mic: { QCopEnvelope ( "QPE/System", "micChange(bool)" ) << m_mic_muted; break; } case UPD_None: break; } #endif } //=========================================================================== VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) { setFixedHeight ( 18 ); setFixedWidth ( 14 ); m_pixmap = new QPixmap ( Resource::loadPixmap ( "volume" )); - m_dialog = new VolumeControl ( this ); + m_dialog = new VolumeControl ( this, true, this, "volumecontrol" ); connect ( qApp, SIGNAL( volumeChanged ( bool )), m_dialog, SLOT( volumeChanged( bool ))); connect ( qApp, SIGNAL( micChanged ( bool )), m_dialog, SLOT ( micChanged( bool ))); } VolumeApplet::~VolumeApplet() { delete m_pixmap; } void VolumeApplet::mousePressEvent ( QMouseEvent * ) { if ( m_dialog-> isVisible ( )) m_dialog-> hide ( ); else m_dialog-> show ( true ); } void VolumeApplet::redraw ( bool all ) { if ( all ) repaint ( true ); else repaint ( 2, height ( ) - 3, width ( ) - 4, 2, false ); } void VolumeApplet::paintEvent ( QPaintEvent * ) { QPainter p ( this ); p. drawPixmap ( 0, 1, *m_pixmap ); p. setPen ( darkGray ); p. drawRect ( 1, height() - 4, width() - 2, 4 ); int pixelsWide = m_dialog-> volPercent ( ) * ( width() - 4 ) / 100; p. fillRect ( 2, height() - 3, pixelsWide, 2, red ); p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray ); if ( m_dialog-> volMuted ( )) { p. setPen ( red ); p. drawLine ( 1, 2, width() - 2, height() - 5 ); p. drawLine ( 1, 3, width() - 2, height() - 4 ); p. drawLine ( width() - 2, 2, 1, height() - 5 ); p. drawLine ( width() - 2, 3, 1, height() - 4 ); } } |