X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Futil%2Fcustomwidgets.cpp;h=ba58004ae9520e00ba6752e4ccf39924e72056f1;hb=9e9b88590430f51228ad3f0c72d219543ca1e1f0;hp=a7251cd686c6c3b8a1662f1a8944af9e59ccb242;hpb=dbddc5ae452252807b520abdb803cf5f231bbdf0;p=vlc diff --git a/modules/gui/qt4/util/customwidgets.cpp b/modules/gui/qt4/util/customwidgets.cpp index a7251cd686..ba58004ae9 100644 --- a/modules/gui/qt4/util/customwidgets.cpp +++ b/modules/gui/qt4/util/customwidgets.cpp @@ -30,7 +30,6 @@ #include "customwidgets.hpp" #include #include -#include #include #include #include @@ -60,9 +59,9 @@ void ClickLineEdit::setText( const QString &txt ) 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(); @@ -70,6 +69,7 @@ void ClickLineEdit::paintEvent( QPaintEvent *pe ) cr.setLeft( cr.left() + 3 ); p.drawText( cr, Qt::AlignLeft | Qt::AlignVCenter, mClickMessage ); p.setPen( tmp ); + p.end(); } } @@ -181,6 +181,8 @@ int qtWheelEventToVLCKey( QWheelEvent *e ) QString VLCKeyToString( int val ) { + const char *base = KeyToString (val & ~KEY_MODIFIER); + QString r = ""; if( val & KEY_MODIFIER_CTRL ) r+= "Ctrl+"; @@ -189,14 +191,6 @@ QString VLCKeyToString( int val ) 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"); }