1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 08:22:33 +02:00

Fix wallpaper functionallity for one screen on MacOS

This commit is contained in:
Elias Steurer 2020-04-20 16:54:26 +02:00
parent 1365cfc47b
commit 36644ba12d
2 changed files with 20 additions and 0 deletions

View File

@ -16,6 +16,20 @@ MacWindow::MacWindow(
}
setVolume(volumeParsed);
// Ether for one Screen or for all
if ((QApplication::screens().length() == activeScreensList.length()) && (activeScreensList.length() != 1)) {
//setupWallpaperForAllScreens();
} else if (activeScreensList.length() == 1) {
//setupWallpaperForOneScreen(activeScreensList.at(0));
auto* screen = QGuiApplication::screens().at(0);
m_window.setWidth(screen->geometry().width());
m_window.setHeight(screen->geometry().height());
} else if (activeScreensList.length() > 1) {
//setupWallpaperForMultipleScreens(activeScreensList);
}
// WARNING: Setting Window flags must be called *here*!
Qt::WindowFlags flags = m_window.flags();
m_window.setFlags(flags | Qt::FramelessWindowHint | Qt::Desktop);
@ -23,9 +37,14 @@ MacWindow::MacWindow(
m_window.setResizeMode(QQuickView::ResizeMode::SizeRootObjectToView);
m_window.rootContext()->setContextProperty("window", this);
// Instead of setting "renderType: Text.NativeRendering" every time
// we can set it here once :)
m_window.setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering);
m_window.setSource(QUrl("qrc:/mainWindow.qml"));
MacIntegration* macIntegration = new MacIntegration(this);
macIntegration->SetBackgroundLevel(&m_window);
}
void MacWindow::setVisible(bool show)

View File

@ -12,6 +12,7 @@
#include <QVector>
#include "basewindow.h"
#include "macintegration.h"
class MacWindow : public BaseWindow
{