diff --git a/tabbox/clientmodel.cpp b/tabbox/clientmodel.cpp index eea8c91726..361d3d20ff 100644 --- a/tabbox/clientmodel.cpp +++ b/tabbox/clientmodel.cpp @@ -43,6 +43,7 @@ ClientModel::ClientModel(QObject* parent) roles[DesktopNameRole] = "desktopName"; roles[MinimizedRole] = "minimized"; roles[WIdRole] = "windowId"; + roles[CloseableRole] = "closeable"; setRoleNames(roles); } @@ -80,6 +81,8 @@ QVariant ClientModel::data(const QModelIndex& index, int role) const return qulonglong(m_clientList[ clientIndex ]->window()); case MinimizedRole: return m_clientList[ clientIndex ]->isMinimized(); + case CloseableRole: + return m_clientList[ clientIndex ]->isCloseable(); default: return QVariant(); } diff --git a/tabbox/clientmodel.h b/tabbox/clientmodel.h index acf81dd0ea..fb53ae371e 100644 --- a/tabbox/clientmodel.h +++ b/tabbox/clientmodel.h @@ -54,7 +54,8 @@ public: IconRole = Qt::UserRole + 3, // TODO: to be removed EmptyRole = Qt::UserRole + 4, ///< Indicates if the model contains TabBoxClients WIdRole = Qt::UserRole + 5, ///< The window ID of TabBoxClient - MinimizedRole = Qt::UserRole + 6 ///< TabBoxClient is minimized + MinimizedRole = Qt::UserRole + 6, ///< TabBoxClient is minimized + CloseableRole = Qt::UserRole + 7 ///< TabBoxClient can be closed }; ClientModel(QObject* parent = 0); ~ClientModel(); diff --git a/tabbox/qml/window_strip.qml b/tabbox/qml/window_strip.qml index 9cc868f592..8abe7609ab 100644 --- a/tabbox/qml/window_strip.qml +++ b/tabbox/qml/window_strip.qml @@ -105,7 +105,7 @@ Item { prefix: "shadow" width: closeButton.width + margins.left + margins.right height: closeButton.height + margins.top + margins.bottom - visible: true//model["actionClose"] && (model["className"] != shellName) + visible: closeable anchors { top: parent.top right: parent.right diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp index 9cc7935875..09e98b3a97 100644 --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -270,6 +270,11 @@ int TabBoxClientImpl::height() const return m_client->height(); } +bool TabBoxClientImpl::isCloseable() const +{ + return m_client->isCloseable(); +} + /********************************************************* * TabBox diff --git a/tabbox/tabbox.h b/tabbox/tabbox.h index 6ab07d69d3..27e3d908dd 100644 --- a/tabbox/tabbox.h +++ b/tabbox/tabbox.h @@ -80,6 +80,7 @@ public: virtual int y() const; virtual int width() const; virtual int height() const; + virtual bool isCloseable() const; Client* client() const { return m_client; diff --git a/tabbox/tabboxhandler.h b/tabbox/tabboxhandler.h index bf9fecdee9..ed4bb9a366 100644 --- a/tabbox/tabboxhandler.h +++ b/tabbox/tabboxhandler.h @@ -384,6 +384,7 @@ public: virtual int y() const = 0; virtual int width() const = 0; virtual int height() const = 0; + virtual bool isCloseable() const = 0; }; /**