2019-11-19 00:52:47 +00:00
|
|
|
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
|
2021-09-05 13:36:38 +00:00
|
|
|
opacity: 0
|
2019-11-19 00:52:47 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: mouse
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
2021-09-05 13:36:38 +00:00
|
|
|
onEntered: {
|
|
|
|
parent.opacity = 1;
|
|
|
|
}
|
|
|
|
onExited: {
|
|
|
|
parent.opacity = 0;
|
|
|
|
}
|
|
|
|
onClicked: {
|
|
|
|
if (menuItem.enabled) {
|
|
|
|
menuItem.triggered();
|
|
|
|
parent.opacity = 0;
|
|
|
|
}
|
|
|
|
}
|
2019-11-19 00:52:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: RowLayout {
|
|
|
|
anchors.fill: parent
|
2021-09-05 13:36:38 +00:00
|
|
|
anchors.leftMargin: 20
|
2019-11-19 00:52:47 +00:00
|
|
|
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 {
|
2021-09-05 13:36:38 +00:00
|
|
|
color: MoneroComponents.Style.blackTheme ? MoneroComponents.Style.buttonTextColor : MoneroComponents.Style.defaultFontColor
|
2019-11-19 00:52:47 +00:00
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
|
|
|
font.pixelSize: 14
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: menuItem.text
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|