diff --git a/tests/languages/en.ts b/tests/languages/en.ts index 83091afc3..02b29d811 100644 --- a/tests/languages/en.ts +++ b/tests/languages/en.ts @@ -1,6 +1,17 @@ + + CallControls + + homeEntry + Home + + + contactsEntry + Contacts + + Calls diff --git a/tests/languages/fr.ts b/tests/languages/fr.ts index b92fed121..135e5d37d 100644 --- a/tests/languages/fr.ts +++ b/tests/languages/fr.ts @@ -1,6 +1,17 @@ + + CallControls + + homeEntry + Accueil + + + contactsEntry + Contacts + + Calls diff --git a/tests/ui/modules/Common/Menu.qml b/tests/ui/modules/Common/Menu.qml index 67ad4b722..4022f113f 100644 --- a/tests/ui/modules/Common/Menu.qml +++ b/tests/ui/modules/Common/Menu.qml @@ -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 diff --git a/tests/ui/modules/Linphone/Call/CallControls.qml b/tests/ui/modules/Linphone/Call/CallControls.qml index fbc876c2d..1e1c8bd63 100644 --- a/tests/ui/modules/Linphone/Call/CallControls.qml +++ b/tests/ui/modules/Linphone/Call/CallControls.qml @@ -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') + } + } } } }