Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/krsearchbar.cpp
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 97 | { | |||
---|---|---|---|---|---|
101 | } | 101 | } | ||
102 | 102 | | |||
103 | _view = view; | 103 | _view = view; | ||
104 | 104 | | |||
105 | connect(_openSelectDialogBtn, &QToolButton::clicked, [this](){ _view->customSelection(true); }); | 105 | connect(_openSelectDialogBtn, &QToolButton::clicked, [this](){ _view->customSelection(true); }); | ||
106 | _view->widget()->installEventFilter(this); | 106 | _view->widget()->installEventFilter(this); | ||
107 | } | 107 | } | ||
108 | 108 | | |||
109 | void KrSearchBar::hideBarIfSearching() | ||||
110 | { | ||||
111 | if (_currentMode == MODE_SEARCH) | ||||
112 | hideBar(); | ||||
113 | } | ||||
114 | | ||||
109 | // #### public slots | 115 | // #### public slots | ||
110 | 116 | | |||
111 | void KrSearchBar::showBar(SearchMode mode) | 117 | void KrSearchBar::showBar(SearchMode mode) | ||
112 | { | 118 | { | ||
113 | int index = mode == MODE_DEFAULT ? | 119 | int index = mode == MODE_DEFAULT ? | ||
114 | KConfigGroup(krConfig, "Look&Feel") | 120 | KConfigGroup(krConfig, "Look&Feel") | ||
115 | .readEntry("Default Search Mode", QString::number(KrSearchBar::MODE_SEARCH)) | 121 | .readEntry("Default Search Mode", QString::number(KrSearchBar::MODE_SEARCH)) | ||
116 | .toInt() : | 122 | .toInt() : | ||
▲ Show 20 Lines • Show All 191 Lines • ▼ Show 20 Line(s) | 313 | if (!(modifiers == Qt::NoModifier || modifiers == Qt::KeypadModifier)) { | |||
308 | return false; | 314 | return false; | ||
309 | } | 315 | } | ||
310 | 316 | | |||
311 | switch (ke->key()) { | 317 | switch (ke->key()) { | ||
312 | case Qt::Key_Escape: { | 318 | case Qt::Key_Escape: { | ||
313 | hideBar(); | 319 | hideBar(); | ||
314 | return true; | 320 | return true; | ||
315 | } | 321 | } | ||
322 | | ||||
323 | case Qt::Key_Enter: | ||||
324 | case Qt::Key_Return: { | ||||
325 | hideBarIfSearching(); | ||||
326 | return false; | ||||
327 | } | ||||
328 | | ||||
316 | case Qt::Key_Up: | 329 | case Qt::Key_Up: | ||
317 | return handleUpDownKeyPress(true); | 330 | return handleUpDownKeyPress(true); | ||
318 | case Qt::Key_Down: | 331 | case Qt::Key_Down: | ||
319 | return handleUpDownKeyPress(false); | 332 | return handleUpDownKeyPress(false); | ||
320 | case Qt::Key_Left: | 333 | case Qt::Key_Left: | ||
321 | case Qt::Key_Right: | 334 | case Qt::Key_Right: | ||
322 | return handleLeftRightKeyPress(ke); | 335 | return handleLeftRightKeyPress(ke); | ||
323 | case Qt::Key_Insert: { | 336 | case Qt::Key_Insert: { | ||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |