1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-20 04:41:36 +02:00

* Started using SVGs for a bunch of images instead of good ol' PNG.

This commit is contained in:
Christian Muehlhaeuser
2012-12-05 02:18:55 +01:00
parent 19d9cf454e
commit 79c6eaba80
12 changed files with 151 additions and 139 deletions

View File

@@ -1,51 +1,44 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>data/images/back-pressed.png</file>
<file>data/images/back-rest.png</file>
<file>data/images/back-pressed.svg</file> <file>data/images/back-pressed.svg</file>
<file>data/images/back-rest.svg</file> <file>data/images/back-rest.svg</file>
<file>data/images/filter.png</file> <file>data/images/filter.svg</file>
<file>data/images/loved.png</file> <file>data/images/loved.svg</file>
<file>data/images/not-loved.png</file> <file>data/images/not-loved.svg</file>
<file>data/images/no-album-art-placeholder.png</file> <file>data/images/no-album-art-placeholder.svg</file>
<file>data/images/no-artist-image-placeholder.png</file> <file>data/images/no-artist-image-placeholder.svg</file>
<file>data/images/artist-placeholder-grid.png</file> <file>data/images/artist-placeholder-grid.svg</file>
<file>data/images/album-placeholder-grid.png</file> <file>data/images/album-placeholder-grid.svg</file>
<file>data/images/track-placeholder.png</file> <file>data/images/track-placeholder.png</file>
<file>data/images/track-placeholder-grid.svg</file>
<file>data/images/now-playing-panel.png</file> <file>data/images/now-playing-panel.png</file>
<file>data/images/now-playing-speaker.png</file> <file>data/images/now-playing-speaker.png</file>
<file>data/images/now-playing-speaker-dark.png</file> <file>data/images/now-playing-speaker-dark.png</file>
<file>data/images/pause-pressed.png</file>
<file>data/images/pause-rest.png</file>
<file>data/images/pause-pressed.svg</file> <file>data/images/pause-pressed.svg</file>
<file>data/images/pause-rest.svg</file> <file>data/images/pause-rest.svg</file>
<file>data/images/play-pressed.png</file>
<file>data/images/play-pressed.svg</file> <file>data/images/play-pressed.svg</file>
<file>data/images/play-rest.png</file>
<file>data/images/play-rest.svg</file> <file>data/images/play-rest.svg</file>
<file>data/images/sipplugin-add.png</file> <file>data/images/sipplugin-add.png</file>
<file>data/images/sipplugin-remove.png</file> <file>data/images/sipplugin-remove.png</file>
<file>data/images/playlist-icon.png</file> <file>data/images/playlist-icon.png</file>
<file>data/images/repeat-1-on-pressed.png</file> <file>data/images/repeat-1-on-pressed.svg</file>
<file>data/images/repeat-1-on-rest.png</file> <file>data/images/repeat-1-on-rest.svg</file>
<file>data/images/repeat-all-on-pressed.png</file> <file>data/images/repeat-all-on-pressed.svg</file>
<file>data/images/repeat-all-on-rest.png</file> <file>data/images/repeat-all-on-rest.svg</file>
<file>data/images/repeat-off-pressed.png</file> <file>data/images/repeat-off-pressed.svg</file>
<file>data/images/repeat-off-rest.png</file> <file>data/images/repeat-off-rest.svg</file>
<file>data/images/search-box-dismiss-x.png</file> <file>data/images/search-box-dismiss-x.png</file>
<file>data/images/seek-and-volume-knob-pressed.png</file> <file>data/images/seek-and-volume-knob-pressed.png</file>
<file>data/images/seek-and-volume-knob-rest.png</file> <file>data/images/seek-and-volume-knob-rest.png</file>
<file>data/images/seek-slider-bkg.png</file> <file>data/images/seek-slider-bkg.png</file>
<file>data/images/seek-slider-level.png</file> <file>data/images/seek-slider-level.png</file>
<file>data/images/shuffle-off-pressed.png</file> <file>data/images/shuffle-off-pressed.svg</file>
<file>data/images/shuffle-off-rest.png</file> <file>data/images/shuffle-off-rest.svg</file>
<file>data/images/shuffle-on-pressed.png</file> <file>data/images/shuffle-on-pressed.svg</file>
<file>data/images/shuffle-on-rest.png</file> <file>data/images/shuffle-on-rest.svg</file>
<file>data/images/skip-pressed.png</file>
<file>data/images/skip-rest.png</file>
<file>data/images/skip-pressed.svg</file> <file>data/images/skip-pressed.svg</file>
<file>data/images/skip-rest.svg</file> <file>data/images/skip-rest.svg</file>
<file>data/images/user-avatar.png</file> <file>data/images/user-avatar.svg</file>
<file>data/images/view-toggle-active-centre.png</file> <file>data/images/view-toggle-active-centre.png</file>
<file>data/images/view-toggle-active-left.png</file> <file>data/images/view-toggle-active-left.png</file>
<file>data/images/view-toggle-active-right.png</file> <file>data/images/view-toggle-active-right.png</file>
@@ -67,19 +60,19 @@
<file>data/images/list-remove.png</file> <file>data/images/list-remove.png</file>
<file>data/images/arrow-up-double.png</file> <file>data/images/arrow-up-double.png</file>
<file>data/images/arrow-down-double.png</file> <file>data/images/arrow-down-double.png</file>
<file>data/images/volume-icon-full.png</file>
<file>data/images/arrow-right-double.png</file> <file>data/images/arrow-right-double.png</file>
<file>data/images/view-refresh.png</file> <file>data/images/view-refresh.png</file>
<file>data/images/volume-icon-muted.png</file> <file>data/images/volume-icon-muted.svg</file>
<file>data/images/volume-icon-full.svg</file>
<file>data/images/volume-slider-bkg.png</file> <file>data/images/volume-slider-bkg.png</file>
<file>data/images/volume-slider-level.png</file> <file>data/images/volume-slider-level.png</file>
<file>data/images/echonest_logo.png</file> <file>data/images/echonest_logo.png</file>
<file>data/images/loading-animation.gif</file> <file>data/images/loading-animation.gif</file>
<file>data/images/info.png</file> <file>data/images/info.png</file>
<file>data/images/back.png</file> <file>data/images/back.svg</file>
<file>data/images/forward.png</file> <file>data/images/forward.svg</file>
<file>data/images/music-icon.png</file> <file>data/images/music-icon.png</file>
<file>data/images/configure.png</file> <file>data/images/configure.svg</file>
<file>data/images/private-listening.png</file> <file>data/images/private-listening.png</file>
<file>data/images/add.png</file> <file>data/images/add.png</file>
<file>data/images/recently-played.png</file> <file>data/images/recently-played.png</file>
@@ -142,13 +135,13 @@
<file>data/images/closed-padlock.png</file> <file>data/images/closed-padlock.png</file>
<file>data/images/open-padlock.png</file> <file>data/images/open-padlock.png</file>
<file>data/images/headphones-bigger.png</file> <file>data/images/headphones-bigger.png</file>
<file>data/images/no-album-no-case.png</file> <file>data/images/no-album-no-case.svg</file>
<file>data/images/rdio.png</file> <file>data/images/rdio.png</file>
<file>data/images/grooveshark.png</file> <file>data/images/grooveshark.png</file>
<file>data/images/lastfm-icon.png</file> <file>data/images/lastfm-icon.png</file>
<file>data/images/spotifycore-logo.png</file> <file>data/images/spotifycore-logo.png</file>
<file>data/images/playlist-header-tiled.png</file> <file>data/images/playlist-header-tiled.png</file>
<file>data/images/share.png</file> <file>data/images/share.svg</file>
<file>data/images/process-stop.png</file> <file>data/images/process-stop.png</file>
<file>data/icons/tomahawk-icon-128x128-grayscale.png</file> <file>data/icons/tomahawk-icon-128x128-grayscale.png</file>
<file>data/images/collection.png</file> <file>data/images/collection.png</file>
@@ -164,7 +157,7 @@
<file>data/images/green-dot.png</file> <file>data/images/green-dot.png</file>
<file>data/images/exfm.png</file> <file>data/images/exfm.png</file>
<file>data/images/soundcloud.png</file> <file>data/images/soundcloud.png</file>
<file>data/images/resolver-default.png</file> <file>data/images/resolver-default.svg</file>
<file>data/images/spotify-sourceicon.png</file> <file>data/images/spotify-sourceicon.png</file>
<file>data/images/account-offline.png</file> <file>data/images/account-offline.png</file>
<file>data/images/account-online.png</file> <file>data/images/account-online.png</file>

View File

@@ -20,12 +20,6 @@
#include "AudioControls.h" #include "AudioControls.h"
#include "ui_AudioControls.h" #include "ui_AudioControls.h"
#include "audio/AudioEngine.h"
#include "playlist/PlaylistView.h"
#include "database/Database.h"
#include "widgets/ImageButton.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
#include "Album.h" #include "Album.h"
#include "DropJob.h" #include "DropJob.h"
#include "SocialWidget.h" #include "SocialWidget.h"
@@ -33,6 +27,13 @@
#include "ViewManager.h" #include "ViewManager.h"
#include "Source.h" #include "Source.h"
#include "audio/AudioEngine.h"
#include "playlist/PlaylistView.h"
#include "database/Database.h"
#include "widgets/ImageButton.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
#include <QNetworkReply> #include <QNetworkReply>
#include <QDropEvent> #include <QDropEvent>
#include <QMouseEvent> #include <QMouseEvent>
@@ -70,8 +71,7 @@ AudioControls::AudioControls( QWidget* parent )
font.setPointSize( TomahawkUtils::defaultFontSize() - 2 ); font.setPointSize( TomahawkUtils::defaultFontSize() - 2 );
m_defaultSourceIcon = QPixmap( RESPATH "images/resolver-default.png" ); ui->ownerButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultResolver, TomahawkUtils::Original, QSize( 34, 34 ) ) );
ui->prevButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::PrevButton, TomahawkUtils::Original, QSize( 35, 35 ) ) ); ui->prevButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::PrevButton, TomahawkUtils::Original, QSize( 35, 35 ) ) );
ui->prevButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::PrevButtonPressed, TomahawkUtils::Original, QSize( 35, 35 ) ), QIcon::Off, QIcon::Active ); ui->prevButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::PrevButtonPressed, TomahawkUtils::Original, QSize( 35, 35 ) ), QIcon::Off, QIcon::Active );
ui->playPauseButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::PlayButton, TomahawkUtils::Original, QSize( 48, 48 ) ) ); ui->playPauseButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::PlayButton, TomahawkUtils::Original, QSize( 48, 48 ) ) );
@@ -80,16 +80,15 @@ AudioControls::AudioControls( QWidget* parent )
ui->pauseButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::PauseButtonPressed, TomahawkUtils::Original, QSize( 48, 48 ) ), QIcon::Off, QIcon::Active ); ui->pauseButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::PauseButtonPressed, TomahawkUtils::Original, QSize( 48, 48 ) ), QIcon::Off, QIcon::Active );
ui->nextButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::NextButton, TomahawkUtils::Original, QSize( 35, 35 ) ) ); ui->nextButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::NextButton, TomahawkUtils::Original, QSize( 35, 35 ) ) );
ui->nextButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::NextButtonPressed, TomahawkUtils::Original, QSize( 35, 35 ) ), QIcon::Off, QIcon::Active ); ui->nextButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::NextButtonPressed, TomahawkUtils::Original, QSize( 35, 35 ) ), QIcon::Off, QIcon::Active );
ui->shuffleButton->setPixmap( RESPATH "images/shuffle-off-rest.png" ); ui->shuffleButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::ShuffleOff, TomahawkUtils::Original, QSize( 34, 21 ) ) );
ui->shuffleButton->setPixmap( RESPATH "images/shuffle-off-pressed.png", QIcon::Off, QIcon::Active ); ui->shuffleButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::ShuffleOffPressed, TomahawkUtils::Original, QSize( 34, 21 ) ), QIcon::Off, QIcon::Active );
ui->repeatButton->setPixmap( RESPATH "images/repeat-off-rest.png" ); ui->repeatButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RepeatOff, TomahawkUtils::Original, QSize( 34, 21 ) ) );
ui->repeatButton->setPixmap( RESPATH "images/repeat-off-pressed.png", QIcon::Off, QIcon::Active ); ui->repeatButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RepeatOffPressed, TomahawkUtils::Original, QSize( 34, 21 ) ), QIcon::Off, QIcon::Active );
ui->volumeLowButton->setPixmap( RESPATH "images/volume-icon-muted.png" ); ui->volumeLowButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::VolumeMuted, TomahawkUtils::Original, QSize( 18, 18 ) ) );
ui->volumeHighButton->setPixmap( RESPATH "images/volume-icon-full.png" ); ui->volumeHighButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::VolumeFull, TomahawkUtils::Original, QSize( 22, 18 ) ) );
ui->socialButton->setPixmap( RESPATH "images/share.png" ); ui->socialButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::Share, TomahawkUtils::Original, QSize( 20, 20 ) ) );
ui->loveButton->setPixmap( RESPATH "images/not-loved.png" ); ui->loveButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::NotLoved, TomahawkUtils::Original, QSize( 20, 20 ) ) );
ui->loveButton->setCheckable( true ); ui->loveButton->setCheckable( true );
ui->ownerButton->setPixmap( m_defaultSourceIcon );
ui->socialButton->setFixedSize( QSize( 20, 20 ) ); ui->socialButton->setFixedSize( QSize( 20, 20 ) );
ui->loveButton->setFixedSize( QSize( 20, 20 ) ); ui->loveButton->setFixedSize( QSize( 20, 20 ) );
@@ -294,7 +293,7 @@ AudioControls::onPlaybackLoading( const Tomahawk::result_ptr& result )
else else
{ {
ui->ownerButton->clear(); ui->ownerButton->clear();
ui->ownerButton->setPixmap( m_defaultSourceIcon ); ui->ownerButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultResolver, TomahawkUtils::Original, QSize( 34, 34 ) ) );
} }
if ( QUrl( result->linkUrl() ).isValid() || !result->collection().isNull() ) if ( QUrl( result->linkUrl() ).isValid() || !result->collection().isNull() )
@@ -348,12 +347,12 @@ AudioControls::setSocialActions()
{ {
if ( m_currentTrack->toQuery()->loved() ) if ( m_currentTrack->toQuery()->loved() )
{ {
ui->loveButton->setPixmap( RESPATH "images/loved.png" ); ui->loveButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::Loved, TomahawkUtils::Original, QSize( 20, 20 ) ) );
ui->loveButton->setChecked( true ); ui->loveButton->setChecked( true );
} }
else else
{ {
ui->loveButton->setPixmap( RESPATH "images/not-loved.png" ); ui->loveButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::NotLoved, TomahawkUtils::Original, QSize( 20, 20 ) ) );
ui->loveButton->setChecked( false ); ui->loveButton->setChecked( false );
} }
} }
@@ -400,7 +399,7 @@ AudioControls::onPlaybackStopped()
m_sliderTimeLine.stop(); m_sliderTimeLine.stop();
m_sliderTimeLine.setCurrentTime( 0 ); m_sliderTimeLine.setCurrentTime( 0 );
m_phononTickCheckTimer.stop(); m_phononTickCheckTimer.stop();
ui->ownerButton->setPixmap( m_defaultSourceIcon ); ui->ownerButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultResolver, TomahawkUtils::Original, QSize( 34, 34 ) ) );
ui->stackedLayout->setCurrentWidget( ui->playPauseButton ); ui->stackedLayout->setCurrentWidget( ui->playPauseButton );
ui->loveButton->setEnabled( false ); ui->loveButton->setEnabled( false );
@@ -522,24 +521,24 @@ AudioControls::onRepeatModeChanged( PlaylistModes::RepeatMode mode )
case PlaylistModes::NoRepeat: case PlaylistModes::NoRepeat:
{ {
// switch to RepeatOne // switch to RepeatOne
ui->repeatButton->setPixmap( RESPATH "images/repeat-off-rest.png" ); ui->repeatButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RepeatOff, TomahawkUtils::Original, QSize( 34, 21 ) ) );
ui->repeatButton->setPixmap( RESPATH "images/repeat-off-pressed.png", QIcon::Off, QIcon::Active ); ui->repeatButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RepeatOffPressed, TomahawkUtils::Original, QSize( 34, 21 ) ), QIcon::Off, QIcon::Active );
} }
break; break;
case PlaylistModes::RepeatOne: case PlaylistModes::RepeatOne:
{ {
// switch to RepeatAll // switch to RepeatAll
ui->repeatButton->setPixmap( RESPATH "images/repeat-1-on-rest.png" ); ui->repeatButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RepeatOne, TomahawkUtils::Original, QSize( 34, 21 ) ) );
ui->repeatButton->setPixmap( RESPATH "images/repeat-1-on-pressed.png", QIcon::Off, QIcon::Active ); ui->repeatButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RepeatOnePressed, TomahawkUtils::Original, QSize( 34, 21 ) ), QIcon::Off, QIcon::Active );
} }
break; break;
case PlaylistModes::RepeatAll: case PlaylistModes::RepeatAll:
{ {
// switch to NoRepeat // switch to NoRepeat
ui->repeatButton->setPixmap( RESPATH "images/repeat-all-on-rest.png" ); ui->repeatButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RepeatAll, TomahawkUtils::Original, QSize( 34, 21 ) ) );
ui->repeatButton->setPixmap( RESPATH "images/repeat-all-on-pressed.png", QIcon::Off, QIcon::Active ); ui->repeatButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RepeatAllPressed, TomahawkUtils::Original, QSize( 34, 21 ) ), QIcon::Off, QIcon::Active );
} }
break; break;
@@ -590,15 +589,15 @@ AudioControls::onShuffleModeChanged( bool enabled )
if ( m_shuffled ) if ( m_shuffled )
{ {
ui->shuffleButton->setPixmap( RESPATH "images/shuffle-on-rest.png" ); ui->shuffleButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::ShuffleOn, TomahawkUtils::Original, QSize( 34, 21 ) ) );
ui->shuffleButton->setPixmap( RESPATH "images/shuffle-on-pressed.png", QIcon::Off, QIcon::Active ); ui->shuffleButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::ShuffleOnPressed, TomahawkUtils::Original, QSize( 34, 21 ) ), QIcon::Off, QIcon::Active );
ui->repeatButton->setEnabled( false ); ui->repeatButton->setEnabled( false );
} }
else else
{ {
ui->shuffleButton->setPixmap( RESPATH "images/shuffle-off-rest.png" ); ui->shuffleButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::ShuffleOff, TomahawkUtils::Original, QSize( 34, 21 ) ) );
ui->shuffleButton->setPixmap( RESPATH "images/shuffle-off-pressed.png", QIcon::Off, QIcon::Active ); ui->shuffleButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::ShuffleOffPressed, TomahawkUtils::Original, QSize( 34, 21 ) ), QIcon::Off, QIcon::Active );
ui->repeatButton->setEnabled( true ); ui->repeatButton->setEnabled( true );
} }
@@ -701,13 +700,13 @@ AudioControls::onLoveButtonClicked( bool checked )
{ {
if ( checked ) if ( checked )
{ {
ui->loveButton->setPixmap( RESPATH "images/loved.png" ); ui->loveButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::Loved, TomahawkUtils::Original, QSize( 20, 20 ) ) );
m_currentTrack->toQuery()->setLoved( true ); m_currentTrack->toQuery()->setLoved( true );
} }
else else
{ {
ui->loveButton->setPixmap( RESPATH "images/not-loved.png" ); ui->loveButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::NotLoved, TomahawkUtils::Original, QSize( 20, 20 ) ) );
m_currentTrack->toQuery()->setLoved( false ); m_currentTrack->toQuery()->setLoved( false );
} }

View File

@@ -101,8 +101,6 @@ private:
Tomahawk::PlaylistModes::RepeatMode m_repeatMode; Tomahawk::PlaylistModes::RepeatMode m_repeatMode;
bool m_shuffled; bool m_shuffled;
QPixmap m_defaultSourceIcon;
QTimer m_phononTickCheckTimer; QTimer m_phononTickCheckTimer;
QTimeLine m_sliderTimeLine; QTimeLine m_sliderTimeLine;
bool m_seeked; bool m_seeked;

View File

@@ -315,7 +315,7 @@ void
TomahawkTrayIcon::onSocialActionsLoaded() TomahawkTrayIcon::onSocialActionsLoaded()
{ {
m_loveTrackAction->setText( tr( "&Love" ) ); m_loveTrackAction->setText( tr( "&Love" ) );
m_loveTrackAction->setIcon( QIcon( RESPATH "images/loved.png" ) ); m_loveTrackAction->setIcon( QIcon( RESPATH "images/loved.svg" ) );
if ( !m_currentTrack ) if ( !m_currentTrack )
return; return;
@@ -323,7 +323,7 @@ TomahawkTrayIcon::onSocialActionsLoaded()
if ( m_currentTrack->toQuery()->loved() ) if ( m_currentTrack->toQuery()->loved() )
{ {
m_loveTrackAction->setText( tr( "Un-&Love" ) ); m_loveTrackAction->setText( tr( "Un-&Love" ) );
m_loveTrackAction->setIcon( QIcon( RESPATH "images/not-loved.png" ) ); m_loveTrackAction->setIcon( QIcon( RESPATH "images/not-loved.svg" ) );
} }
} }

View File

@@ -22,47 +22,6 @@
#include "TomahawkWindow.h" #include "TomahawkWindow.h"
#include "ui_TomahawkWindow.h" #include "ui_TomahawkWindow.h"
#include "accounts/AccountManager.h"
#include "sourcetree/SourceTreeView.h"
#include "network/Servent.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/ProxyStyle.h"
#include "utils/WidgetDragFilter.h"
#include "widgets/AccountsToolButton.h"
#include "widgets/AnimatedSplitter.h"
#include "widgets/NewPlaylistWidget.h"
#include "widgets/SearchWidget.h"
#include "widgets/PlaylistTypeSelectorDialog.h"
#include "thirdparty/Qocoa/qsearchfield.h"
#include "playlist/dynamic/GeneratorInterface.h"
#include "playlist/PlaylistModel.h"
#include "playlist/PlaylistView.h"
#include "playlist/QueueView.h"
#include "jobview/JobStatusView.h"
#include "jobview/JobStatusModel.h"
#include "jobview/ErrorStatusMessage.h"
#include "jobview/JobStatusModel.h"
#include "sip/SipPlugin.h"
#include "Playlist.h"
#include "Query.h"
#include "Artist.h"
#include "ViewManager.h"
#include "ActionCollection.h"
#include "AudioControls.h"
#include "SettingsDialog.h"
#include "DiagnosticsDialog.h"
#include "TomahawkSettings.h"
#include "SourceList.h"
#include "TomahawkTrayIcon.h"
#include "libtomahawk/filemetadata/ScanManager.h"
#include "TomahawkApp.h"
#include "LoadXSPFDialog.h"
#include "widgets/ContainedMenuButton.h"
#include "utils/Logger.h"
#include "config.h"
#include <QAction> #include <QAction>
#include <QCloseEvent> #include <QCloseEvent>
#include <QDesktopServices> #include <QDesktopServices>
@@ -79,6 +38,48 @@
#include <QToolBar> #include <QToolBar>
#include <QToolButton> #include <QToolButton>
#include "accounts/AccountManager.h"
#include "sourcetree/SourceTreeView.h"
#include "network/Servent.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/ProxyStyle.h"
#include "utils/WidgetDragFilter.h"
#include "widgets/AccountsToolButton.h"
#include "widgets/AnimatedSplitter.h"
#include "widgets/NewPlaylistWidget.h"
#include "widgets/SearchWidget.h"
#include "widgets/PlaylistTypeSelectorDialog.h"
#include "widgets/ContainedMenuButton.h"
#include "thirdparty/Qocoa/qsearchfield.h"
#include "playlist/dynamic/GeneratorInterface.h"
#include "playlist/PlaylistModel.h"
#include "playlist/PlaylistView.h"
#include "playlist/QueueView.h"
#include "jobview/JobStatusView.h"
#include "jobview/JobStatusModel.h"
#include "jobview/ErrorStatusMessage.h"
#include "jobview/JobStatusModel.h"
#include "sip/SipPlugin.h"
#include "filemetadata/ScanManager.h"
#include "Playlist.h"
#include "Query.h"
#include "Artist.h"
#include "ViewManager.h"
#include "ActionCollection.h"
#include "AudioControls.h"
#include "SettingsDialog.h"
#include "DiagnosticsDialog.h"
#include "TomahawkSettings.h"
#include "SourceList.h"
#include "TomahawkTrayIcon.h"
#include "TomahawkApp.h"
#include "LoadXSPFDialog.h"
#include "utils/ImageRegistry.h"
#include "utils/Logger.h"
#include "config.h"
#if defined( Q_WS_WIN ) #if defined( Q_WS_WIN )
#if defined ( WITH_QtSparkle ) #if defined ( WITH_QtSparkle )
#include <qtsparkle/Updater> #include <qtsparkle/Updater>
@@ -262,9 +263,9 @@ TomahawkWindow::setupToolBar()
m_toolbar->installEventFilter( new WidgetDragFilter( m_toolbar ) ); m_toolbar->installEventFilter( new WidgetDragFilter( m_toolbar ) );
#endif #endif
m_backAction = m_toolbar->addAction( QIcon( RESPATH "images/back.png" ), tr( "Back" ), ViewManager::instance(), SLOT( historyBack() ) ); m_backAction = m_toolbar->addAction( ImageRegistry::instance()->icon( RESPATH "images/back.svg" ), tr( "Back" ), ViewManager::instance(), SLOT( historyBack() ) );
m_backAction->setToolTip( tr( "Go back one page" ) ); m_backAction->setToolTip( tr( "Go back one page" ) );
m_forwardAction = m_toolbar->addAction( QIcon( RESPATH "images/forward.png" ), tr( "Forward" ), ViewManager::instance(), SLOT( historyForward() ) ); m_forwardAction = m_toolbar->addAction( ImageRegistry::instance()->icon( RESPATH "images/forward.svg" ), tr( "Forward" ), ViewManager::instance(), SLOT( historyForward() ) );
m_forwardAction->setToolTip( tr( "Go forward one page" ) ); m_forwardAction->setToolTip( tr( "Go forward one page" ) );
m_toolbarLeftBalancer = new QWidget( this ); m_toolbarLeftBalancer = new QWidget( this );
@@ -300,7 +301,7 @@ TomahawkWindow::setupToolBar()
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
ContainedMenuButton* compactMenuButton = new ContainedMenuButton( m_toolbar ); ContainedMenuButton* compactMenuButton = new ContainedMenuButton( m_toolbar );
compactMenuButton->setIcon( QIcon( RESPATH "images/configure.png" ) ); compactMenuButton->setIcon( ImageRegistry::instance()->icon( RESPATH "images/configure.svg" ) );
compactMenuButton->setText( tr( "&Main Menu" ) ); compactMenuButton->setText( tr( "&Main Menu" ) );
compactMenuButton->setMenu( m_compactMainMenu ); compactMenuButton->setMenu( m_compactMainMenu );
compactMenuButton->setToolButtonStyle( Qt::ToolButtonIconOnly ); compactMenuButton->setToolButtonStyle( Qt::ToolButtonIconOnly );
@@ -1121,7 +1122,7 @@ TomahawkWindow::audioStarted()
{ {
m_audioRetryCounter = 0; m_audioRetryCounter = 0;
ActionCollection::instance()->getAction( "playPause" )->setIcon( QIcon( RESPATH "images/pause-rest.png" ) ); ActionCollection::instance()->getAction( "playPause" )->setIcon( ImageRegistry::instance()->icon( RESPATH "images/pause-rest.svg" ) );
ActionCollection::instance()->getAction( "playPause" )->setText( tr( "Pause" ) ); ActionCollection::instance()->getAction( "playPause" )->setText( tr( "Pause" ) );
ActionCollection::instance()->getAction( "stop" )->setEnabled( true ); ActionCollection::instance()->getAction( "stop" )->setEnabled( true );
@@ -1143,7 +1144,7 @@ TomahawkWindow::audioFinished()
void void
TomahawkWindow::audioPaused() TomahawkWindow::audioPaused()
{ {
ActionCollection::instance()->getAction( "playPause" )->setIcon( QIcon( RESPATH "images/play-rest.png" ) ); ActionCollection::instance()->getAction( "playPause" )->setIcon( ImageRegistry::instance()->icon( RESPATH "images/play-rest.svg" ) );
ActionCollection::instance()->getAction( "playPause" )->setText( tr( "&Play" ) ); ActionCollection::instance()->getAction( "playPause" )->setText( tr( "&Play" ) );
} }

View File

@@ -20,11 +20,13 @@
*/ */
#include "ActionCollection.h" #include "ActionCollection.h"
#include "TomahawkSettings.h" #include "TomahawkSettings.h"
#include "Source.h"
#include "audio/AudioEngine.h" #include "audio/AudioEngine.h"
#include "utils/ImageRegistry.h"
#include "utils/TomahawkUtils.h" #include "utils/TomahawkUtils.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "Source.h"
#include <QCoreApplication> #include <QCoreApplication>
@@ -76,14 +78,14 @@ ActionCollection::initActions()
m_actionCollection[ "renamePlaylist" ] = new QAction( tr( "&Rename Playlist" ), this ); m_actionCollection[ "renamePlaylist" ] = new QAction( tr( "&Rename Playlist" ), this );
m_actionCollection[ "copyPlaylist" ] = new QAction( tr( "&Copy Playlist Link" ), this ); m_actionCollection[ "copyPlaylist" ] = new QAction( tr( "&Copy Playlist Link" ), this );
m_actionCollection[ "playPause" ] = new QAction( tr( "&Play" ), this ); m_actionCollection[ "playPause" ] = new QAction( tr( "&Play" ), this );
m_actionCollection[ "playPause" ]->setIcon( QIcon( RESPATH "images/play-rest.png" ) ); m_actionCollection[ "playPause" ]->setIcon( ImageRegistry::instance()->icon( RESPATH "images/play-rest.svg" ) );
m_actionCollection[ "playPause" ]->setShortcut( Qt::Key_Space ); m_actionCollection[ "playPause" ]->setShortcut( Qt::Key_Space );
m_actionCollection[ "playPause" ]->setShortcutContext( Qt::ApplicationShortcut ); m_actionCollection[ "playPause" ]->setShortcutContext( Qt::ApplicationShortcut );
m_actionCollection[ "stop" ] = new QAction( tr( "&Stop" ), this ); m_actionCollection[ "stop" ] = new QAction( tr( "&Stop" ), this );
m_actionCollection[ "previousTrack" ] = new QAction( tr( "&Previous Track" ), this ); m_actionCollection[ "previousTrack" ] = new QAction( tr( "&Previous Track" ), this );
m_actionCollection[ "previousTrack" ]->setIcon( QIcon( RESPATH "images/back-rest.png" ) ); m_actionCollection[ "previousTrack" ]->setIcon( ImageRegistry::instance()->icon( RESPATH "images/back-rest.svg" ) );
m_actionCollection[ "nextTrack" ] = new QAction( tr( "&Next Track" ), this ); m_actionCollection[ "nextTrack" ] = new QAction( tr( "&Next Track" ), this );
m_actionCollection[ "nextTrack" ]->setIcon( QIcon( RESPATH "images/skip-rest.png" ) ); m_actionCollection[ "nextTrack" ]->setIcon( ImageRegistry::instance()->icon( RESPATH "images/skip-rest.svg" ) );
m_actionCollection[ "quit" ] = new QAction( tr( "&Quit" ), this ); m_actionCollection[ "quit" ] = new QAction( tr( "&Quit" ), this );
m_actionCollection[ "quit" ]->setShortcut( QKeySequence::Quit ); m_actionCollection[ "quit" ]->setShortcut( QKeySequence::Quit );
m_actionCollection[ "quit" ]->setShortcutContext( Qt::ApplicationShortcut ); m_actionCollection[ "quit" ]->setShortcutContext( Qt::ApplicationShortcut );
@@ -103,7 +105,7 @@ ActionCollection::initActions()
m_actionCollection[ "showOfflineSources" ] = new QAction( tr( "Show Offline Sources" ), this ); m_actionCollection[ "showOfflineSources" ] = new QAction( tr( "Show Offline Sources" ), this );
m_actionCollection[ "showOfflineSources" ]->setCheckable( true ); m_actionCollection[ "showOfflineSources" ]->setCheckable( true );
m_actionCollection[ "preferences" ] = new QAction( tr( "&Configure Tomahawk..." ), this ); m_actionCollection[ "preferences" ] = new QAction( tr( "&Configure Tomahawk..." ), this );
m_actionCollection[ "preferences" ]->setIcon( QIcon( RESPATH "images/configure.png" ) ); m_actionCollection[ "preferences" ]->setIcon( ImageRegistry::instance()->icon( RESPATH "images/configure.svg" ) );
m_actionCollection[ "preferences" ]->setMenuRole( QAction::PreferencesRole ); m_actionCollection[ "preferences" ]->setMenuRole( QAction::PreferencesRole );
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
m_actionCollection[ "minimize" ] = new QAction( tr( "Minimize" ), this ); m_actionCollection[ "minimize" ] = new QAction( tr( "Minimize" ), this );
@@ -118,7 +120,7 @@ ActionCollection::initActions()
m_actionCollection[ "diagnostics" ] = new QAction( tr( "Diagnostics..." ), this ); m_actionCollection[ "diagnostics" ] = new QAction( tr( "Diagnostics..." ), this );
m_actionCollection[ "diagnostics" ]->setMenuRole( QAction::ApplicationSpecificRole ); m_actionCollection[ "diagnostics" ]->setMenuRole( QAction::ApplicationSpecificRole );
m_actionCollection[ "aboutTomahawk" ] = new QAction( tr( "About &Tomahawk..." ), this ); m_actionCollection[ "aboutTomahawk" ] = new QAction( tr( "About &Tomahawk..." ), this );
m_actionCollection[ "aboutTomahawk" ]->setIcon( QIcon( RESPATH "images/info.png" ) ); m_actionCollection[ "aboutTomahawk" ]->setIcon( ImageRegistry::instance()->icon( RESPATH "images/info.svg" ) );
m_actionCollection[ "aboutTomahawk" ]->setMenuRole( QAction::AboutRole ); m_actionCollection[ "aboutTomahawk" ]->setMenuRole( QAction::AboutRole );
m_actionCollection[ "legalInfo" ] = new QAction( tr( "&Legal Information..." ), this ); m_actionCollection[ "legalInfo" ] = new QAction( tr( "&Legal Information..." ), this );
m_actionCollection[ "legalInfo" ]->setMenuRole( QAction::ApplicationSpecificRole ); m_actionCollection[ "legalInfo" ]->setMenuRole( QAction::ApplicationSpecificRole );

View File

@@ -18,8 +18,10 @@
#include "ContextMenu.h" #include "ContextMenu.h"
#include "GlobalActionManager.h" #include "audio/AudioEngine.h"
#include "playlist/PlaylistView.h" #include "playlist/PlaylistView.h"
#include "filemetadata/MetadataEditor.h"
#include "GlobalActionManager.h"
#include "ViewManager.h" #include "ViewManager.h"
#include "Query.h" #include "Query.h"
#include "Result.h" #include "Result.h"
@@ -28,9 +30,8 @@
#include "Artist.h" #include "Artist.h"
#include "Album.h" #include "Album.h"
#include "utils/ImageRegistry.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "audio/AudioEngine.h"
#include "filemetadata/MetadataEditor.h"
using namespace Tomahawk; using namespace Tomahawk;
@@ -365,12 +366,12 @@ ContextMenu::onSocialActionsLoaded()
if ( m_loveAction && m_queries.first()->loved() ) if ( m_loveAction && m_queries.first()->loved() )
{ {
m_loveAction->setText( tr( "Un-&Love" ) ); m_loveAction->setText( tr( "Un-&Love" ) );
m_loveAction->setIcon( QIcon( RESPATH "images/not-loved.png" ) ); m_loveAction->setIcon( ImageRegistry::instance()->icon( RESPATH "images/not-loved.svg" ) );
} }
else if ( m_loveAction ) else if ( m_loveAction )
{ {
m_loveAction->setText( tr( "&Love" ) ); m_loveAction->setText( tr( "&Love" ) );
m_loveAction->setIcon( QIcon( RESPATH "images/loved.png" ) ); m_loveAction->setIcon( ImageRegistry::instance()->icon( RESPATH "images/loved.svg" ) );
} }
} }

View File

@@ -26,7 +26,7 @@
#include "accounts/Account.h" #include "accounts/Account.h"
#include "accounts/AccountManager.h" #include "accounts/AccountManager.h"
#include "utils/TomahawkUtils.h" #include "utils/ImageRegistry.h"
#include "utils/TomahawkUtilsGui.h" #include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/AnimatedSpinner.h" #include "utils/AnimatedSpinner.h"
@@ -637,7 +637,7 @@ AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItemV4& o
// draw it the same size as the check belox // draw it the same size as the check belox
topt.font = opt.font; topt.font = opt.font;
topt.icon = QIcon( RESPATH "images/configure.png" ); topt.icon = ImageRegistry::instance()->icon( RESPATH "images/configure.svg" );
topt.iconSize = QSize( 14, 14 ); topt.iconSize = QSize( 14, 14 );
topt.subControls = QStyle::SC_ToolButton; topt.subControls = QStyle::SC_ToolButton;
topt.activeSubControls = QStyle::SC_None; topt.activeSubControls = QStyle::SC_None;

View File

@@ -17,10 +17,12 @@
*/ */
#include "AccountFactoryWrapperDelegate.h" #include "AccountFactoryWrapperDelegate.h"
#include "accounts/Account.h"
#include "AccountFactoryWrapper.h" #include "AccountFactoryWrapper.h"
#include "utils/TomahawkUtils.h"
#include "Source.h" #include "Source.h"
#include "accounts/Account.h"
#include "utils/ImageRegistry.h"
#include "utils/TomahawkUtils.h"
#include <QApplication> #include <QApplication>
#include <QPainter> #include <QPainter>
@@ -43,7 +45,7 @@ AccountFactoryWrapperDelegate::AccountFactoryWrapperDelegate( QObject* parent )
m_onlineIcon = m_onlineIcon.scaled( ICON_SIZE, ICON_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation ); m_onlineIcon = m_onlineIcon.scaled( ICON_SIZE, ICON_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_offlineIcon = m_offlineIcon.scaled( ICON_SIZE, ICON_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation ); m_offlineIcon = m_offlineIcon.scaled( ICON_SIZE, ICON_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_configIcon.addFile( RESPATH "images/configure.png", QSize( CONFIG_WRENCH_SIZE - 8, CONFIG_WRENCH_SIZE - 8 ) ); m_configIcon = ImageRegistry::instance()->pixmap( RESPATH "images/configure.svg", QSize( CONFIG_WRENCH_SIZE - 8, CONFIG_WRENCH_SIZE - 8 ) );
} }
void void

View File

@@ -35,7 +35,7 @@
#include "network/Servent.h" #include "network/Servent.h"
#include "utils/TomahawkUtils.h" #include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h" #include "utils/Logger.h"
// FIXME: bloody hack, remove this for 0.3 // FIXME: bloody hack, remove this for 0.3
@@ -231,8 +231,7 @@ QtScriptResolver::QtScriptResolver( const QString& scriptPath )
m_name = QFileInfo( filePath() ).baseName(); m_name = QFileInfo( filePath() ).baseName();
// set the icon, if we launch properly we'll get the icon the resolver reports // set the icon, if we launch properly we'll get the icon the resolver reports
m_icon.load( RESPATH "images/resolver-default.png" ); m_icon = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultResolver, TomahawkUtils::Original, QSize( 128, 128 ) );
if ( !QFile::exists( filePath() ) ) if ( !QFile::exists( filePath() ) )
{ {

View File

@@ -28,7 +28,7 @@
#include "Pipeline.h" #include "Pipeline.h"
#include "SourceList.h" #include "SourceList.h"
#include "utils/TomahawkUtils.h" #include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
@@ -59,7 +59,7 @@ ScriptResolver::ScriptResolver( const QString& exe )
m_name = QFileInfo( filePath() ).baseName(); m_name = QFileInfo( filePath() ).baseName();
// set the icon, if we launch properly we'll get the icon the resolver reports // set the icon, if we launch properly we'll get the icon the resolver reports
m_icon.load( RESPATH "images/resolver-default.png" ); m_icon = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultResolver, TomahawkUtils::Original, QSize( 128, 128 ) );
} }

View File

@@ -48,6 +48,7 @@ namespace TomahawkUtils
DefaultArtistImage, DefaultArtistImage,
DefaultTrackImage, DefaultTrackImage,
DefaultSourceAvatar, DefaultSourceAvatar,
DefaultResolver,
NowPlayingSpeaker, NowPlayingSpeaker,
NowPlayingSpeakerDark, NowPlayingSpeakerDark,
InfoIcon, InfoIcon,
@@ -58,7 +59,23 @@ namespace TomahawkUtils
PrevButton, PrevButton,
PrevButtonPressed, PrevButtonPressed,
NextButton, NextButton,
NextButtonPressed NextButtonPressed,
ShuffleOff,
ShuffleOffPressed,
ShuffleOn,
ShuffleOnPressed,
RepeatOne,
RepeatOnePressed,
RepeatAll,
RepeatAllPressed,
RepeatOff,
RepeatOffPressed,
VolumeMuted,
VolumeFull,
Share,
NotLoved,
Loved,
Configure
}; };
enum ImageMode enum ImageMode