1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-30 01:00:13 +02:00

* Added TomahawkUtilsGui::defaultIconSize().

This commit is contained in:
Christian Muehlhaeuser
2012-12-05 02:17:39 +01:00
parent 57e59fcb81
commit 19d9cf454e
2 changed files with 93 additions and 20 deletions

View File

@@ -386,6 +386,14 @@ setDefaultFontSize( int points )
}
QSize
defaultIconSize()
{
const int w = defaultFontHeight() * 1.6;
return QSize( w, w );
}
QColor
alphaBlend( const QColor& colorFrom, const QColor& colorTo, float opacity )
{
@@ -408,69 +416,133 @@ defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
{
case DefaultAlbumCover:
if ( mode == CoverInCase )
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/no-album-art-placeholder.png", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/no-album-art-placeholder.svg", size );
else if ( mode == Grid )
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/album-placeholder-grid.png", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/album-placeholder-grid.svg", size );
else
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/no-album-no-case.png", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/no-album-no-case.svg", size );
break;
case DefaultArtistImage:
if ( mode == Grid )
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/artist-placeholder-grid.png", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/artist-placeholder-grid.svg", size );
else
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/no-artist-image-placeholder.png", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/no-artist-image-placeholder.svg", size );
break;
case DefaultTrackImage:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/track-placeholder.png", size );
if ( mode == Grid )
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/track-placeholder-grid.svg", size );
else
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/track-placeholder.png", size );
break;
case DefaultSourceAvatar:
if ( mode == RoundedCorners )
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/user-avatar.png", size, TomahawkUtils::RoundedCorners );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/user-avatar.svg", size, TomahawkUtils::RoundedCorners );
else
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/user-avatar.png", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/user-avatar.svg", size );
break;
case DefaultResolver:
if ( mode == RoundedCorners )
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/resolver-default.svg", size, TomahawkUtils::RoundedCorners );
else
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/resolver-default.svg", size );
break;
case NowPlayingSpeaker:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/now-playing-speaker.png", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/now-playing-speaker.svg", size );
break;
case NowPlayingSpeakerDark:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/now-playing-speaker-dark.png", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/now-playing-speaker-dark.svg", size );
break;
case InfoIcon:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/info.png", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/info.svg", size );
break;
case PlayButton:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/play-rest.svg", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/play-rest.svg", size );
break;
case PlayButtonPressed:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/play-pressed.svg", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/play-pressed.svg", size );
break;
case PauseButton:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/pause-rest.svg", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/pause-rest.svg", size );
break;
case PauseButtonPressed:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/pause-pressed.svg", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/pause-pressed.svg", size );
break;
case PrevButton:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/back-rest.svg", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/back-rest.svg", size );
break;
case PrevButtonPressed:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/back-pressed.svg", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/back-pressed.svg", size );
break;
case NextButton:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/skip-rest.svg", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/skip-rest.svg", size );
break;
case NextButtonPressed:
pixmap = ImageRegistry::instance()->getFromCache( RESPATH "images/skip-pressed.svg", size );
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/skip-pressed.svg", size );
break;
case ShuffleOff:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/shuffle-off-rest.svg", size );
break;
case ShuffleOffPressed:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/shuffle-off-pressed.svg", size );
break;
case ShuffleOn:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/shuffle-on-rest.svg", size );
break;
case ShuffleOnPressed:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/shuffle-on-pressed.svg", size );
break;
case RepeatOne:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/repeat-1-on-rest.svg", size );
break;
case RepeatOnePressed:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/repeat-1-on-pressed.svg", size );
break;
case RepeatAll:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/repeat-all-on-rest.svg", size );
break;
case RepeatAllPressed:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/repeat-all-on-pressed.svg", size );
break;
case RepeatOff:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/repeat-off-rest.svg", size );
break;
case RepeatOffPressed:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/repeat-off-pressed.svg", size );
break;
case VolumeMuted:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/volume-icon-muted.svg", size );
break;
case VolumeFull:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/volume-icon-full.svg", size );
break;
case Share:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/share.svg", size );
break;
case NotLoved:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/not-loved.svg", size );
break;
case Loved:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/loved.svg", size );
break;
case Configure:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/configure.svg", size );
break;
default:

View File

@@ -58,9 +58,10 @@ namespace TomahawkUtils
DLLEXPORT void unmarginLayout( QLayout* layout );
DLLEXPORT void setDefaultFontSize( int points );
DLLEXPORT int defaultFontSize();
DLLEXPORT int defaultFontHeight();
DLLEXPORT void setDefaultFontSize( int points );
DLLEXPORT QSize defaultIconSize();
DLLEXPORT QPixmap defaultPixmap( ImageType type, ImageMode mode = TomahawkUtils::Original, const QSize& size = QSize( 0, 0 ) );