1 /*****************************************************************************
2 * qvlcframe.hpp : A few helpers
3 ****************************************************************************
4 * Copyright (C) 2000-2006 the VideoLAN team
5 * $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
27 #include <QApplication>
29 #include <QMainWindow>
30 #include <QPlastiqueStyle>
33 class QVLCFrame : public QWidget
36 static void fixStyle( QWidget *w)
38 QStyle *style = qApp->style();
39 // Plastique is too dark.
40 /// theming ? getting KDE data ? ?
41 if( qobject_cast<QPlastiqueStyle *>(style) )
43 QPalette plt( w->palette() );
44 plt.setColor( QPalette::Active, QPalette::Highlight, Qt::gray );
45 QColor vlg = (Qt::lightGray);
47 vlg.setHsv( vlg.hue(), vlg.saturation(), 235 );
48 plt.setColor( QPalette::Active, QPalette::Window, vlg );
49 plt.setColor( QPalette::Inactive, QPalette::Window, vlg );
54 QVLCFrame( intf_thread_t *_p_intf ) : QWidget( NULL ), p_intf( _p_intf )
58 virtual ~QVLCFrame() {};
62 if( isVisible() ) hide();
66 intf_thread_t *p_intf;
68 void readSettings( QString name, QSize defSize )
70 QSettings settings( "VideoLAN", "VLC" );
71 settings.beginGroup( name );
72 resize( settings.value( "size", defSize ).toSize() );
73 move( settings.value( "pos", QPoint( 0,0 ) ).toPoint() );
76 void writeSettings( QString name )
78 QSettings settings( "VideoLAN", "VLC" );
79 settings.beginGroup( name );
80 settings.setValue ("size", size() );
81 settings.setValue( "pos", pos() );
86 class QVLCMW : public QMainWindow
89 QVLCMW( intf_thread_t *_p_intf ) : QMainWindow( NULL ), p_intf( _p_intf )
91 QVLCFrame::fixStyle( this );
95 intf_thread_t *p_intf;
98 void readSettings( QString name, QSize defSize )
100 QSettings settings( "VideoLAN", "VLC" );
101 settings.beginGroup( name );
102 mainSize = settings.value( "size", defSize ).toSize();
104 move( settings.value( "pos", QPoint( 0,0 ) ).toPoint() );
107 void writeSettings( QString name )
109 QSettings settings( "VideoLAN", "VLC" );
110 settings.beginGroup( name );
111 settings.setValue ("size", size() );
112 settings.setValue( "pos", pos() );