diff options
Diffstat (limited to 'components/ContextMenuItem.qml')
| -rw-r--r-- | components/ContextMenuItem.qml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/components/ContextMenuItem.qml b/components/ContextMenuItem.qml new file mode 100644 index 00000000..de2d54ad --- /dev/null +++ b/components/ContextMenuItem.qml @@ -0,0 +1,52 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.1 + +import FontAwesome 1.0 +import "../components" as MoneroComponents + +MenuItem { + id: menuItem + + property bool glyphIconSolid: true + property alias glyphIcon: glyphIcon.text + + background: Rectangle { + color: MoneroComponents.Style.buttonBackgroundColorDisabledHover + opacity: mouse.containsMouse ? 1 : 0 + + MouseArea { + id: mouse + + anchors.fill: parent + hoverEnabled: true + onClicked: menuItem.triggered() + visible: menuItem.enabled + } + } + + contentItem: RowLayout { + anchors.fill: parent + anchors.leftMargin: 10 + anchors.rightMargin: 10 + opacity: menuItem.enabled ? 1 : 0.4 + spacing: 8 + + Text { + id: glyphIcon + + color: MoneroComponents.Style.buttonTextColor + font.family: glyphIconSolid ? FontAwesome.fontFamilySolid : FontAwesome.fontFamily + font.pixelSize: 14 + font.styleName: glyphIconSolid ? "Solid" : "Regular" + } + + Text { + color: MoneroComponents.Style.buttonTextColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 + Layout.fillWidth: true + text: menuItem.text + } + } +} |
