2020-07-21 21:03:22 +00:00
|
|
|
import QtQuick 2.13
|
2021-01-22 08:28:04 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2020-07-21 21:03:22 +00:00
|
|
|
import "../../../../../imports"
|
|
|
|
import "../../../../../shared"
|
2020-10-26 20:20:31 +00:00
|
|
|
import "../constants.js" as ProfileConstants
|
2020-07-21 21:03:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
2020-10-26 20:20:31 +00:00
|
|
|
property int menuItemId: -1
|
2020-07-21 21:03:22 +00:00
|
|
|
property bool hovered: false
|
|
|
|
property bool active: false
|
2021-05-28 17:35:21 +00:00
|
|
|
property url source: "../../../../img/eye.svg"
|
2020-07-21 21:03:22 +00:00
|
|
|
property string text: "My Profile"
|
|
|
|
property var onClicked: function () {}
|
|
|
|
|
|
|
|
id: menuButton
|
2021-01-22 10:21:24 +00:00
|
|
|
color: {
|
|
|
|
if (active) {
|
2021-03-26 17:57:30 +00:00
|
|
|
return Style.current.menuBackgroundActive
|
2021-01-22 10:21:24 +00:00
|
|
|
}
|
|
|
|
if (hovered) {
|
2021-03-26 17:57:30 +00:00
|
|
|
return Style.current.menuBackgroundHover
|
2021-01-22 10:21:24 +00:00
|
|
|
}
|
|
|
|
return Style.current.transparent
|
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
border.width: 0
|
|
|
|
height: 48
|
|
|
|
width: parent.width
|
|
|
|
radius: Style.current.radius
|
|
|
|
|
2021-03-05 14:50:19 +00:00
|
|
|
SVGImage {
|
2020-07-21 21:03:22 +00:00
|
|
|
id: iconImage
|
2020-08-28 19:09:00 +00:00
|
|
|
height: 24
|
|
|
|
width: 24
|
2020-07-21 21:03:22 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-01-22 16:05:22 +00:00
|
|
|
source: menuButton.source
|
2021-04-13 10:23:00 +00:00
|
|
|
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: parent
|
|
|
|
source: parent
|
|
|
|
color: Style.current.blue
|
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
text: menuButton.text
|
|
|
|
anchors.left: iconImage.right
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
}
|
|
|
|
|
2020-10-26 20:20:31 +00:00
|
|
|
Rectangle {
|
2020-12-06 22:15:51 +00:00
|
|
|
visible: !profileModel.mnemonic.isBackedUp && !active && ProfileConstants.PRIVACY_AND_SECURITY === menuItemId
|
2020-10-26 20:20:31 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.right: menuButton.right
|
|
|
|
anchors.rightMargin: 10
|
|
|
|
radius: 9
|
|
|
|
color: Style.current.blue
|
|
|
|
width: 18
|
|
|
|
height: 18
|
|
|
|
Text {
|
|
|
|
font.pixelSize: 12
|
|
|
|
color: Style.current.white
|
|
|
|
anchors.centerIn: parent
|
|
|
|
text: "1"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-21 21:03:22 +00:00
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: {
|
|
|
|
menuButton.hovered = true
|
|
|
|
}
|
|
|
|
onExited: {
|
|
|
|
menuButton.hovered = false
|
|
|
|
}
|
|
|
|
onClicked: function () {
|
|
|
|
menuButton.onClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorColor:"#ffffff";height:48;width:300}
|
|
|
|
}
|
|
|
|
##^##*/
|