[vlc-commits] commit: Qt: Allow disabling or resampling background art. ( Francois Cartegnie )
git at videolan.org
git at videolan.org
Sun Nov 28 13:43:33 CET 2010
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Nov 28 13:42:19 2010 +0100| [eab76644005cdb1a8c4f18ac4263cdab0c405a09] | committer: Francois Cartegnie
Qt: Allow disabling or resampling background art.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eab76644005cdb1a8c4f18ac4263cdab0c405a09
---
modules/gui/qt4/components/interface_widgets.cpp | 9 ++++++++-
modules/gui/qt4/components/interface_widgets.hpp | 2 ++
modules/gui/qt4/main_interface.cpp | 5 +++++
modules/gui/qt4/qt4.cpp | 10 ++++++++++
4 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 8abfb21..084a89c 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -188,7 +188,7 @@ void VideoWidget::release( void )
**********************************************************************/
BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
- :QWidget( NULL ), p_intf( _p_i ), b_expandPixmap( false )
+ :QWidget( NULL ), p_intf( _p_i ), b_expandPixmap( false ), b_withart( true )
{
/* A dark background */
setAutoFillBackground( true );
@@ -222,6 +222,13 @@ void BackgroundWidget::updateArt( const QString& url )
void BackgroundWidget::paintEvent( QPaintEvent *e )
{
+ if ( !b_withart )
+ {
+ /* we just want background autofill */
+ QWidget::paintEvent( e );
+ return;
+ }
+
int i_maxwidth, i_maxheight;
QPixmap pixmap = QPixmap( pixmapUrl );
QPainter painter(this);
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index c684f44..dc895ec 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -87,9 +87,11 @@ class BackgroundWidget : public QWidget
public:
BackgroundWidget( intf_thread_t * );
void setExpandstoHeight( bool b_expand ) { b_expandPixmap = b_expand; }
+ void setWithArt( bool b_withart_ ) { b_withart = b_withart_; };
private:
QString pixmapUrl;
bool b_expandPixmap;
+ bool b_withart;
virtual void contextMenuEvent( QContextMenuEvent *event );
intf_thread_t *p_intf;
protected:
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index b7c7147..88bf4d4 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -373,6 +373,11 @@ void MainInterface::createMainWidget( QSettings *settings )
/* Bg Cone */
bgWidget = new BackgroundWidget( p_intf );
stackCentralW->addWidget( bgWidget );
+ if ( !var_InheritBool( p_intf, "qt-bgcone" ) )
+ bgWidget->setWithArt( false );
+ else
+ if ( var_InheritBool( p_intf, "qt-bgcone-expands" ) )
+ bgWidget->setExpandstoHeight( true );
/* And video Outputs */
if( b_videoEmbedded )
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 7a82b6f..6f1ada6 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -165,6 +165,12 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
#define QT_MINIMAL_MODE_TEXT N_("Start in minimal view (without menus)" )
+#define QT_BGCONE_TEXT N_( "Display background cone or art" )
+#define QT_BGCONE_LONGTEXT N_( "Display background cone or current album art " \
+ "when not playing." \
+ "Can be disabled to prevent burning screen." )
+#define QT_BGCONE_EXPANDS_TEXT N_( "Expanding background cone or art." )
+#define QT_BGCONE_EXPANDS_LONGTEXT N_( "Background art fits window's size" )
/**********************************************************************/
vlc_module_begin ()
set_shortname( "Qt" )
@@ -238,6 +244,10 @@ vlc_module_begin ()
QT_AUTOLOAD_EXTENSIONS_TEXT, QT_AUTOLOAD_EXTENSIONS_LONGTEXT,
false )
+ add_bool( "qt-bgcone", true, QT_BGCONE_TEXT, QT_BGCONE_LONGTEXT, true )
+ add_bool( "qt-bgcone-expands", false, QT_BGCONE_EXPANDS_TEXT,
+ QT_BGCONE_EXPANDS_LONGTEXT, true )
+
add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */
add_obsolete_integer( "qt-display-mode" ) /* Suppressed since 1.1.0 */
More information about the vlc-commits
mailing list