[amarok] /: Add option to toggle showing of browser background images
Bart Cerneels
bart.cerneels at kde.org
Sun Nov 6 08:22:54 UTC 2011
Micro option! And as far as I can tell because only one user
complained on the forums. Unless Rick has a personal preference.
Still, we need to be very hesitant to add micro options.
The arguments for having the backgrounds:
- Reduces the "field of grey" effect when the browsers are empty.
- General prettyness
- Recognition of browser without reading
Any reasons to have the option to remove them besides: one user wants it?
Bart
On Sun, Nov 6, 2011 at 05:18, Rick W. Chen <stuffcorpse at archlinux.us> wrote:
> Git commit 07ca7cc2ea3d792bd7f4b63e8eac68bbd5358f46 by Rick W. Chen.
> Committed on 05/11/2011 at 14:03.
> Pushed by rickc into branch 'master'.
>
> Add option to toggle showing of browser background images
>
> M +1 -0 ChangeLog
> M +4 -0 src/amarokconfig.kcfg
> M +8 -0 src/browsers/BrowserCategory.cpp
> M +3 -0 src/browsers/BrowserCategory.h
> M +3 -2 src/browsers/collectionbrowser/CollectionWidget.cpp
> M +3 -2 src/browsers/filebrowser/FileBrowser.cpp
> M +2 -2 src/browsers/playlistbrowser/APGCategory.cpp
> M +3 -2 src/browsers/playlistbrowser/DynamicCategory.cpp
> M +4 -2 src/browsers/playlistbrowser/PlaylistBrowserCategory.cpp
> M +3 -2 src/browsers/playlistbrowser/PodcastCategory.cpp
> M +11 -4 src/configdialog/dialogs/GeneralConfig.ui
>
> http://commits.kde.org/amarok/07ca7cc2ea3d792bd7f4b63e8eac68bbd5358f46
>
> diff --git a/ChangeLog b/ChangeLog
> index b602581..fdb05a4 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -26,6 +26,7 @@ Version 2.5.0-Beta 1
> * Auto-save the playlist so that it is not lost if Amarok crashes.
>
> CHANGES:
> + * Browser widget backgrounds can now be enabled/disabled.
> * Playlist: Don't group albums without name. (BR 243344)
> * Make delete confirmation dialog text less confusing. Patch by Gilles Habran.
> (BR 263693)
> diff --git a/src/amarokconfig.kcfg b/src/amarokconfig.kcfg
> index 1172e79..5610c4a 100644
> --- a/src/amarokconfig.kcfg
> +++ b/src/amarokconfig.kcfg
> @@ -107,6 +107,10 @@
> <label>Whether to automatically attempt to fetch cover art as needed</label>
> <default>false</default>
> </entry>
> + <entry key="ShowBrowserBackgroundImage" type="Bool">
> + <label>Whether to show background images in the browser pane</label>
> + <default>true</default>
> + </entry>
> <entry key="AutoScrollPlaylist" type="Bool">
> <label>Automatically scroll the playlist to make the currently playing song visible</label>
> <default>true</default>
> diff --git a/src/browsers/BrowserCategory.cpp b/src/browsers/BrowserCategory.cpp
> index e0ce09e..34da991 100644
> --- a/src/browsers/BrowserCategory.cpp
> +++ b/src/browsers/BrowserCategory.cpp
> @@ -16,6 +16,8 @@
>
> #include "BrowserCategory.h"
>
> +#include "App.h"
> +#include "amarokconfig.h"
> #include "BrowserBreadcrumbItem.h"
> #include "BrowserCategoryList.h"
>
> @@ -32,6 +34,7 @@ BrowserCategory::BrowserCategory( const QString &name, QWidget *parent )
> setObjectName( name );
> setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
> setFrameShape( QFrame::NoFrame );
> + connect( App::instance(), SIGNAL(settingsChanged()), SLOT(slotSettingsChanged()) );
> }
>
> BrowserCategory::~BrowserCategory()
> @@ -111,6 +114,11 @@ BrowserCategory::setBackgroundImage(const QString& path)
> );
> }
>
> +void BrowserCategory::slotSettingsChanged()
> +{
> + setBackgroundImage( AmarokConfig::showBrowserBackgroundImage() ? m_imagePath : QString() );
> +}
> +
> void BrowserCategory::setParentList( BrowserCategoryList * parent )
> {
> m_parentList = parent;
> diff --git a/src/browsers/BrowserCategory.h b/src/browsers/BrowserCategory.h
> index e753b1d..85cba7c 100644
> --- a/src/browsers/BrowserCategory.h
> +++ b/src/browsers/BrowserCategory.h
> @@ -157,6 +157,9 @@ public slots:
> //Called if this category itself is re-clicked in the breadcrumb
> virtual void reActivate() {}
>
> +private slots:
> + void slotSettingsChanged();
> +
> private:
> QString m_name;
> QString m_prettyName;
> diff --git a/src/browsers/collectionbrowser/CollectionWidget.cpp b/src/browsers/collectionbrowser/CollectionWidget.cpp
> index d5d86c2..ac1c26d 100644
> --- a/src/browsers/collectionbrowser/CollectionWidget.cpp
> +++ b/src/browsers/collectionbrowser/CollectionWidget.cpp
> @@ -22,6 +22,7 @@
>
> #include "CollectionWidget.h"
>
> +#include "amarokconfig.h"
> #include "CollectionTreeItemModel.h"
> #include "CollectionTreeItemModelBase.h"
> #include "CollectionTreeItemDelegate.h"
> @@ -146,8 +147,8 @@ CollectionWidget::CollectionWidget( const QString &name , QWidget *parent )
> setImagePath( KStandardDirs::locate( "data", "amarok/images/hover_info_collections.png" ) );
>
> // set background
> - const QString bgImage = KStandardDirs::locate("data", "amarok/images/hover_info_collections.png");
> - setBackgroundImage( bgImage );
> + if( AmarokConfig::showBrowserBackgroundImage() )
> + setBackgroundImage( imagePath() );
>
> // --- the box for the UI elements.
> KHBox *hbox = new KHBox( this );
> diff --git a/src/browsers/filebrowser/FileBrowser.cpp b/src/browsers/filebrowser/FileBrowser.cpp
> index 1364832..567ff79 100644
> --- a/src/browsers/filebrowser/FileBrowser.cpp
> +++ b/src/browsers/filebrowser/FileBrowser.cpp
> @@ -22,6 +22,7 @@
> #include "FileBrowser_p.h"
> #include "FileBrowser_p.moc"
>
> +#include "amarokconfig.h"
> #include "core/support/Debug.h"
> #include "BrowserBreadcrumbItem.h"
> #include "BrowserCategoryList.h"
> @@ -178,8 +179,8 @@ FileBrowser::FileBrowser( const char *name, QWidget *parent )
> setImagePath( KStandardDirs::locate( "data", "amarok/images/hover_info_files.png" ) );
>
> // set background
> - const QString bgImage = KStandardDirs::locate("data", "amarok/images/hover_info_files.png");
> - setBackgroundImage( bgImage );
> + if( AmarokConfig::showBrowserBackgroundImage() )
> + setBackgroundImage( imagePath() );
>
> QTimer::singleShot( 0, this, SLOT(initView()) );
> }
> diff --git a/src/browsers/playlistbrowser/APGCategory.cpp b/src/browsers/playlistbrowser/APGCategory.cpp
> index 6e475d7..765dc26 100644
> --- a/src/browsers/playlistbrowser/APGCategory.cpp
> +++ b/src/browsers/playlistbrowser/APGCategory.cpp
> @@ -41,8 +41,8 @@ PlaylistBrowserNS::APGCategory::APGCategory( QWidget* )
> setIcon( KIcon( "playlist-generator" ) );
>
> // set background
> - const QString bgImage = KStandardDirs::locate("data", "amarok/images/hover_info_dynamic_playlists.png");
> - setBackgroundImage( bgImage );
> + if( AmarokConfig::showBrowserBackgroundImage() )
> + setBackgroundImage( imagePath() );
>
> setLongDescription( i18n("Create playlists by specifying criteria") );
>
> diff --git a/src/browsers/playlistbrowser/DynamicCategory.cpp b/src/browsers/playlistbrowser/DynamicCategory.cpp
> index b2e22d6..0e1a4af 100644
> --- a/src/browsers/playlistbrowser/DynamicCategory.cpp
> +++ b/src/browsers/playlistbrowser/DynamicCategory.cpp
> @@ -20,6 +20,7 @@
> #include "DynamicCategory.h"
> #include "DynamicView.h"
>
> +#include "amarokconfig.h"
> #include "DynamicBiasWidgets.h"
> #include "amarokconfig.h"
> #include "core/support/Amarok.h"
> @@ -58,8 +59,8 @@ PlaylistBrowserNS::DynamicCategory::DynamicCategory( QWidget* parent )
> setImagePath( KStandardDirs::locate( "data", "amarok/images/hover_info_dynamic_playlists.png" ) );
>
> // set background
> - const QString bgImage = KStandardDirs::locate("data", "amarok/images/hover_info_dynamic_playlists.png");
> - setBackgroundImage( bgImage );
> + if( AmarokConfig::showBrowserBackgroundImage() )
> + setBackgroundImage( imagePath() );
>
> bool enabled = AmarokConfig::dynamicMode();
>
> diff --git a/src/browsers/playlistbrowser/PlaylistBrowserCategory.cpp b/src/browsers/playlistbrowser/PlaylistBrowserCategory.cpp
> index ab34d9b..0c2f9c1 100644
> --- a/src/browsers/playlistbrowser/PlaylistBrowserCategory.cpp
> +++ b/src/browsers/playlistbrowser/PlaylistBrowserCategory.cpp
> @@ -18,6 +18,7 @@
>
> #include "PlaylistBrowserCategory.h"
>
> +#include "amarokconfig.h"
> #include "core/support/Debug.h"
> #include "PaletteHandler.h"
> #include "PlaylistBrowserModel.h"
> @@ -55,10 +56,11 @@ PlaylistBrowserCategory::PlaylistBrowserCategory( int playlistCategory,
> m_playlistCategory( playlistCategory )
> {
> setContentsMargins( 0, 0, 0, 0 );
> + setImagePath( KStandardDirs::locate( "data", "amarok/images/hover_info_podcasts.png" ) );
>
> // set background
> - const QString bgImage = KStandardDirs::locate("data", "amarok/images/hover_info_user_playlists.png");
> - setBackgroundImage( bgImage );
> + if( AmarokConfig::showBrowserBackgroundImage() )
> + setBackgroundImage( imagePath() );
>
> m_toolBar = new KToolBar( this, false, false );
> m_toolBar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
> diff --git a/src/browsers/playlistbrowser/PodcastCategory.cpp b/src/browsers/playlistbrowser/PodcastCategory.cpp
> index a19c3c5..1c353dc 100644
> --- a/src/browsers/playlistbrowser/PodcastCategory.cpp
> +++ b/src/browsers/playlistbrowser/PodcastCategory.cpp
> @@ -20,6 +20,7 @@
>
> #include "PodcastCategory.h"
>
> +#include "amarokconfig.h"
> #include "amarokurls/AmarokUrl.h"
> #include "App.h"
> #include "browsers/InfoProxy.h"
> @@ -88,8 +89,8 @@ PodcastCategory::PodcastCategory( QWidget *parent )
> setImagePath( KStandardDirs::locate( "data", "amarok/images/hover_info_podcasts.png" ) );
>
> // set background
> - const QString bgImage = KStandardDirs::locate("data", "amarok/images/hover_info_podcasts.png");
> - setBackgroundImage( bgImage );
> + if( AmarokConfig::showBrowserBackgroundImage() )
> + setBackgroundImage( imagePath() );
>
> QAction *addPodcastAction = new QAction( KIcon( "list-add-amarok" ), i18n("&Add Podcast"),
> m_toolBar );
> diff --git a/src/configdialog/dialogs/GeneralConfig.ui b/src/configdialog/dialogs/GeneralConfig.ui
> index 14b2d63..b083c33 100644
> --- a/src/configdialog/dialogs/GeneralConfig.ui
> +++ b/src/configdialog/dialogs/GeneralConfig.ui
> @@ -64,17 +64,24 @@
> </item>
> <item row="3" column="0">
> <widget class="QCheckBox" name="kcfg_AnimateAppletCollapse">
> - <property name="toolTip">
> + <property name="toolTip">
> <string>Check to enable animations when context applets collapse.</string>
> - </property>
> - <property name="whatsThis">
> + </property>
> + <property name="whatsThis">
> <string>Check to enable animations when context applets collapse.</string>
> - </property>
> + </property>
> <property name="text">
> <string>Enable context applets collapse animations</string>
> </property>
> </widget>
> </item>
> + <item row="4" column="0">
> + <widget class="QCheckBox" name="kcfg_ShowBrowserBackgroundImage">
> + <property name="text">
> + <string>Show background images in the browser panel</string>
> + </property>
> + </widget>
> + </item>
> </layout>
> </widget>
> </item>
>
>
More information about the Amarok-devel
mailing list