Commit 14cac8ad authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Menu/ActionMenu): supports many colors (hovered, normal, pressed), also fix `escape` event

parent 9fca87d6
......@@ -29,4 +29,8 @@ QtObject {
property color q: '#E6E6E6'
property color r: '#8F8F8F'
property color s: '#D64D00'
property color t: '#FF8600'
}
......@@ -22,7 +22,12 @@ ColumnLayout {
model: entries
Rectangle {
color: ActionMenuStyle.entry.color
color: mouseArea.pressed
? ActionMenuStyle.entry.color.pressed
: (mouseArea.containsMouse
? ActionMenuStyle.entry.color.hovered
: ActionMenuStyle.entry.color.normal
)
height: menu.entryHeight
width: menu.entryWidth
......@@ -43,6 +48,8 @@ ColumnLayout {
}
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
......
......@@ -42,6 +42,9 @@ Item {
visible = true
menuOpened()
// Necessary to use `Keys.onEscapePressed`.
focus = true
}
function hideMenu () {
......
......@@ -9,10 +9,15 @@ QtObject {
property int spacing: 1
property QtObject entry: QtObject {
property color color: Colors.i
property int leftMargin: 4
property int rightMargin: 4
property QtObject color: QtObject {
property color hovered: Colors.s
property color normal: Colors.i
property color pressed: Colors.t
}
property QtObject text: QtObject {
property color color: Colors.k
property int fontSize: 8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment