From dddb3ba8cae93e7cdbce12467b6f72a37d809fa8 Mon Sep 17 00:00:00 2001 From: Yanis Dziki <yanis.dziki@ens-lyon.fr> Date: Mon, 31 Mar 2025 11:40:21 +0200 Subject: [PATCH] Ajout menu --- motus/Main.qml | 22 ++++++++++++++++++++++ motus/MenuDeroulant.qml | 10 +++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/motus/Main.qml b/motus/Main.qml index 4a50211..ceab2ec 100644 --- a/motus/Main.qml +++ b/motus/Main.qml @@ -4,12 +4,33 @@ Window { width: 900 height: 800 visible: true + color: "#8ff0a4" title: qsTr("Hello World") + + Rectangle { + id: rectangle + x: 286 + y: 86 + width: 328 + height: 58 + color: "#26a269" + + Text { + id: _text + x: 121 + y: 12 + color: "#f1e6e6" + text: qsTr("Motus") + font.pixelSize: 30 + } + } + MenuDeroulant { id: menuDeroulant x: 38 y: 301 + rectangleColor: "#b33939" } Bouton { @@ -26,4 +47,5 @@ Window { anchors.centerIn: parent } + } diff --git a/motus/MenuDeroulant.qml b/motus/MenuDeroulant.qml index 43688b5..bf1e19f 100644 --- a/motus/MenuDeroulant.qml +++ b/motus/MenuDeroulant.qml @@ -5,7 +5,8 @@ Item { id: _item property alias _textText: _text.text width: 400 - height: expanded ? 250 : 50 // Ajuste la hauteur dynamiquement + height: 25 + property alias rectangleColor: rectangle.color // Ajuste la hauteur dynamiquement property bool expanded: false // Gère l'affichage des options ListModel { @@ -15,7 +16,7 @@ Item { Rectangle { id: rectangle width: 400 - height: 50 + height: 25 color: "#ffffff" Text { @@ -29,8 +30,10 @@ Item { Image { id: image + x: 331 + y: 0 width: 69 - height: 50 + height: 92 anchors.right: parent.right anchors.rightMargin: 0 source: "qrc:/qtquickplugin/images/template_image.png" @@ -38,6 +41,7 @@ Item { MouseArea { anchors.fill: parent + anchors.bottomMargin: 25 onClicked: { expanded = !expanded // Basculer l'affichage console.log("Click sur image") -- GitLab