void Window::onTitleBack() { if (main) { main->onTitleBack(); } if (settings) { hideSettings(); } }
void Window::sendPaths() { if (settings) { hideSettings(); } else { if (layerShown()) { hideLayer(); } if (main && !main->animating()) { main->activate(); } } }
TitleWidget::TitleWidget(MainWindow *window) : TWidget(window) , wnd(window) , hideLevel(0) , hider(0) , _back(this, st::titleBackButton, lang(lng_menu_back)) , _cancel(this, lang(lng_cancel), st::titleTextButton) , _settings(this, lang(lng_menu_settings), st::titleTextButton) , _contacts(this, lang(lng_menu_contacts), st::titleTextButton) , _about(this, lang(lng_menu_about), st::titleTextButton) , _lock(this, window) , _update(this, window, lang(lng_menu_update)) , _minimize(this, window) , _maximize(this, window) , _restore(this, window) , _close(this, window) , _a_update(animation(this, &TitleWidget::step_update)) , lastMaximized(!(window->windowState() & Qt::WindowMaximized)) { setGeometry(0, 0, wnd->width(), st::titleHeight); setAttribute(Qt::WA_OpaquePaintEvent); _lock.hide(); _update.hide(); _cancel.hide(); _back.hide(); if ( #ifndef TDESKTOP_DISABLE_AUTOUPDATE Sandbox::updatingState() == Application::UpdatingReady || #endif cHasPasscode() ) { showUpdateBtn(); } stateChanged(); connect(&_back, SIGNAL(clicked()), window, SLOT(hideSettings())); connect(&_cancel, SIGNAL(clicked()), this, SIGNAL(hiderClicked())); connect(&_settings, SIGNAL(clicked()), window, SLOT(showSettings())); connect(&_contacts, SIGNAL(clicked()), this, SLOT(onContacts())); connect(&_about, SIGNAL(clicked()), this, SLOT(onAbout())); connect(wnd->windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState))); #ifndef TDESKTOP_DISABLE_AUTOUPDATE Sandbox::connect(SIGNAL(updateReady()), this, SLOT(showUpdateBtn())); #endif if (cPlatform() != dbipWindows) { _minimize.hide(); _maximize.hide(); _restore.hide(); _close.hide(); } }
void Window::sendPaths() { if (_mediaView && !_mediaView->isHidden()) _mediaView->hide(); if (settings) { hideSettings(); } else { if (layerShown()) { hideLayer(); } if (main && !main->animating()) { main->activate(); } } }
void Window::showSettings() { App::wnd()->hideLayer(); if (settings) { return hideSettings(); } QPixmap bg = myGrab(this, QRect(0, st::titleHeight, width(), height() - st::titleHeight)); if (intro) { anim::stop(intro); intro->hide(); } else if (main) { anim::stop(main); main->hide(); } settings = new Settings(this); settings->animShow(bg); fixOrder(); }
TitleWidget::TitleWidget(Window *window) : QWidget(window) , wnd(window) , hideLevel(0) , hider(0) , _back(this, st::titleBackButton, lang(lng_menu_back)) , _cancel(this, lang(lng_cancel), st::titleTextButton) , _settings(this, lang(lng_menu_settings), st::titleTextButton) , _contacts(this, lang(lng_menu_contacts), st::titleTextButton) , _about(this, lang(lng_menu_about), st::titleTextButton) , _update(this, window, lang(lng_menu_update)) , _minimize(this, window) , _maximize(this, window) , _restore(this, window) , _close(this, window) , lastMaximized(!(window->windowState() & Qt::WindowMaximized)) { setGeometry(0, 0, wnd->width(), st::titleHeight); _update.hide(); _cancel.hide(); _back.hide(); if (App::app()->updatingState() == Application::UpdatingReady) { showUpdateBtn(); } stateChanged(); connect(&_back, SIGNAL(clicked()), window, SLOT(hideSettings())); connect(&_cancel, SIGNAL(clicked()), this, SIGNAL(hiderClicked())); connect(&_settings, SIGNAL(clicked()), window, SLOT(showSettings())); connect(&_contacts, SIGNAL(clicked()), this, SLOT(onContacts())); connect(&_about, SIGNAL(clicked()), this, SLOT(onAbout())); connect(wnd->windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState))); connect(App::app(), SIGNAL(updateReady()), this, SLOT(showUpdateBtn())); if (cPlatform() != dbipWindows) { _minimize.hide(); _maximize.hide(); _restore.hide(); _close.hide(); } }
void Window::showSettings() { if (isHidden()) showFromTray(); App::wnd()->hideLayer(); if (settings) { return hideSettings(); } QPixmap bg = myGrab(this, QRect(0, st::titleHeight, width(), height() - st::titleHeight)); if (intro) { anim::stop(intro); intro->hide(); } else if (main) { anim::stop(main); main->hide(); } settings = new SettingsWidget(this); settings->animShow(bg); title->updateBackButton(); fixOrder(); }