core/window: add title property to floating windows

This commit is contained in:
outfoxxed 2025-06-15 03:12:51 -07:00
parent 20322484b9
commit d9164578a2
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
2 changed files with 20 additions and 0 deletions

View file

@ -24,12 +24,21 @@ public:
signals:
void minimumSizeChanged();
void maximumSizeChanged();
void titleChanged();
private:
void onMinimumSizeChanged();
void onMaximumSizeChanged();
void onTitleChanged();
public:
Q_OBJECT_BINDABLE_PROPERTY(
ProxyFloatingWindow,
QString,
bTitle,
&ProxyFloatingWindow::onTitleChanged
);
Q_OBJECT_BINDABLE_PROPERTY(
ProxyFloatingWindow,
QSize,
@ -49,6 +58,8 @@ public:
class FloatingWindowInterface: public WindowInterface {
Q_OBJECT;
// clang-format off
/// Window title.
Q_PROPERTY(QString title READ default WRITE default NOTIFY titleChanged BINDABLE bindableTitle);
/// Minimum window size given to the window system.
Q_PROPERTY(QSize minimumSize READ default WRITE default NOTIFY minimumSizeChanged BINDABLE bindableMinimumSize);
/// Maximum window size given to the window system.
@ -100,10 +111,12 @@ public:
QBindable<QSize> bindableMinimumSize() { return &this->window->bMinimumSize; }
QBindable<QSize> bindableMaximumSize() { return &this->window->bMaximumSize; }
QBindable<QString> bindableTitle() { return &this->window->bTitle; }
signals:
void minimumSizeChanged();
void maximumSizeChanged();
void titleChanged();
private:
ProxyFloatingWindow* window;