all: refactor windows code out of core

There are still some links from core to window but its now separate
enough to fix PanelWindow in qml tooling.
This commit is contained in:
outfoxxed 2024-10-28 16:18:41 -07:00
parent 1adad9e822
commit 4e48c6eefb
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
45 changed files with 1171 additions and 1142 deletions

View file

@ -1,58 +0,0 @@
#pragma once
#include <qobject.h>
#include <qtmetamacros.h>
#include "proxywindow.hpp"
class ProxyFloatingWindow: public ProxyWindowBase {
Q_OBJECT;
public:
explicit ProxyFloatingWindow(QObject* parent = nullptr): ProxyWindowBase(parent) {}
// Setting geometry while the window is visible makes the content item shrinks but not the window
// which is awful so we disable it for floating windows.
void setWidth(qint32 width) override;
void setHeight(qint32 height) override;
};
///! Standard toplevel operating system window that looks like any other application.
class FloatingWindowInterface: public WindowInterface {
Q_OBJECT;
QML_NAMED_ELEMENT(FloatingWindow);
public:
explicit FloatingWindowInterface(QObject* parent = nullptr);
void onReload(QObject* oldInstance) override;
[[nodiscard]] ProxyWindowBase* proxyWindow() const override;
[[nodiscard]] QQuickItem* contentItem() const override;
// NOLINTBEGIN
[[nodiscard]] bool isVisible() const override;
[[nodiscard]] bool isBackingWindowVisible() const override;
void setVisible(bool visible) override;
[[nodiscard]] qint32 width() const override;
void setWidth(qint32 width) override;
[[nodiscard]] qint32 height() const override;
void setHeight(qint32 height) override;
[[nodiscard]] QuickshellScreenInfo* screen() const override;
void setScreen(QuickshellScreenInfo* screen) override;
[[nodiscard]] QColor color() const override;
void setColor(QColor color) override;
[[nodiscard]] PendingRegion* mask() const override;
void setMask(PendingRegion* mask) override;
[[nodiscard]] QQmlListProperty<QObject> data() override;
// NOLINTEND
private:
ProxyFloatingWindow* window;
};