feat(Popups): introduce `StatusMenuHeadline` component

This component can be used to group different sections within a popup menu.

Usage:

```qml
StatusPopupMenu {

    StatusMenuItem {
        text: "One"
        icon.name: "info"
    }

    StatusMenuHeadline {
        text: "Some text"
    }

    StatusMenuItem {
        text: "Two"
        icon.name: "info"
    }
}
```
This commit is contained in:
Pascal Precht 2021-07-21 15:06:37 +02:00 committed by Michał Cieślak
parent 55ff4a2362
commit f95e0c9499
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,24 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
MenuSeparator {
id: root
property string text
height: visible && enabled ? implicitHeight : 0
contentItem: Item {
implicitWidth: 176
implicitHeight: 16
StatusBaseText {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 12
color: Theme.palette.baseColor1
font.pixelSize: 12
text: root.text
}
}
}

View File

@ -3,5 +3,6 @@ module StatusQ.Popups
StatusMenuSeparator 0.1 StatusMenuSeparator.qml
StatusPopupMenu 0.1 StatusPopupMenu.qml
StatusMenuItem 0.1 StatusMenuItem.qml
StatusMenuHeadline 0.1 StatusMenuHeadline.qml
StatusModal 0.1 StatusModal.qml
StatusModalDivider 0.1 StatusModalDivider.qml

View File

@ -15,6 +15,7 @@
<file>src/StatusQ/Popups/qmldir</file>
<file>src/StatusQ/Popups/StatusPopupMenu.qml</file>
<file>src/StatusQ/Popups/StatusMenuSeparator.qml</file>
<file>src/StatusQ/Popups/StatusMenuHeadline.qml</file>
<file>src/StatusQ/Popups/StatusMenuItem.qml</file>
<file>src/StatusQ/Popups/StatusModalDivider.qml</file>
<file>src/StatusQ/Components/qmldir</file>