|
|
@ -112,7 +112,7 @@ KMixDockWidget::createMasterVolWidget()
|
|
|
|
// In case that there is no mixer installed, there will be no newVolumeLevels() signal's
|
|
|
|
// In case that there is no mixer installed, there will be no newVolumeLevels() signal's
|
|
|
|
// Thus we prepare the dock areas manually
|
|
|
|
// Thus we prepare the dock areas manually
|
|
|
|
setVolumeTip();
|
|
|
|
setVolumeTip();
|
|
|
|
updatePixmap();
|
|
|
|
updatePixmap(false);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// create devices
|
|
|
|
// create devices
|
|
|
@ -126,7 +126,7 @@ KMixDockWidget::createMasterVolWidget()
|
|
|
|
The call to m_mixer->readSetFromHWforceUpdate() is most likely superfluous, even if we don't use QSocketNotifier (e.g. in backends OSS, Solaris, ...)
|
|
|
|
The call to m_mixer->readSetFromHWforceUpdate() is most likely superfluous, even if we don't use QSocketNotifier (e.g. in backends OSS, Solaris, ...)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
setVolumeTip();
|
|
|
|
setVolumeTip();
|
|
|
|
updatePixmap();
|
|
|
|
updatePixmap(false);
|
|
|
|
/* We are setting up 3 connections:
|
|
|
|
/* We are setting up 3 connections:
|
|
|
|
* Refreshig the _dockAreaPopup (not anymore neccesary, because ViewBase already does it)
|
|
|
|
* Refreshig the _dockAreaPopup (not anymore neccesary, because ViewBase already does it)
|
|
|
|
* Refreshing the Tooltip
|
|
|
|
* Refreshing the Tooltip
|
|
|
@ -135,9 +135,13 @@ KMixDockWidget::createMasterVolWidget()
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
// connect( m_mixer, SIGNAL(newVolumeLevels()), _dockAreaPopup, SLOT(refreshVolumeLevels()) );
|
|
|
|
// connect( m_mixer, SIGNAL(newVolumeLevels()), _dockAreaPopup, SLOT(refreshVolumeLevels()) );
|
|
|
|
connect( m_mixer, SIGNAL(newVolumeLevels()), this, SLOT(setVolumeTip() ) );
|
|
|
|
connect( m_mixer, SIGNAL(newVolumeLevels()), this, SLOT(setVolumeTip() ) );
|
|
|
|
connect( m_mixer, SIGNAL(newVolumeLevels()), this, SLOT(updatePixmap() ) );
|
|
|
|
connect( m_mixer, SIGNAL(newVolumeLevels()), this, SLOT(slotUpdatePixmap() ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KMixDockWidget::slotUpdatePixmap()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
updatePixmap(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KMixDockWidget::selectMaster()
|
|
|
|
void KMixDockWidget::selectMaster()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -208,7 +212,7 @@ KMixDockWidget::setVolumeTip()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
KMixDockWidget::updatePixmap()
|
|
|
|
KMixDockWidget::updatePixmap(bool force)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MixDevice *md = 0;
|
|
|
|
MixDevice *md = 0;
|
|
|
|
if ( _dockAreaPopup != 0 ) {
|
|
|
|
if ( _dockAreaPopup != 0 ) {
|
|
|
@ -228,17 +232,29 @@ KMixDockWidget::updatePixmap()
|
|
|
|
newPixmapType = 'd';
|
|
|
|
newPixmapType = 'd';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (( newPixmapType != _oldPixmapType ) || (force == true)) {
|
|
|
|
if ( newPixmapType != _oldPixmapType ) {
|
|
|
|
|
|
|
|
// Pixmap must be changed => do so
|
|
|
|
// Pixmap must be changed => do so
|
|
|
|
|
|
|
|
// Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
|
|
|
|
|
|
|
|
QPixmap origpixmap;
|
|
|
|
|
|
|
|
QPixmap scaledpixmap;
|
|
|
|
|
|
|
|
QImage newIcon;
|
|
|
|
switch ( newPixmapType ) {
|
|
|
|
switch ( newPixmapType ) {
|
|
|
|
case 'e': setPixmap( loadIcon( "kmixdocked_error" ) ); break;
|
|
|
|
case 'e': origpixmap = loadSizedIcon( "kmixdocked_error", width() ); break;
|
|
|
|
case 'm': setPixmap( loadIcon( "kmixdocked_mute" ) ); break;
|
|
|
|
case 'm': origpixmap = loadSizedIcon( "kmixdocked_mute" , width() ); break;
|
|
|
|
case 'd': setPixmap( loadIcon( "kmixdocked" ) ); break;
|
|
|
|
case 'd': origpixmap = loadSizedIcon( "kmixdocked" , width() ); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
newIcon = origpixmap;
|
|
|
|
|
|
|
|
newIcon = newIcon.smoothScale(width(), height());
|
|
|
|
|
|
|
|
scaledpixmap = newIcon;
|
|
|
|
|
|
|
|
setPixmap(scaledpixmap);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_oldPixmapType = newPixmapType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_oldPixmapType = newPixmapType;
|
|
|
|
void KMixDockWidget::resizeEvent ( QResizeEvent * )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
updatePixmap(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|