From 8fc38d9ac298b347926b1963642f2505a9b2bbd8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 23 Jun 2016 15:02:40 +0300 Subject: [PATCH] Creating MediaView after the main window. That way the main window is created with the right size even with FullScreen flag for MediaView. Using FullScreen flag only on Windows (or Dock auto hides on OS X). --- Telegram/SourceFiles/mainwindow.cpp | 7 +++---- Telegram/SourceFiles/mediaview.cpp | 7 ++++--- Telegram/SourceFiles/mediaview.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index 8f7652aca..d8bbb5de4 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -455,7 +455,7 @@ void MainWindow::firstShow() { #else trayIconMenu = new QMenu(this); #endif - QString notificationItem = lang(cDesktopNotify() + auto notificationItem = lang(cDesktopNotify() ? lng_disable_notifications_from_tray : lng_enable_notifications_from_tray); if (cPlatform() == dbipWindows || cPlatform() == dbipMac || cPlatform() == dbipMacOld) { @@ -469,9 +469,10 @@ void MainWindow::firstShow() { trayIconMenu->addAction(lang(lng_quit_from_tray), this, SLOT(quitFromTray()))->setEnabled(true); } psUpdateWorkmode(); - psFirstShow(); updateTrayMenu(); + + _mediaView = new MediaView(); } QWidget *MainWindow::filedialogParent() { @@ -667,8 +668,6 @@ void MainWindow::setupMain(bool anim, const MTPUser *self) { fixOrder(); updateTitleStatus(); - - _mediaView = new MediaView(); } void MainWindow::updateUnreadCounter() { diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index e262aa7da..9f3d29fab 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -80,8 +80,7 @@ MediaView::MediaView() : TWidget(App::wnd()) , _radial(animation(this, &MediaView::step_radial)) , _lastAction(-st::mvDeltaFromLastAction, -st::mvDeltaFromLastAction) , _a_state(animation(this, &MediaView::step_state)) -, _dropdown(this, st::mvDropdown) -, _saveMsgOpacity(0) { +, _dropdown(this, st::mvDropdown) { TextCustomTagsMap custom; custom.insert(QChar('c'), qMakePair(textcmdStartLink(1), textcmdStopLink())); _saveMsgText.setRichText(st::medviewSaveMsgFont, lang(lng_mediaview_saved), _textDlgOptions, custom); @@ -100,7 +99,9 @@ MediaView::MediaView() : TWidget(App::wnd()) hide(); createWinId(); - setWindowState(Qt::WindowFullScreen); + if (cPlatform() == dbipWindows) { + setWindowState(Qt::WindowFullScreen); + } _saveMsgUpdater.setSingleShot(true); connect(&_saveMsgUpdater, SIGNAL(timeout()), this, SLOT(updateImage())); diff --git a/Telegram/SourceFiles/mediaview.h b/Telegram/SourceFiles/mediaview.h index 9bc3ab893..ae07799ac 100644 --- a/Telegram/SourceFiles/mediaview.h +++ b/Telegram/SourceFiles/mediaview.h @@ -258,7 +258,7 @@ private: QString _saveMsgFilename; uint64 _saveMsgStarted = 0; - anim::fvalue _saveMsgOpacity; + anim::fvalue _saveMsgOpacity = { 0 }; QRect _saveMsg; QTimer _saveMsgUpdater; Text _saveMsgText;