Commit fb71e567 authored by Yuval Tze's avatar Yuval Tze Committed by Francois Cartegnie

Qt: Preferences tree filter, Alternative clear search button

parent cd56737f
......@@ -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)
......
......@@ -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 )
......
......@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment