mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-02-23 03:33:57 +11:00
core/popupwindow: clean up popup lifecycle and window init
- Makes popup lifecycle less complex - Creates all QWindows lazily - May break live reloading of open popups to some degree
This commit is contained in:
parent
db37dc580a
commit
de1bfe028d
8 changed files with 127 additions and 100 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include <qnamespace.h>
|
||||
#include <qobject.h>
|
||||
#include <qpoint.h>
|
||||
#include <qproperty.h>
|
||||
#include <qqmlintegration.h>
|
||||
#include <qquickitem.h>
|
||||
#include <qsize.h>
|
||||
|
|
@ -139,7 +140,9 @@ public:
|
|||
void markDirty();
|
||||
|
||||
[[nodiscard]] QObject* window() const { return this->mWindow; }
|
||||
[[nodiscard]] ProxyWindowBase* proxyWindow() const { return this->mProxyWindow; }
|
||||
[[nodiscard]] QBindable<ProxyWindowBase*> bindableProxyWindow() const {
|
||||
return &this->bProxyWindow;
|
||||
}
|
||||
[[nodiscard]] QWindow* backingWindow() const;
|
||||
void setWindowInternal(QObject* window);
|
||||
void setWindow(QObject* window);
|
||||
|
|
@ -193,11 +196,12 @@ private slots:
|
|||
private:
|
||||
QObject* mWindow = nullptr;
|
||||
QQuickItem* mItem = nullptr;
|
||||
ProxyWindowBase* mProxyWindow = nullptr;
|
||||
PopupAnchorState state;
|
||||
Box mUserRect;
|
||||
Margins mMargins;
|
||||
std::optional<PopupAnchorState> lastState;
|
||||
|
||||
Q_OBJECT_BINDABLE_PROPERTY(PopupAnchor, ProxyWindowBase*, bProxyWindow);
|
||||
};
|
||||
|
||||
class PopupPositioner {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue