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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user