Commit 3566f3fd authored by Ronan Abhamon's avatar Ronan Abhamon

unstable

parent 33059cc2
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>CallControls</name>
<message>
<source>homeEntry</source>
<translation type="unfinished">Home</translation>
</message>
<message>
<source>contactsEntry</source>
<translation type="unfinished">Contacts</translation>
</message>
</context>
<context>
<name>Calls</name>
<message>
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>CallControls</name>
<message>
<source>homeEntry</source>
<translation type="unfinished">Accueil</translation>
</message>
<message>
<source>contactsEntry</source>
<translation type="unfinished">Contacts</translation>
</message>
</context>
<context>
<name>Calls</name>
<message>
......
......@@ -14,6 +14,8 @@ ColumnLayout {
property int entryWidth
property var entries
property int fontSize: MenuStyle.entry.text.fontSize
property int _selectedEntry: 0
signal entrySelected (int entry)
......@@ -48,15 +50,23 @@ ColumnLayout {
spacing: MenuStyle.entry.spacing
Icon {
Layout.preferredHeight: MenuStyle.entry.iconSize
Layout.preferredWidth: MenuStyle.entry.iconSize
icon: modelData.icon
Layout.preferredHeight: modelData.icon
? (modelData.iconSize != null
? modelData.iconSize
: MenuStyle.entry.iconSize
) : 0
Layout.preferredWidth: modelData.icon
? (modelData.iconSize != null
? modelData.iconSize
: MenuStyle.entry.iconSize
) : 0
icon: modelData.icon || ''
}
Text {
Layout.fillWidth: true
color: MenuStyle.entry.text.color
font.pointSize: MenuStyle.entry.text.fontSize
font.pointSize: menu.fontSize
height: parent.height
text: modelData.entryName
verticalAlignment: Text.AlignVCenter
......
......@@ -53,15 +53,32 @@ RowLayout {
id: menu
entryHeight: 22
height: 100
implicitHeight: toto.height
launcher: button
relativeTo: button
relativeX: button.width + 1
width: 120
Rectangle {
color: 'red'
anchors.fill: parent
Menu {
id: toto
entryHeight: 22
entryWidth: 98
fontSize: 11
entries: [{
entryName: qsTr('homeEntry')
}, {
entryName: qsTr('contactsEntry')
}]
onEntrySelected: {
console.log('entry', entry)
if (entry === 0) {
setView('Home')
} else if (entry === 1) {
setView('Contacts')
}
}
}
}
}
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