diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-10-08 11:00:07 +0300 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2021-10-08 13:05:53 +0300 |
commit | 10cddab2e38a26d4a2593fcb095fca8230a39486 (patch) | |
tree | ca33a0781334259a35317afd6da36957d1941ff6 /kicker | |
parent | 48077a30f9997448365742e3c7060bb7ad862aa7 (diff) | |
download | tdebase-10cddab2e38a26d4a2593fcb095fca8230a39486.tar.gz tdebase-10cddab2e38a26d4a2593fcb095fca8230a39486.zip |
TDEMenu search shortcut: various fixes
* Better Escape key usage prevention
* Better handling of different shortcut counts (0 vs 1 vs 2)
* Fixed a deprecated function call to setShortcut()
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'kicker')
-rw-r--r-- | kicker/kicker/ui/k_mnu.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/kicker/kicker/ui/k_mnu.cpp b/kicker/kicker/ui/k_mnu.cpp index a4a1f6d58..b99d6e3ba 100644 --- a/kicker/kicker/ui/k_mnu.cpp +++ b/kicker/kicker/ui/k_mnu.cpp @@ -270,13 +270,22 @@ void PanelKMenu::initialize() TDEToolBarButton *clearButton = new TDEToolBarButton( "locationbar_erase", 0, hbox ); TQStringList cuts = TQStringList::split(";", KickerSettings::searchShortcut()); - searchEdit = new KPIM::ClickLineEdit( - hbox, - ( cuts.count() == 2 - ? i18n(" Press '%1' or '%2' to search...").arg(cuts[0], cuts[1]) - : i18n(" Press '%1' to search...").arg(cuts[0]) - ) - ); + TQString placeholder; + switch( cuts.count() ) + { + case 0: + placeholder = i18n(" Click here to search..."); + break; + + case 1: + placeholder = i18n(" Press '%1' to search...").arg(cuts[0]); + break; + + case 2: + placeholder = i18n(" Press '%1' or '%2' to search...").arg(cuts[0], cuts[1]); + break; + } + searchEdit = new KPIM::ClickLineEdit( hbox, placeholder ); hbox->setFocusPolicy(TQ_StrongFocus); hbox->setFocusProxy(searchEdit); |