mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Remove some App::wnd() calls.
This commit is contained in:
@@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/ui_utility.h"
|
||||
#include "dialogs/dialogs_layout.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
#include "window/window_controller.h"
|
||||
#include "storage/file_download.h"
|
||||
#include "main/main_session.h"
|
||||
#include "main/main_account.h"
|
||||
@@ -34,7 +35,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "styles/style_layers.h"
|
||||
#include "styles/style_window.h"
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtGui/QGuiApplication>
|
||||
#include <QtGui/QScreen>
|
||||
|
||||
namespace Window {
|
||||
namespace Notifications {
|
||||
@@ -47,7 +49,10 @@ int notificationMaxHeight() {
|
||||
|
||||
QPoint notificationStartPosition() {
|
||||
const auto corner = Core::App().settings().notificationsCorner();
|
||||
const auto r = psDesktopRect();
|
||||
const auto window = Core::App().activeWindow();
|
||||
const auto r = window
|
||||
? window->widget()->desktopRect()
|
||||
: QGuiApplication::primaryScreen()->availableGeometry();
|
||||
const auto isLeft = Core::Settings::IsLeftCorner(corner);
|
||||
const auto isTop = Core::Settings::IsTopCorner(corner);
|
||||
const auto x = (isLeft == rtl()) ? (r.x() + r.width() - st::notifyWidth - st::notifyDeltaX) : (r.x() + st::notifyDeltaX);
|
||||
|
Reference in New Issue
Block a user