2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Add TabbedSection which uses the TabbedSelector.

This commit is contained in:
John Preston
2017-04-09 21:06:06 +03:00
parent 647ea44881
commit 891d200e2d
33 changed files with 713 additions and 405 deletions

View File

@@ -110,15 +110,25 @@ MainWindow::MainWindow() {
connect(&_autoLockTimer, SIGNAL(timeout()), this, SLOT(checkAutoLock()));
subscribe(Global::RefSelfChanged(), [this]() { updateGlobalMenu(); });
subscribe(Global::RefSelfChanged(), [this] { updateGlobalMenu(); });
subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &data) {
themeUpdated(data);
});
subscribe(Messenger::Instance().authSessionChanged(), [this] { checkAuthSession(); });
checkAuthSession();
setAttribute(Qt::WA_NoSystemBackground);
setAttribute(Qt::WA_OpaquePaintEvent);
}
void MainWindow::checkAuthSession() {
if (AuthSession::Exists()) {
_controller = std::make_unique<Window::Controller>(this);
} else {
_controller = nullptr;
}
}
void MainWindow::inactivePress(bool inactive) {
_inactivePress = inactive;
if (_inactivePress) {
@@ -200,7 +210,6 @@ void MainWindow::clearWidgetsHook() {
auto wasMain = (_main != nullptr);
_passcode.destroyDelayed();
_main.destroy();
_controller.reset();
_intro.destroy();
if (wasMain) {
App::clearHistories();
@@ -352,7 +361,7 @@ void MainWindow::setupMain(const MTPUser *self) {
t_assert(AuthSession::Exists());
_controller = std::make_unique<Window::Controller>(this);
_main.create(bodyWidget(), controller());
_main->show();
updateControlsGeometry();