mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Use QApplication::screens().first() instead of deprecated methods
Also follows-up moving away from QDesktop widget from c99f12e8fe
Note: `QScreen::availableGeometry()` doesn't take the parent argument as opposed to `QDesktopWidget::availableGeometry(QWidget &xd)` - no idea if not passing an argument breaks anything, but just for the sake of having Chatterino compile I didn't mind it that much while fixing compilation.
Reference:
- https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktop
This commit is contained in:
parent
d6450a8f78
commit
e2f59d2e61
|
@ -15,6 +15,7 @@
|
|||
#include <QDebug>
|
||||
#include <QFont>
|
||||
#include <QIcon>
|
||||
#include <QScreen>
|
||||
#include <functional>
|
||||
|
||||
#ifdef CHATTERINO
|
||||
|
@ -601,10 +602,10 @@ void BaseWindow::moveIntoDesktopRect(QWidget *parent, QPoint point)
|
|||
return;
|
||||
|
||||
// move the widget into the screen geometry if it's not already in there
|
||||
QDesktopWidget *desktop = QApplication::desktop();
|
||||
auto *desktop = QApplication::screens().first();
|
||||
QPoint globalCursorPos = QCursor::pos();
|
||||
|
||||
QRect s = desktop->availableGeometry(parent);
|
||||
QRect s = desktop->availableGeometry(/*parent*/);
|
||||
|
||||
bool stickRight = false;
|
||||
bool stickBottom = false;
|
||||
|
|
|
@ -5,9 +5,7 @@
|
|||
#include "widgets/helper/ChannelView.hpp"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QScreen>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace chatterino {
|
||||
|
@ -32,7 +30,7 @@ void NotificationPopup::updatePosition()
|
|||
{
|
||||
Location location = BottomRight;
|
||||
|
||||
QDesktopWidget *desktop = QApplication::desktop();
|
||||
auto *desktop = QApplication::screens().first();
|
||||
const QRect rect = desktop->availableGeometry();
|
||||
|
||||
switch (location)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QDesktopWidget>
|
||||
#include <QPainter>
|
||||
|
||||
#include "BaseTheme.hpp"
|
||||
|
@ -345,7 +344,8 @@ void Button::showMenu()
|
|||
return;
|
||||
|
||||
auto point = [this] {
|
||||
auto bounds = QApplication::desktop()->availableGeometry(this);
|
||||
auto bounds =
|
||||
QApplication::screens().first()->availableGeometry(/*this*/);
|
||||
|
||||
auto point = this->mapToGlobal(
|
||||
QPoint(this->width() - this->menu_->width(), this->height()));
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "widgets/splits/Split.hpp"
|
||||
#include "widgets/splits/SplitContainer.hpp"
|
||||
|
||||
#include <QDesktopWidget>
|
||||
#include <QDrag>
|
||||
#include <QHBoxLayout>
|
||||
#include <QInputDialog>
|
||||
|
|
Loading…
Reference in a new issue