]> git.sesse.net Git - vlc/commitdiff
Qt: Preferences tree filter, Alternative clear search button
authorYuval Tze <yuvaltze@gmail.com>
Tue, 26 Jul 2011 19:30:41 +0000 (22:30 +0300)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 29 Jul 2011 10:58:48 +0000 (12:58 +0200)
modules/gui/qt4/Modules.am
modules/gui/qt4/pixmaps/search_clear.png [new file with mode: 0644]
modules/gui/qt4/util/searchlineedit.cpp
modules/gui/qt4/vlc.qrc

index 1ed9f58768ae9e56af8cba9c0b8ad284c42edc3f..f64eda1b51ea1b5a97d44290bef10c18895e0ec4 100644 (file)
@@ -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 (file)
index 0000000..5253ed3
Binary files /dev/null and b/modules/gui/qt4/pixmaps/search_clear.png differ
index 9b3abdb1899d60b0ec8f4b379c3895649e049726..d9ae04815525b1bfe26afe46cf4dc78d7a5af871 100644 (file)
@@ -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 )
index 8811c746410982aa41f5b4201e4c74d0534ae279..473e95974217250fa18dd0f1954963f107579acc 100644 (file)
@@ -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>