mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
feat(Menu/ActionMenu): supports many colors (hovered, normal, pressed), also fix escape event
This commit is contained in:
parent
9fca87d606
commit
14cac8ad29
4 changed files with 21 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue