[vlc-devel] [PATCH 5/5] Alternative clear search button

Yuval Tze yuvaltze at gmail.com
Tue Jul 26 23:17:37 CEST 2011


---
 modules/gui/qt4/pixmaps/search_clear.png |  Bin 0 -> 315 bytes
 modules/gui/qt4/util/searchlineedit.cpp  |    7 ++++---
 modules/gui/qt4/vlc.qrc                  |    1 +
 3 files changed, 5 insertions(+), 3 deletions(-)
 create mode 100644 modules/gui/qt4/pixmaps/search_clear.png

diff --git a/modules/gui/qt4/pixmaps/search_clear.png b/modules/gui/qt4/pixmaps/search_clear.png
new file mode 100644
index 0000000000000000000000000000000000000000..c209b51528875e3f9d352b1616e012adfac97b53
GIT binary patch
literal 315
zcmeAS at N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@
z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg)b_qcib$_K87NF2>PZ!4!i_=dp
z8fG~K3b0;S{Es!_)cwYntkH_y1&s1KqU96aJTzI>+;tX9*x+Bqy>ZKCp<K6_H90<7
zg$Wh!@0lClshr;4 at 5bBzvB>?uMzh{C3AJ^#i(ei(yKttQnni--jw8~mLV{V#Wn)xc
z8XVSq7ro}<VZ$A91;1?;2v^r91yBAhc=qoBZJi>=&-?X6ZakD;|6|q46;9u at 3gp)Y
zeDgk7J?C;t?#!|{m$-jVrdii--sr(^zwwm9r^rV<jw*_l-?dh11HHlE>FVdQ&MBb@
E0B@~y>i_@%

literal 0
HcmV?d00001

diff --git a/modules/gui/qt4/util/searchlineedit.cpp b/modules/gui/qt4/util/searchlineedit.cpp
index 9b3abdb..d9ae048 100644
--- a/modules/gui/qt4/util/searchlineedit.cpp
+++ b/modules/gui/qt4/util/searchlineedit.cpp
@@ -107,7 +107,7 @@ void ClickLineEdit::focusOutEvent( QFocusEvent *ev )
 SearchLineEdit::SearchLineEdit( QWidget *parent ) : QLineEdit( parent )
 {
     clearButton = new QFramelessButton( this );
-    clearButton->setIcon( QIcon( ":/toolbar/clear" ) );
+    clearButton->setIcon( QIcon( ":/search_clear" ) );
     clearButton->setIconSize( QSize( 16, 16 ) );
     clearButton->setCursor( Qt::ArrowCursor );
     clearButton->setToolTip( qfu(vlc_pgettext("Tooltip|Clear", "Clear")) );
@@ -123,7 +123,7 @@ SearchLineEdit::SearchLineEdit( QWidget *parent ) : QLineEdit( parent )
                                   "padding-bottom: 1px; "
                                   "padding-right: %2px;" )
                                   .arg( metrics.height() + ( 2 * frameWidth ) )
-                                  .arg( clearButton->sizeHint().width() + 1 );
+                                  .arg( clearButton->sizeHint().width() + 6 );
     setStyleSheet( styleSheet );
 
     setMessageVisible( true );
@@ -160,7 +160,8 @@ void SearchLineEdit::resizeEvent ( QResizeEvent * event )
     QLineEdit::resizeEvent( event );
     int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth,0,this);
     clearButton->resize( clearButton->sizeHint().width(), height() );
-    clearButton->move( width() - clearButton->width() - frameWidth, 0 );
+    clearButton->move( width() - clearButton->width() - frameWidth - 3,
+                      ( height() - clearButton->height() + 2 ) / 2 );
 }
 
 void SearchLineEdit::focusInEvent( QFocusEvent *event )
diff --git a/modules/gui/qt4/vlc.qrc b/modules/gui/qt4/vlc.qrc
index 8811c74..473e959 100644
--- a/modules/gui/qt4/vlc.qrc
+++ b/modules/gui/qt4/vlc.qrc
@@ -95,6 +95,7 @@
         <file alias="go-next">pixmaps/go-next.png</file>
         <file alias="new.png">pixmaps/profile_new.png</file>
         <file alias="lock">pixmaps/lock.png</file>
+        <file alias="search_clear">pixmaps/search_clear.png</file>
     </qresource>
     <qresource prefix="/prefsmenu">
         <file alias="cone_audio_64">pixmaps/prefs/spref_cone_Audio_64.png</file>
-- 
1.7.4.1




More information about the vlc-devel mailing list