Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Momomotus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pouchet Pierre
Momomotus
Commits
ef818c92
Commit
ef818c92
authored
2 months ago
by
Pouchet Pierre
Browse files
Options
Downloads
Patches
Plain Diff
distances relatives (début)
parent
da969b70
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Motus/Main.qml
+148
-603
148 additions, 603 deletions
Motus/Main.qml
with
148 additions
and
603 deletions
Motus/Main.qml
+
148
−
603
View file @
ef818c92
...
...
@@ -5,655 +5,200 @@ Window {
height
:
Screen
.
height
visible
:
true
visibility
:
Window
.
Maximized
title
:
qsTr
(
"
Hello World
"
)
title
:
qsTr
(
"
Motus
"
)
Rectangle
{
id
:
rectangle
x
:
0
y
:
0
width
:
Screen
.
width
height
:
Screen
.
height
anchors.fill
:
parent
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
}
Case
{
id
:
_case_6_3
}
Case
{
id
:
_case_6_4
}
Case
{
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
}
}
// Bouton "Générer un mot"
Choosebutton
{
id
:
choosebutton
x
:
57
y
:
102
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.topMargin
:
height
*
0.03
anchors.leftMargin
:
width
*
0.03
_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
;
}
}
MouseArea
{
id
:
mouseArea1
x
:
0
y
:
0
width
:
300
height
:
200
anchors.fill
:
parent
cursorShape
:
Qt
.
PointingHandCursor
onClicked
:
{
let
mot
=
motusGame
.
getRandomWord
();
console
.
log
(
"
Mot choisi :
"
,
mot
);
motusGame
.
startTimer
();
// 🕒 démarre le chrono
motusGame
.
startTimer
();
case3
.
_textText
=
mot
;
onClicked
:
case3
.
_textColor
=
"
#51c3e1
"
;
}
}
}
MotusTimer
{
id
:
motusTimer
x
:
1539
y
:
926
}
// Choix du nombre de lettres (en haut à droite)
Rectangle
{
id
:
rectangle_combobox
x
:
224
y
:
131
width
:
250
height
:
180
width
:
parent
.
width
*
0.15
height
:
parent
.
height
*
0.15
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
anchors.topMargin
:
height
*
0.03
anchors.rightMargin
:
width
*
0.03
color
:
"
#323232
"
radius
:
10
border.color
:
"
#ffffff
"
border.width
:
5
anchors.horizontalCenterOffset
:
577
anchors.horizontalCenter
:
parent
.
horizontalCenter
border.width
:
3
NumberLetterButton
{
id
:
numberLetterButton
x
:
-
8
y
:
80
width
:
250
height
:
100
anchors.horizontalCenterOffset
:
0
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
Column
{
anchors.fill
:
parent
anchors.margins
:
10
spacing
:
10
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
font.pixelSize
:
18
color
:
"
white
"
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
font.family
:
"
Tahoma
"
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
NumberLetterButton
{
width
:
parent
.
width
*
0.9
height
:
parent
.
height
*
0.5
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
}
// Fenêtre pour les langages (en dessous du bouton générer)
Rectangle
{
id
:
big_rectangle_langue
x
:
64
y
:
362
width
:
270
height
:
340
width
:
parent
.
width
*
0.15
height
:
parent
.
height
*
0.25
anchors.top
:
choosebutton
.
bottom
anchors.left
:
choosebutton
.
left
anchors.topMargin
:
height
*
0.03
color
:
"
#323232
"
radius
:
10
border.color
:
"
#ffffff
"
border.width
:
5
border.width
:
3
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
Column
{
anchors.fill
:
parent
anchors.margins
:
10
spacing
:
10
Text
{
text
:
qsTr
(
"
Language/Langage
"
)
font.pixelSize
:
20
color
:
"
white
"
horizontalAlignment
:
Text
.
AlignHCenter
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
anchors.fill
:
parent
cursorShape
:
Qt
.
PointingHandCursor
onClicked
:
motusGame
.
dictionnaryChoosed
=
"
Motus
\\
mots_francais.txt
"
}
}
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
"
}
}
}
}
// Texte MOTUS
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
id
:
_text2
text
:
qsTr
(
"
MOTUS
"
)
font.pixelSize
:
50
color
:
"
white
"
font.family
:
"
Tahoma
"
font.bold
:
true
horizontalAlignment
:
Text
.
AlignHCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.top
:
parent
.
top
anchors.topMargin
:
height
*
0.2
}
// Grille de jeu juste en dessous de MOTUS
Grid
{
id
:
grid
anchors.top
:
_text2
.
bottom
anchors.topMargin
:
height
*
0.02
anchors.horizontalCenter
:
parent
.
horizontalCenter
width
:
parent
.
width
*
0.25
height
:
parent
.
height
*
0.3
spacing
:
5
rows
:
6
columns
:
5
Repeater
{
model
:
30
delegate
:
Case
{}
}
}
// Clavier en bas centré
Rectangle
{
id
:
rectangle1
x
:
342
y
:
762
width
:
640
height
:
280
width
:
parent
.
width
*
0.9
height
:
parent
.
height
*
0.25
anchors.bottom
:
parent
.
bottom
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.bottomMargin
:
height
*
0.03
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
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
}
}
Row
{
id
:
row2
width
:
(
9
*
50
)
+
(
8
*
spacing
)
height
:
80
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.fill
:
parent
anchors.margins
:
10
spacing
:
10
Repeater
{
model
:
[
[
"
A
"
,
"
Z
"
,
"
E
"
,
"
R
"
,
"
T
"
,
"
Y
"
,
"
U
"
,
"
I
"
,
"
O
"
,
"
P
"
],
[
"
Q
"
,
"
S
"
,
"
D
"
,
"
F
"
,
"
G
"
,
"
H
"
,
"
J
"
,
"
K
"
,
"
L
"
],
[
"
Entrée
"
,
"
W
"
,
"
X
"
,
"
C
"
,
"
V
"
,
"
B
"
,
"
N
"
,
"
M
"
,
"
<
"
]
]
delegate
:
Row
{
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
}
}
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
"
Repeater
{
model
:
modelData
delegate
:
Key
{
width
:
modelData
===
"
Entrée
"
||
modelData
===
"
<
"
?
80
:
50
height
:
60
labelText
:
modelData
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
.
verticalCent
er
}
}
// Timer en bas à droite
MotusTimer
{
id
:
motusTim
er
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
anchors.margins
:
10
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment