diff --git a/Motus/Choosebutton.qml b/Motus/Choosebutton.qml index bb95b7b4d05c821dbdfe1599da240aabdbde90eb..db666880cd38ec7d277ac76165c4426f5ae0fc2a 100644 --- a/Motus/Choosebutton.qml +++ b/Motus/Choosebutton.qml @@ -2,9 +2,9 @@ import QtQuick import QtQuick.Controls 2.15 Item { - property alias buttonText: button.text width: 300 height: 200 + property alias _textText: _text.text Rectangle { id: rectangle @@ -12,15 +12,23 @@ Item { y: 0 width: 300 height: 200 - color: "#ffffff" + color: "#323232" + radius: 10 + border.color: "#ffffff" + border.width: 5 - Button { - id: button - x: 2 + Text { + id: _text + x: 0 y: 0 - width: 298 + width: 300 height: 200 + color: "#ffffff" text: qsTr("Bouton") + font.pixelSize: 40 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.family: "Tahoma" } } diff --git a/Motus/Main.qml b/Motus/Main.qml index e5a1619814a30e569d10ff9b7a34ab19483b8868..280280873e7ca73b531f7a2b52cf28badf8ed229 100644 --- a/Motus/Main.qml +++ b/Motus/Main.qml @@ -23,7 +23,7 @@ Window { id: choosebutton x: 57 y: 102 - buttonText: "Générer un mot" + _textText: "Générer un mot" Case { @@ -45,6 +45,7 @@ Window { y: 0 width: 300 height: 200 + cursorShape: Qt.PointingHandCursor onClicked: { let mot = motusGame.getRandomWord(); console.log("Mot choisi :", mot); @@ -57,14 +58,49 @@ Window { MotusTimer { id: motusTimer - x: 498 - y: 42 + x: 693 + y: 59 } - NumberLetterButton { - id: numberLetterButton - x: 1165 - y: 299 + 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 + } + + 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" + } } diff --git a/Motus/MotusTimer.qml b/Motus/MotusTimer.qml index 0f159b61d697f566818a99b2f97bafe553602564..563a629d854e853c7c94ac729b8a26bae6a7156e 100644 --- a/Motus/MotusTimer.qml +++ b/Motus/MotusTimer.qml @@ -8,9 +8,13 @@ Item { id: rectangle width: 150 height: 75 + radius: 10 + border.color: "#ffffff" + border.width: 5 color: { - if (!motusGame) return "#6ceacb"; - return motusGame.remainingTime <= 20 ? "#e86161" : "#6ceacb"; // rouge si <= 20s + if (!motusGame) return "#7a7a7a"; + return motusGame.remainingTime <= 20 ? "#e86161" : "#7a7a7a"; // rouge si <= 20s + } Text { @@ -26,7 +30,8 @@ Item { font.pixelSize: 40 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - color: "black" + color: "#ffffff" + font.family: "Tahoma" } } } diff --git a/Motus/NumberLetterButton.qml b/Motus/NumberLetterButton.qml index 3387305a78abfd695d8f7900f2ae9434847183f4..47947b740f3c767e04ba295499cb71dfcd959fd7 100644 --- a/Motus/NumberLetterButton.qml +++ b/Motus/NumberLetterButton.qml @@ -1,41 +1,75 @@ import QtQuick import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 Item { - width: 100 - height: 50 - property alias comboBoxDisplayText: comboBox.displayText + width: 240 + height: 100 - Rectangle { - id: rectangle - x: 0 - y: 0 - width: 100 - height: 50 - color: "#fe8cf6" + ComboBox { + id: comboBox + anchors.centerIn: parent + width: 250 + height: 100 + model: ["Aléatoire / Random", "5", "6", "7", "8", "9", "10"] + flat: true - ComboBox { - id: comboBox - x: 0 - y: 0 - width: 100 - height: 50 - flat: true - editable: false - model: ["Aléatoire / Random","5","6","7","8","9","10"] - displayText: "Number of letters" + // Le contenu affiché (texte sélectionné) + contentItem: Text { + text: comboBox.displayText + font.pixelSize: 18 + font.bold: true + color: "white" + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + elide: Text.ElideRight + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 20 + } - onCurrentTextChanged: { - if (typeof motusGame !== "undefined") { - if (currentText === "aléatoire") { - motusGame.randomizeLetterNumber = true; - } else { - motusGame.randomizeLetterNumber = false; - motusGame.letterNumber = parseInt(currentText); - } - } - } - } + // Fond personnalisé + background: Rectangle { + radius: 10 + color: "#7a7a7a" + border.color: "white" + border.width: 5 + } -} + // Petite flèche personnalisée + indicator: Rectangle { + width: 20 + height: 20 + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: 10 + color: "transparent" + + // Triangle (flèche vers le bas) + Canvas { + anchors.fill: parent + onPaint: { + var ctx = getContext("2d"); + ctx.clearRect(0, 0, width, height); + ctx.beginPath(); + ctx.moveTo(4, 6); + ctx.lineTo(width - 4, 6); + ctx.lineTo(width / 2, height - 4); + ctx.closePath(); + ctx.fillStyle = "white"; + ctx.fill(); + } + } + } + + // Liste déroulante + delegate: ItemDelegate { + width: comboBox.width + contentItem: Text { + text: modelData + font.pixelSize: 16 + color: "black" + } + } + } }