diff --git a/examples/qml/FramelessWindow.qml b/examples/qml/FramelessWindow.qml index 7a669ea..592c90a 100644 --- a/examples/qml/FramelessWindow.qml +++ b/examples/qml/FramelessWindow.qml @@ -6,6 +6,7 @@ import QWindowKit 1.0 Window { property bool showWhenReady: true + property alias titleBar: titleBar id: window width: 800 diff --git a/examples/qml/main.qml b/examples/qml/main.qml index 7f203c4..41871fc 100644 --- a/examples/qml/main.qml +++ b/examples/qml/main.qml @@ -7,13 +7,36 @@ FramelessWindow { showWhenReady: false } - Button { + Drawer { + id: drawer + width: 0.66 * parent.width + height: parent.height + edge: Qt.RightEdge + onAboutToShow: titleBar.enabled = false + onAboutToHide: titleBar.enabled = true + + Label { + text: "Content goes here!" + anchors.centerIn: parent + } + } + + Row { anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom bottomMargin: 20 } - text: qsTr("Open Child Window") - onClicked: childWindow.visible = true + spacing: 10 + + Button { + text: qsTr("Open Child Window") + onClicked: childWindow.visible = true + } + + Button { + text: qsTr("Open Drawer") + onClicked: drawer.visible = true + } } -} \ No newline at end of file +} diff --git a/src/core/contexts/abstractwindowcontext.cpp b/src/core/contexts/abstractwindowcontext.cpp index f2fc730..324dd4e 100644 --- a/src/core/contexts/abstractwindowcontext.cpp +++ b/src/core/contexts/abstractwindowcontext.cpp @@ -88,7 +88,7 @@ namespace QWK { *button = WindowAgentBase::Unknown; for (int i = WindowAgentBase::WindowIcon; i <= WindowAgentBase::Close; ++i) { auto currentButton = m_systemButtons[i]; - if (!currentButton || !m_delegate->isVisible(currentButton)) { + if (!currentButton || !m_delegate->isVisible(currentButton) || !m_delegate->isEnabled(currentButton)) { continue; } if (m_delegate->mapGeometryToScene(currentButton).contains(pos)) {