mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Added key filter to calls settings box while shortcut is recording.
This commit is contained in:
parent
d36fad7268
commit
190b1c9872
1 changed files with 12 additions and 0 deletions
|
@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/wrap/slide_wrap.h"
|
#include "ui/wrap/slide_wrap.h"
|
||||||
#include "ui/toast/toast.h"
|
#include "ui/toast/toast.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
|
#include "base/event_filter.h"
|
||||||
#include "base/platform/base_platform_global_shortcuts.h"
|
#include "base/platform/base_platform_global_shortcuts.h"
|
||||||
#include "data/data_channel.h"
|
#include "data/data_channel.h"
|
||||||
#include "data/data_group_call.h"
|
#include "data/data_group_call.h"
|
||||||
|
@ -243,6 +244,17 @@ void GroupCallSettingsBox(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
call->applyGlobalShortcutChanges();
|
call->applyGlobalShortcutChanges();
|
||||||
}, box->lifetime());
|
}, box->lifetime());
|
||||||
|
|
||||||
|
auto boxKeyFilter = [=](not_null<QEvent*> e) {
|
||||||
|
if (e->type() != QEvent::KeyPress) {
|
||||||
|
return base::EventFilterResult::Continue;
|
||||||
|
}
|
||||||
|
return (state->recording)
|
||||||
|
? base::EventFilterResult::Cancel
|
||||||
|
: base::EventFilterResult::Continue;
|
||||||
|
};
|
||||||
|
box->lifetime().make_state<base::unique_qptr<QObject>>(
|
||||||
|
base::install_event_filter(box, std::move(boxKeyFilter)));
|
||||||
}
|
}
|
||||||
|
|
||||||
AddSkip(layout);
|
AddSkip(layout);
|
||||||
|
|
Loading…
Add table
Reference in a new issue