[vlc-commits] Qt: Preferences tree filter, Alternative clear search button

Yuval Tze git at videolan.org
Fri Jul 29 13:06:16 CEST 2011


vlc | branch: master | Yuval Tze <yuvaltze at gmail.com> | Tue Jul 26 22:30:41 2011 +0300| [fb71e567c617ee6c833839c07000cc62b3049b27] | committer: Francois Cartegnie

Qt: Preferences tree filter, Alternative clear search button

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fb71e567c617ee6c833839c07000cc62b3049b27
---

 modules/gui/qt4/Modules.am               |    1 +
 modules/gui/qt4/pixmaps/search_clear.png |  Bin 0 -> 223 bytes
 modules/gui/qt4/util/searchlineedit.cpp  |    7 ++++---
 modules/gui/qt4/vlc.qrc                  |    1 +
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/Modules.am b/modules/gui/qt4/Modules.am
index 1ed9f58..f64eda1 100644
--- a/modules/gui/qt4/Modules.am
+++ b/modules/gui/qt4/Modules.am
@@ -205,6 +205,7 @@ DEPS_res = \
 	pixmaps/win7/win7thumbnail_next.png \
 	pixmaps/win7/win7thumbnail_play.png \
 	pixmaps/update.png \
+	pixmaps/search_clear.png \
 	pixmaps/lock.png
 
 BUILT_SOURCES += $(nodist_SOURCES_qt4)
diff --git a/modules/gui/qt4/pixmaps/search_clear.png b/modules/gui/qt4/pixmaps/search_clear.png
new file mode 100644
index 0000000..5253ed3
Binary files /dev/null and b/modules/gui/qt4/pixmaps/search_clear.png differ
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>



More information about the vlc-commits mailing list