diff options
| author | marcin <z.krzysztoff7@gmail.com> | 2014-07-07 19:08:30 +0200 |
|---|---|---|
| committer | marcin <z.krzysztoff7@gmail.com> | 2014-07-07 19:08:30 +0200 |
| commit | 62df25ce8e090f53aef822c2b22c754fd4fca3e1 (patch) | |
| tree | cf7af7fb5e3700dc26599f46aebf6676cb832a21 /components/MenuButton.qml | |
| download | monzero-gui-62df25ce8e090f53aef822c2b22c754fd4fca3e1.tar.gz monzero-gui-62df25ce8e090f53aef822c2b22c754fd4fca3e1.tar.xz monzero-gui-62df25ce8e090f53aef822c2b22c754fd4fca3e1.zip | |
first push
Diffstat (limited to 'components/MenuButton.qml')
| -rw-r--r-- | components/MenuButton.qml | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/components/MenuButton.qml b/components/MenuButton.qml new file mode 100644 index 00000000..59bd20c9 --- /dev/null +++ b/components/MenuButton.qml @@ -0,0 +1,75 @@ +import QtQuick 2.0 + +Rectangle { + id: button + property alias text: label.text + property bool checked: false + property alias dotColor: dot.color + property alias symbol: symbolText.text + signal clicked() + + height: 64 + color: checked ? "#FFFFFF" : "#1C1C1C" + + Item { + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.left: parent.left + width: 50 + + Rectangle { + id: dot + anchors.centerIn: parent + width: 16 + height: width + radius: height / 2 + + Rectangle { + anchors.centerIn: parent + width: 12 + height: width + radius: height / 2 + color: "#1C1C1C" + visible: !button.checked && !buttonArea.containsMouse + } + } + + Text { + id: symbolText + anchors.centerIn: parent + font.pixelSize: 11 + font.bold: true + color: button.checked || buttonArea.containsMouse ? "#FFFFFF" : dot.color + visible: appWindow.ctrlPressed + } + } + + Image { + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: 20 + source: "../images/menuIndicator.png" + } + + Text { + id: label + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 50 + font.family: "Arial" + font.pixelSize: 18 + color: parent.checked ? "#000000" : "#FFFFFF" + } + + MouseArea { + id: buttonArea + anchors.fill: parent + hoverEnabled: true + onClicked: { + if(parent.checked) + return + button.clicked() + parent.checked = true + } + } +} |
