From da969b708d578185566f9923f00ddb2ba50d5aac Mon Sep 17 00:00:00 2001 From: amassies <alexandre.massies@etu.ec-lyon.fr> Date: Thu, 27 Mar 2025 18:16:54 +0100 Subject: [PATCH] =?UTF-8?q?cases=20dessin=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Motus/BackKey.qml | 15 +- Motus/Case.qml | 43 +- Motus/Main.qml | 1019 ++++++++++++++++++++++++++------------------- 3 files changed, 623 insertions(+), 454 deletions(-) diff --git a/Motus/BackKey.qml b/Motus/BackKey.qml index c9e0784..9a89e8a 100644 --- a/Motus/BackKey.qml +++ b/Motus/BackKey.qml @@ -2,22 +2,25 @@ import QtQuick Item { id: _item - width: 100 + width: 90 height: 60 property alias imageSource: image.source Rectangle { id: rectangle color: "#7a7a7a" - radius: 15 + radius: 10 anchors.fill: parent Image { id: image - x: 0 - y: 0 - width: 100 - height: 60 + width: 75 + height: 45 + anchors.verticalCenter: parent.verticalCenter source: "back_key.png" + anchors.horizontalCenter: parent.horizontalCenter + sourceSize.height: 512 + sourceSize.width: 512 + clip: false fillMode: Image.PreserveAspectFit } } diff --git a/Motus/Case.qml b/Motus/Case.qml index 9508114..71ddcba 100644 --- a/Motus/Case.qml +++ b/Motus/Case.qml @@ -1,22 +1,39 @@ import QtQuick Item { - width: 90 - height: 90 - property alias _textColor: _text.color + id: _item + width: 70 + height: 70 + focus: false + property alias rectangleBorderwidth: rectangle.border.width property alias _textText: _text.text + Rectangle { + id: rectangle + width: 70 + height: 70 + color: "#323232" + radius: 5 + border.color: "#ffffff" + border.width: 3 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter - Text { - id: _text - x: 0 - y: 0 - width: 90 - height: 90 - text: qsTr("Text") - font.pixelSize: 24 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + Text { + id: _text + width: 70 + height: 70 + color: "#ffffff" + text: qsTr("") + anchors.verticalCenter: parent.verticalCenter + font.pixelSize: 60 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.family: "Tahoma" + font.styleName: "Bold" + anchors.horizontalCenter: parent.horizontalCenter + } } + } diff --git a/Motus/Main.qml b/Motus/Main.qml index 2802808..9017f8f 100644 --- a/Motus/Main.qml +++ b/Motus/Main.qml @@ -16,495 +16,644 @@ Window { color: "#323232" focus: true + Grid { + id: grid + y: 206 + width: 370 + height: 445 + anchors.horizontalCenter: parent.horizontalCenter + spacing: 5 + rows: 6 + columns: 5 - } + Case { + id: _case_1_1 + focus: true + } + + Case { + id: _case_1_2 + } + + Case { + id: _case_1_3 + } + + Case { + id: _case_1_4 + } + + Case { + id: _case_1_5 + } + + Case { + id: _case_2_1 + } + + Case { + id: _case_2_2 + } + + Case { + id: _case_2_3 + } + + Case { + id: _case_2_4 + } + + Case { + id: _case_2_5 + } + + Case { + id: _case_3_1 + } + + Case { + id: _case_3_2 + } + + Case { + id: _case_3_3 + } + + Case { + id: _case_3_4 + } + + Case { + id: _case_3_5 + } + + Case { + id: _case_4_1 + } + + Case { + id: _case_4_2 + } + + Case { + id: _case_4_3 + } + + Case { + id: _case_4_4 + } + + Case { + id: _case_4_5 + } + + Case { + id: _case_5_1 + } + + Case { + id: _case_5_2 + } + + Case { + id: _case_5_3 + } + + Case { + id: _case_5_4 + } + + Case { + id: _case_5_5 + } + + Case { + id: _case_6_1 + } + + Case { + id: _case_6_2 + } - Choosebutton { - id: choosebutton - x: 57 - y: 102 - _textText: "Générer un mot" + Case { + id: _case_6_3 + } + Case { + id: _case_6_4 + } Case { - id: case3 - _textText: "mot test" + id: _case_6_5 } + } + + Text { + id: _text2 + y: 20 + width: 200 + height: 80 + color: "#ffffff" + text: qsTr("MOTUS") + font.pixelSize: 50 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + anchors.horizontalCenterOffset: 0 + font.family: "Tahoma" + font.styleName: "Bold" + anchors.horizontalCenter: parent.horizontalCenter + } + + + } + + Choosebutton { + id: choosebutton + x: 57 + y: 102 + _textText: "Générer un mot" + + + Case { + id: case3 + _textText: "mot test" + } - Keys.onPressed: (event) => { - if (event.key === Qt.Key_A) { - case1._textText = qsTr("C"); - console.log(event.key + " /// " + event.text); - event.accepted = true; - } + Keys.onPressed: (event) => { + if (event.key === Qt.Key_A) { + case1._textText = qsTr("C"); + console.log(event.key + " /// " + event.text); + event.accepted = true; } - MouseArea { - id: mouseArea1 - x: 0 - y: 0 - width: 300 - height: 200 - cursorShape: Qt.PointingHandCursor - onClicked: { - let mot = motusGame.getRandomWord(); - console.log("Mot choisi :", mot); - motusGame.startTimer(); // 🕒 démarre le chrono - case3._textText = mot; - onClicked: case3._textColor="#51c3e1"; - } + } + MouseArea { + id: mouseArea1 + x: 0 + y: 0 + width: 300 + height: 200 + cursorShape: Qt.PointingHandCursor + onClicked: { + let mot = motusGame.getRandomWord(); + console.log("Mot choisi :", mot); + motusGame.startTimer(); // 🕒 démarre le chrono + case3._textText = mot; + onClicked: case3._textColor="#51c3e1"; } } + } + + MotusTimer { + id: motusTimer + x: 1539 + y: 926 + } - MotusTimer { - id: motusTimer - x: 693 - y: 59 + Rectangle { + id: rectangle_combobox + x: 224 + y: 131 + width: 250 + height: 180 + color: "#323232" + radius: 10 + border.color: "#ffffff" + border.width: 5 + anchors.horizontalCenterOffset: 577 + anchors.horizontalCenter: parent.horizontalCenter + + + NumberLetterButton + { + id: numberLetterButton + x: -8 + y: 80 + width: 250 + height: 100 + + anchors.horizontalCenterOffset: 0 + anchors.horizontalCenter: parent.horizontalCenter } - Rectangle { - id: rectangle_combobox - x: 224 - y: 131 + Text { + id: _text1 + x: 0 + y: 0 width: 250 - height: 180 + height: 84 + color: "#ffffff" + text: qsTr("Nombre de lettres / \n Number of letters") + font.pixelSize: 23 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.family: "Tahoma" + } + + } + + Rectangle{ + + id: big_rectangle_langue + x: 64 + y: 362 + width: 270 + height: 340 + color: "#323232" + radius: 10 + border.color: "#ffffff" + border.width: 5 + + Rectangle { + id: rectangle_langue + x: 100 + y: 60 + width: 270 + height: 280 color: "#323232" radius: 10 border.color: "#ffffff" border.width: 5 - anchors.horizontalCenterOffset: 577 + anchors.horizontalCenterOffset: 0 anchors.horizontalCenter: parent.horizontalCenter + LangageButton { + id: langageButton + x: 33 + y: 31 + _textText: "Français" + + MouseArea { + id: mouseArea2 + x: 0 + y: 0 + width: 200 + height: 100 + cursorShape: Qt.PointingHandCursor + onClicked: motusGame.dictionnaryChoosed="Motus\\mots_francais.txt" + + } - NumberLetterButton - { - id: numberLetterButton - x: -8 - y: 80 - width: 250 - height: 100 - anchors.horizontalCenterOffset: 0 - anchors.horizontalCenter: parent.horizontalCenter } - Text { - id: _text1 - x: 0 - y: 0 - width: 250 - height: 84 - color: "#ffffff" - text: qsTr("Nombre de lettres / \n Number of letters") - font.pixelSize: 23 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - font.family: "Tahoma" + LangageButton { + id: langageButton1 + x: 33 + y: 152 + _textText: "English" + + MouseArea { + id: mouseArea3 + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: motusGame.dictionnaryChoosed="Motus\\words_alpha.txt" + + } + } + } + Text { + id: _text + x: 0 + y: 0 + width: 270 + height: 63 + color: "#ffffff" + text: qsTr("Language/Langage") + font.pixelSize: 30 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.family: "Tahoma" } - Rectangle { - id: rectangle1 - x: 342 - y: 477 - width: 640 - height: 280 - color: "#323232" - radius: 10 - border.color: "#ffffff" - border.width: 5 - anchors.horizontalCenterOffset: -27 + + } + + Rectangle { + id: rectangle1 + x: 342 + y: 762 + width: 640 + height: 280 + color: "#323232" + radius: 10 + border.color: "#ffffff" + border.width: 5 + anchors.horizontalCenterOffset: 0 + anchors.horizontalCenter: parent.horizontalCenter + + Column { + id: column + width: (10 * 50) + (9 * 5) + spacing: 5 + height: 2*spacing + 80*3 + anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - Column { - id: column - width: (10 * 50) + (9 * 5) - spacing: 5 - height: 2*spacing + 80*3 - anchors.verticalCenter: parent.verticalCenter + Row { + id: row1 + height: 80 anchors.horizontalCenter: parent.horizontalCenter + spacing: 5 + width: (10 * 50) + (9 * spacing) + + Key { + id: key + x: 0 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + scale: 0.8 + } - Row { - id: row1 - height: 80 - anchors.horizontalCenter: parent.horizontalCenter - spacing: 5 - width: (10 * 50) + (9 * spacing) - - Key { - id: key - x: 0 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - scale: 0.8 - } - - Key { - id: key1 - x: 70 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "Z" - scale: 0.8 - } - - Key { - id: key2 - x: 140 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "E" - antialiasing: true - scale: 0.8 - } - - Key { - id: key3 - x: 210 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "R" - scale: 0.8 - } - - Key { - id: key4 - x: 280 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "T" - scale: 0.8 - } - - Key { - id: key5 - x: 350 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "Y" - scale: 0.8 - } - - Key { - id: key6 - x: 420 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "U" - scale: 0.8 - } - - Key { - id: key7 - x: 490 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "I" - scale: 0.8 - } - - Key { - id: key8 - x: 560 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "O" - scale: 0.8 - } - - Key { - id: key9 - x: 630 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "P" - scale: 0.8 - } + Key { + id: key1 + x: 70 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "Z" + scale: 0.8 } - Row { - id: row2 - width: (9 * 50) + (8 * spacing) - height: 80 - anchors.horizontalCenter: parent.horizontalCenter - spacing: 5 - - Key { - id: key12 - x: 140 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "Q" - scale: 0.8 - } - - Key { - id: key13 - x: 210 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "S" - scale: 0.8 - } - - Key { - id: key14 - x: 280 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "D" - scale: 0.8 - } - - Key { - id: key15 - x: 350 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "F" - scale: 0.8 - } - - Key { - id: key16 - x: 420 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "G" - scale: 0.8 - } - - Key { - id: key17 - x: 490 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "H" - scale: 0.8 - } - - Key { - id: key18 - x: 560 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "J" - scale: 0.8 - } - - Key { - id: key19 - x: 630 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "K" - scale: 0.8 - } - - Key { - id: key20 - x: 630 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "L" - scale: 0.8 - } + Key { + id: key2 + x: 140 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "E" + antialiasing: true + scale: 0.8 } - Row { - id: row3 - width: (7 * 50) + (10 * spacing) + (100 * 2) - height: 80 - anchors.horizontalCenter: parent.horizontalCenter - spacing: 5 - - Key { - id: key23 - x: 140 - width: 100 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelFontstyleName: "Bold" - labelFontpixelSize: 25 - labelText: "Entrée" - scale: 0.8 - } - - Key { - id: key24 - x: 210 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: 'W' - scale: 0.8 - } - - Key { - id: key25 - x: 280 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "X" - scale: 0.8 - } - - Key { - id: key26 - x: 350 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "C" - scale: 0.8 - } - - Key { - id: key27 - x: 420 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "V" - scale: 0.8 - } - - Key { - id: key28 - x: 490 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - labelText: "B" - scale: 0.8 - } - - Key { - id: key29 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - scale: 0.8 - labelText: "N" - } - - Key { - id: key30 - width: 50 - height: 70 - anchors.verticalCenter: parent.verticalCenter - scale: 0.8 - labelText: "M" - } - - BackKey { - id: backKey - anchors.verticalCenter: parent.verticalCenter - - } + Key { + id: key3 + x: 210 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "R" + scale: 0.8 + } + + Key { + id: key4 + x: 280 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "T" + scale: 0.8 + } + + Key { + id: key5 + x: 350 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "Y" + scale: 0.8 + } + + Key { + id: key6 + x: 420 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "U" + scale: 0.8 + } + + Key { + id: key7 + x: 490 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "I" + scale: 0.8 + } + + Key { + id: key8 + x: 560 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "O" + scale: 0.8 + } + + Key { + id: key9 + x: 630 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "P" + scale: 0.8 } } + Row { + id: row2 + width: (9 * 50) + (8 * spacing) + height: 80 + anchors.horizontalCenter: parent.horizontalCenter + spacing: 5 - Rectangle{ - - id: big_rectangle_langue - x: -360 - y: -107 - width: 270 - height: 340 - color: "#323232" - radius: 10 - border.color: "#ffffff" - border.width: 5 - - Rectangle { - id: rectangle_langue - x: 100 - y: 60 - width: 270 - height: 280 - color: "#323232" - radius: 10 - border.color: "#ffffff" - border.width: 5 - anchors.horizontalCenterOffset: 0 - anchors.horizontalCenter: parent.horizontalCenter - - LangageButton { - id: langageButton - x: 33 - y: 31 - _textText: "Français" - - MouseArea { - id: mouseArea2 - x: 0 - y: 0 - width: 200 - height: 100 - cursorShape: Qt.PointingHandCursor - onClicked: motusGame.dictionnaryChoosed="Motus\\mots_francais.txt" + Key { + id: key12 + x: 140 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "Q" + scale: 0.8 + } - } + Key { + id: key13 + x: 210 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "S" + scale: 0.8 + } + Key { + id: key14 + x: 280 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "D" + scale: 0.8 + } - } + Key { + id: key15 + x: 350 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "F" + scale: 0.8 + } - LangageButton { - id: langageButton1 - x: 33 - y: 152 - _textText: "English" + Key { + id: key16 + x: 420 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "G" + scale: 0.8 + } - MouseArea { - id: mouseArea3 - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onClicked: motusGame.dictionnaryChoosed="Motus\\words_alpha.txt" + Key { + id: key17 + x: 490 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "H" + scale: 0.8 + } - } + Key { + id: key18 + x: 560 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "J" + scale: 0.8 + } - } + Key { + id: key19 + x: 630 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "K" + scale: 0.8 } - Text { - id: _text - x: 0 - y: 0 - width: 270 - height: 63 - color: "#ffffff" - text: qsTr("Language/Langage") - font.pixelSize: 30 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - font.family: "Tahoma" + Key { + id: key20 + x: 630 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "L" + scale: 0.8 + } + } + + Row { + id: row3 + width: (7 * 50) + (10 * spacing) + (100 * 2) + height: 80 + anchors.horizontalCenter: parent.horizontalCenter + spacing: 5 + + Key { + id: key23 + x: 140 + width: 100 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelFontstyleName: "Bold" + labelFontpixelSize: 25 + labelText: "Entrée" + scale: 0.8 + } + + Key { + id: key24 + x: 210 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: 'W' + scale: 0.8 + } + + Key { + id: key25 + x: 280 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "X" + scale: 0.8 + } + + Key { + id: key26 + x: 350 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "C" + scale: 0.8 + } + + Key { + id: key27 + x: 420 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "V" + scale: 0.8 + } + + Key { + id: key28 + x: 490 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + labelText: "B" + scale: 0.8 + } + + Key { + id: key29 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + scale: 0.8 + labelText: "N" + } + + Key { + id: key30 + width: 50 + height: 70 + anchors.verticalCenter: parent.verticalCenter + scale: 0.8 + labelText: "M" } + BackKey { + id: backKey + anchors.verticalCenter: parent.verticalCenter + } } } + } +} + -- GitLab