[vlc-devel] [PATCH] Add shortcut to set focus on playlist search field
Jean-Baptiste Kempf
jb at videolan.org
Mon Mar 7 14:31:22 CET 2016
APplied, thanks.
On 04 Mar, Guillaume Gomez wrote :
> Signed-off-by: Guillaume Gomez <guillaume1.gomez at gmail.com>
> ---
> modules/gui/qt4/components/playlist/playlist.cpp | 5 +++++
> modules/gui/qt4/components/playlist/playlist.hpp | 1 +
> modules/gui/qt4/main_interface.cpp | 6 ++++++
> 3 files changed, 12 insertions(+)
>
> diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
> index 7091805..cc89300 100644
> --- a/modules/gui/qt4/components/playlist/playlist.cpp
> +++ b/modules/gui/qt4/components/playlist/playlist.cpp
> @@ -226,6 +226,11 @@ void PlaylistWidget::changeView( const QModelIndex& index )
> locationBar->setIndex( index );
> }
>
> +void PlaylistWidget::setSearchFieldFocus()
> +{
> + searchEdit->setFocus();
> +}
> +
> #include <QSignalMapper>
> #include <QMenu>
> #include <QPainter>
> diff --git a/modules/gui/qt4/components/playlist/playlist.hpp b/modules/gui/qt4/components/playlist/playlist.hpp
> index 642e538..48d682f 100644
> --- a/modules/gui/qt4/components/playlist/playlist.hpp
> +++ b/modules/gui/qt4/components/playlist/playlist.hpp
> @@ -56,6 +56,7 @@ public:
>
> void forceHide();
> void forceShow();
> + void setSearchFieldFocus();
> QStackedWidget *artContainer;
> StandardPLPanel *mainView;
>
> diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
> index 6028b10..4ebbdd6 100644
> --- a/modules/gui/qt4/main_interface.cpp
> +++ b/modules/gui/qt4/main_interface.cpp
> @@ -1448,6 +1448,12 @@ void MainInterface::handleKeyPress( QKeyEvent *e )
> toggleMinimalView( !b_minimalView );
> e->accept();
> }
> + else if( ( e->modifiers() & Qt::ControlModifier ) && ( e->key() == Qt::Key_K ) &&
> + playlistWidget )
> + {
> + playlistWidget->setSearchFieldFocus();
> + e->accept();
> + }
>
> int i_vlck = qtEventToVLCKey( e );
> if( i_vlck > 0 )
> --
> 1.9.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
--
With my kindest regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
More information about the vlc-devel
mailing list