2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Add Qt 6 support

Tested only on Linux so far
This commit is contained in:
Ilya Fedin
2021-10-19 17:00:21 +04:00
committed by John Preston
parent ea10cf5758
commit 847c01d605
154 changed files with 382 additions and 339 deletions

View File

@@ -36,7 +36,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_widgets.h"
#include "styles/style_window.h"
#include <QtWidgets/QDesktopWidget>
#include <QtCore/QMimeData>
#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
@@ -655,7 +654,7 @@ void MainWindow::updateUnreadCounter() {
}
QRect MainWindow::computeDesktopRect() const {
return QApplication::desktop()->availableGeometry(this);
return (screen() ? screen() : QApplication::primaryScreen())->availableGeometry();
}
void MainWindow::savePosition(Qt::WindowState state) {
@@ -791,12 +790,12 @@ void MainWindow::showRightColumn(object_ptr<TWidget> widget) {
}
int MainWindow::maximalExtendBy() const {
auto desktop = QDesktopWidget().availableGeometry(this);
auto desktop = (screen() ? screen() : QApplication::primaryScreen())->availableGeometry();
return std::max(desktop.width() - body()->width(), 0);
}
bool MainWindow::canExtendNoMove(int extendBy) const {
auto desktop = QDesktopWidget().availableGeometry(this);
auto desktop = (screen() ? screen() : QApplication::primaryScreen())->availableGeometry();
auto inner = body()->mapToGlobal(body()->rect());
auto innerRight = (inner.x() + inner.width() + extendBy);
auto desktopRight = (desktop.x() + desktop.width());
@@ -804,7 +803,7 @@ bool MainWindow::canExtendNoMove(int extendBy) const {
}
int MainWindow::tryToExtendWidthBy(int addToWidth) {
auto desktop = QDesktopWidget().availableGeometry(this);
auto desktop = (screen() ? screen() : QApplication::primaryScreen())->availableGeometry();
auto inner = body()->mapToGlobal(body()->rect());
accumulate_min(
addToWidth,