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

unstable

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