****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* Copyright (C) 2004 Daniel Molkentin <molkentin@kde.org>
- * $Id: qvlcframe.hpp 16283 2006-08-17 18:16:09Z zorglub $
+ * $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
* The "ClickLineEdit" control is based on code by Daniel Molkentin
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "customwidgets.hpp"
#include <QPainter>
#include <QLineEdit>
-#include <QPainter>
#include <QColorGroup>
#include <QRect>
#include <QKeyEvent>
void ClickLineEdit::paintEvent( QPaintEvent *pe )
{
- QPainter p( this );
QLineEdit::paintEvent( pe );
if ( mDrawClickMsg == true && !hasFocus() ) {
+ QPainter p( this );
QPen tmp = p.pen();
p.setPen( palette().color( QPalette::Disabled, QPalette::Text ) );
QRect cr = contentsRect();
cr.setLeft( cr.left() + 3 );
p.drawText( cr, Qt::AlignLeft | Qt::AlignVCenter, mClickMessage );
p.setPen( tmp );
+ p.end();
}
}
QLineEdit::dropEvent( ev );
}
-
void ClickLineEdit::focusInEvent( QFocusEvent *ev )
{
if ( mDrawClickMsg == true ) {
QLineEdit::focusInEvent( ev );
}
-
void ClickLineEdit::focusOutEvent( QFocusEvent *ev )
{
if ( text().isEmpty() ) {
HANDLE( Key_Delete, KEY_DELETE );
HANDLE( Key_VolumeDown, KEY_VOLUME_DOWN);
HANDLE( Key_VolumeUp, KEY_VOLUME_UP );
+ HANDLE( Key_VolumeMute, KEY_VOLUME_MUTE );
HANDLE( Key_MediaPlay, KEY_MEDIA_PLAY_PAUSE );
HANDLE( Key_MediaStop, KEY_MEDIA_STOP );
HANDLE( Key_MediaPrevious, KEY_MEDIA_PREV_TRACK );
QString VLCKeyToString( int val )
{
+ const char *base = KeyToString (val & ~KEY_MODIFIER);
+
QString r = "";
if( val & KEY_MODIFIER_CTRL )
r+= "Ctrl+";
if( val & KEY_MODIFIER_SHIFT )
r+= "Shift+";
- unsigned int i_keys = sizeof(vlc_keys)/sizeof(key_descriptor_t);
- for( unsigned int i = 0; i< i_keys; i++ )
- {
- if( vlc_keys[i].i_key_code == (val& ~KEY_MODIFIER) )
- {
- r+= vlc_keys[i].psz_key_string;
- }
- }
- return r;
+ return r + (base ? base : "Unset");
}
-#include <QComboBox>
-
-void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf,
- QComboBox *combo, QWidget *parent )
-{
- module_config_t *p_config =
- config_FindConfig( VLC_OBJECT(p_intf), configname );
- if( p_config )
- {
- for ( int i_index = 0; i_index < p_config->i_list; i_index++ )
- {
- combo->addItem( qfu( p_config->ppsz_list_text[i_index] ),
- QVariant( p_config->pi_list[i_index] ) );
- if( p_config->value.i == p_config->pi_list[i_index] )
- {
- combo->setCurrentIndex( i_index );
- }
- }
- combo->setToolTip( qfu( p_config->psz_longtext ) );
- }
-}