mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Use QScreen instead of QDesktopWidget::screen
This commit is contained in:
committed by
Mat Sutcliffe
parent
c82ff139fe
commit
338d4d0cdb
@@ -21,6 +21,7 @@
|
||||
#include <QLayoutItem>
|
||||
#include <QMenu>
|
||||
#include <QScopedPointer>
|
||||
#include <QScreen>
|
||||
#include <QSettings>
|
||||
#include <QSizePolicy>
|
||||
#include <QStatusBar>
|
||||
@@ -616,6 +617,6 @@ namespace BlackGui
|
||||
{
|
||||
// center on screen when floating
|
||||
if (!this->isFloating()) { return; }
|
||||
this->move(QApplication::desktop()->screen()->rect().center() - this->rect().center());
|
||||
this->move(sGui->currentScreen()->geometry().center() - this->rect().center());
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "blackgui/dockwidgetinfoarea.h"
|
||||
#include "blackgui/filters/filterdialog.h"
|
||||
#include "blackgui/filters/filterwidget.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackgui/loadindicator.h"
|
||||
#include "blackgui/menus/fontmenus.h"
|
||||
@@ -764,7 +765,8 @@ namespace BlackGui
|
||||
if (m_forceColumnsToMaxSize)
|
||||
{
|
||||
// vpNew.setWidth(std::numeric_limits<qint32>::max()); // largest finite value
|
||||
const QRect screenGeometry = QApplication::desktop()->screenGeometry();
|
||||
QGuiApplication::screens();
|
||||
const QRect screenGeometry = sGui->currentScreen()->geometry();
|
||||
QRect vpNew = vpOriginal;
|
||||
vpNew.setWidth(screenGeometry.width());
|
||||
this->viewport()->setGeometry(vpNew);
|
||||
|
||||
Reference in New Issue
Block a user