File src/PipeDial.cpp changed (mode: 100644) (index 517ed1c..1f679a4) |
... |
... |
PipeDial::buildNormalMode() |
201 |
201 |
modes.switchTo("help"); |
modes.switchTo("help"); |
202 |
202 |
screen.replaceTopWidget(&help); |
screen.replaceTopWidget(&help); |
203 |
203 |
}, "display help" }); |
}, "display help" }); |
204 |
|
normalMode.addShortcut({ L"e", [&]() { |
|
205 |
|
cursed::Prompt prompt; |
|
206 |
|
cursed::Track tmpTrack; |
|
207 |
|
tmpTrack.addItem(&title); |
|
208 |
|
tmpTrack.addItem(&list); |
|
209 |
|
tmpTrack.addItem(&prompt); |
|
210 |
|
|
|
211 |
|
cursedrl::PromptRequest request(screen, prompt); |
|
212 |
|
screen.replaceTopWidget(&tmpTrack); |
|
213 |
|
if (cursedrl::PromptResult r = request.prompt(L"Edit and accept: ", |
|
214 |
|
list.getCurrent())) { |
|
215 |
|
result = r.getResult(); |
|
216 |
|
quit = true; |
|
217 |
|
} else { |
|
218 |
|
screen.replaceTopWidget(&track); |
|
219 |
|
} |
|
220 |
|
}, "edit and accept" }); |
|
|
204 |
|
normalMode.addShortcut({ L"e", [this]() { editAndAccept(); }, |
|
205 |
|
"edit and accept" }); |
221 |
206 |
normalMode.addShortcut({ vle::Key(L'e').ctrl(), [&]() { |
normalMode.addShortcut({ vle::Key(L'e').ctrl(), [&]() { |
222 |
207 |
list.scrollDown(); |
list.scrollDown(); |
223 |
208 |
}, "scroll one line down" }); |
}, "scroll one line down" }); |
|
... |
... |
PipeDial::buildNormalMode() |
230 |
215 |
return normalMode; |
return normalMode; |
231 |
216 |
} |
} |
232 |
217 |
|
|
|
218 |
|
void |
|
219 |
|
PipeDial::editAndAccept() |
|
220 |
|
{ |
|
221 |
|
cursed::Prompt prompt; |
|
222 |
|
cursed::Track tmpTrack; |
|
223 |
|
tmpTrack.addItem(&title); |
|
224 |
|
tmpTrack.addItem(&list); |
|
225 |
|
tmpTrack.addItem(&prompt); |
|
226 |
|
|
|
227 |
|
cursedrl::PromptRequest request(screen, prompt); |
|
228 |
|
screen.replaceTopWidget(&tmpTrack); |
|
229 |
|
if (cursedrl::PromptResult r = request.prompt(L"Edit and accept: ", |
|
230 |
|
list.getCurrent())) { |
|
231 |
|
result = r.getResult(); |
|
232 |
|
quit = true; |
|
233 |
|
} else { |
|
234 |
|
screen.replaceTopWidget(&track); |
|
235 |
|
} |
|
236 |
|
} |
|
237 |
|
|
233 |
238 |
void |
void |
234 |
239 |
PipeDial::filter() |
PipeDial::filter() |
235 |
240 |
{ |
{ |