Updated icon names in tray widget.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/30/head
Mavridis Philippe 3 years ago
parent f2ffa187cd
commit 6484ff8853
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -254,7 +254,6 @@ KMixDockWidget::getAvgVolume()
if ( md == 0 || md->maxVolume() == 0 )
return -1;
kdDebug() << "Volume % is " << (md->getVolume().getAvgVolume(Volume::MMAIN)*100 )/( md->maxVolume() ) << endl;
return (md->getVolume().getAvgVolume(Volume::MMAIN)*100 )/( md->maxVolume() );
}
@ -318,7 +317,13 @@ KMixDockWidget::updatePixmap(bool force)
}
else
{
newPixmapType = 'd';
long avgVol = getAvgVolume();
if ( avgVol <= 35 )
newPixmapType = 'L';
else if ( avgVol <= 70 )
newPixmapType = 'M';
else
newPixmapType = 'H';
}
if (( newPixmapType != _oldPixmapType ) || (force == true)) {
@ -328,9 +333,12 @@ KMixDockWidget::updatePixmap(bool force)
TQPixmap scaledpixmap;
TQImage newIcon;
switch ( newPixmapType ) {
case 'e': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_error", width() ) : loadIcon( "kmixdocked_error"); break;
case 'm': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_mute" , width() ) : loadIcon( "kmixdocked_mute"); break;
case 'd': origpixmap = isShown() ? loadSizedIcon( "kmixdocked" , width() ) : loadIcon( "kmixdocked "); break;
// AFAIK no icon theme has an icon analogous to kmixdocked_error
case 'e': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_error" , width() ) : loadIcon( "kmixdocked_error" ); break;
case 'm': origpixmap = isShown() ? loadSizedIcon( "audio-volume-muted" , width() ) : loadIcon( "audio-volume-muted" ); break;
case 'L': origpixmap = isShown() ? loadSizedIcon( "audio-volume-low" , width() ) : loadIcon( "audio-volume-low" ); break;
case 'M': origpixmap = isShown() ? loadSizedIcon( "audio-volume-medium", width() ) : loadIcon( "audio-volume-medium" ); break;
case 'H': origpixmap = isShown() ? loadSizedIcon( "audio-volume-high" , width() ) : loadIcon( "audio-volume-high" ); break;
}
newIcon = origpixmap;
if (isShown()) {

Loading…
Cancel
Save