2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Use install_base_filter for lib_base.

This commit is contained in:
John Preston
2019-09-19 12:28:36 +03:00
parent a6b96662c4
commit f677b116f9
14 changed files with 43 additions and 124 deletions

View File

@@ -26,8 +26,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/localstorage.h"
#include "core/file_utilities.h"
#include "core/application.h"
#include "core/event_filter.h"
#include "lang/lang_keys.h"
#include "base/event_filter.h"
#include "base/zlib_help.h"
#include "base/unixtime.h"
#include "data/data_session.h"
@@ -717,15 +717,15 @@ void CreateForExistingBox(
box->closeBox();
StartEditor(window, cloud);
};
Core::InstallEventFilter(box, box, [=](not_null<QEvent*> event) {
base::install_event_filter(box, box, [=](not_null<QEvent*> event) {
if (event->type() == QEvent::KeyPress) {
const auto key = static_cast<QKeyEvent*>(event.get())->key();
if (key == Qt::Key_Enter || key == Qt::Key_Return) {
done();
return Core::EventFilter::Result::Cancel;
return base::EventFilterResult::Cancel;
}
}
return Core::EventFilter::Result::Continue;
return base::EventFilterResult::Continue;
});
box->addButton(tr::lng_theme_editor_create(), done);
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });