mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Close forward options box by Enter.
This commit is contained in:
parent
0b5038aaa2
commit
8a64a9b2ad
1 changed files with 11 additions and 0 deletions
|
@ -82,6 +82,17 @@ void ForwardOptionsBox(
|
|||
box->addButton(tr::lng_box_done(), [=] {
|
||||
box->closeBox();
|
||||
});
|
||||
|
||||
box->events(
|
||||
) | rpl::start_with_next([=](not_null<QEvent*> e) {
|
||||
if (e->type() == QEvent::KeyPress) {
|
||||
const auto k = static_cast<QKeyEvent*>(e.get());
|
||||
if (k->key() == Qt::Key_Enter || k->key() == Qt::Key_Return) {
|
||||
box->closeBox();
|
||||
}
|
||||
}
|
||||
}, box->lifetime());
|
||||
|
||||
box->addRow(
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
box.get(),
|
||||
|
|
Loading…
Add table
Reference in a new issue