2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Move many widget classes to lib_ui.

This commit is contained in:
John Preston
2019-09-16 14:14:06 +03:00
parent dda587a2fc
commit 849deb57e2
189 changed files with 3750 additions and 2572 deletions

View File

@@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "data/data_session.h"
#include "main/main_session.h"
#include "base/crc32hash.h"
#include "ui/ui_utility.h"
#include "apiwrap.h"
#include "mainwindow.h"
@@ -42,7 +43,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Window {
namespace {
constexpr auto kInactivePressTimeout = crl::time(200);
constexpr auto kSaveWindowPositionTimeout = crl::time(1000);
} // namespace
@@ -158,7 +158,6 @@ MainWindow::MainWindow(not_null<Controller*> controller)
}
_isActiveTimer.setCallback([this] { updateIsActive(0); });
_inactivePressTimer.setCallback([this] { setInactivePress(false); });
}
Main::Account &MainWindow::account() const {
@@ -446,8 +445,8 @@ void MainWindow::setTitleVisible(bool visible) {
}
int32 MainWindow::screenNameChecksum(const QString &name) const {
auto bytes = name.toUtf8();
return hashCrc32(bytes.constData(), bytes.size());
const auto bytes = name.toUtf8();
return base::crc32(bytes.constData(), bytes.size());
}
void MainWindow::setPositionInited() {
@@ -665,15 +664,6 @@ void MainWindow::launchDrag(std::unique_ptr<QMimeData> data) {
}
}
void MainWindow::setInactivePress(bool inactive) {
_wasInactivePress = inactive;
if (_wasInactivePress) {
_inactivePressTimer.callOnce(kInactivePressTimeout);
} else {
_inactivePressTimer.cancel();
}
}
MainWindow::~MainWindow() = default;
} // namespace Window