Add focused window controls to top bar
Introduces a new `WindowControls` component in the desktop top bar with minimize, maximize/restore, and close actions for the focused window. `WindowService` now exposes focused-window presence/maximized state plus focused-window convenience actions to support this UI. Also extends Nebula UI with a reusable `NebulaToolTip`, keyboard/pressed-state support in `NebulaIconButton`, new window-control glyphs in `NebulaIcon`, and theme tokens for pressed/danger hover states, with CMake and README updates to register/document the new components.
This commit is contained in:
@@ -21,10 +21,12 @@ class WindowService : public QObject
|
||||
Q_PROPERTY(WindowModel *model READ model CONSTANT)
|
||||
Q_PROPERTY(WorkspaceModel *workspaceModel READ workspaceModel CONSTANT)
|
||||
Q_PROPERTY(int windowCount READ windowCount NOTIFY windowCountChanged)
|
||||
Q_PROPERTY(bool hasFocusedWindow READ hasFocusedWindow NOTIFY focusChanged)
|
||||
Q_PROPERTY(QString focusedWindowId READ focusedWindowId NOTIFY focusChanged)
|
||||
Q_PROPERTY(QString focusedWindowTitle READ focusedWindowTitle NOTIFY focusChanged)
|
||||
Q_PROPERTY(QString focusedApplicationId READ focusedApplicationId NOTIFY focusChanged)
|
||||
Q_PROPERTY(QString focusedApplicationName READ focusedApplicationName NOTIFY focusChanged)
|
||||
Q_PROPERTY(bool focusedWindowMaximized READ focusedWindowMaximized NOTIFY focusChanged)
|
||||
|
||||
public:
|
||||
enum SnapEdge {
|
||||
@@ -42,16 +44,21 @@ public:
|
||||
WorkspaceModel *workspaceModel() const;
|
||||
int windowCount() const;
|
||||
|
||||
bool hasFocusedWindow() const;
|
||||
QString focusedWindowId() const;
|
||||
QString focusedWindowTitle() const;
|
||||
QString focusedApplicationId() const;
|
||||
QString focusedApplicationName() const;
|
||||
bool focusedWindowMaximized() const;
|
||||
|
||||
Q_INVOKABLE bool focusWindow(const QString &windowId);
|
||||
Q_INVOKABLE bool closeWindow(const QString &windowId);
|
||||
Q_INVOKABLE bool maximizeWindow(const QString &windowId);
|
||||
Q_INVOKABLE bool restoreWindow(const QString &windowId);
|
||||
Q_INVOKABLE bool minimizeWindow(const QString &windowId);
|
||||
Q_INVOKABLE bool minimizeFocusedWindow();
|
||||
Q_INVOKABLE bool toggleMaximizeFocusedWindow();
|
||||
Q_INVOKABLE bool closeFocusedWindow();
|
||||
Q_INVOKABLE bool setWindowFloating(const QString &windowId, bool floating);
|
||||
Q_INVOKABLE bool moveWindow(const QString &windowId, int x, int y);
|
||||
Q_INVOKABLE bool resizeWindow(const QString &windowId, int width, int height);
|
||||
@@ -79,4 +86,5 @@ private:
|
||||
QString m_focusedWindowTitle;
|
||||
QString m_focusedApplicationId;
|
||||
QString m_focusedApplicationName;
|
||||
bool m_focusedWindowMaximized = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user