Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ingame
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
ingame
Commits
b789050f
Commit
b789050f
authored
Apr 05, 2024
by
Georgiy Yankovskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QtQuick.Controls used for Button template, tabs switching with simple template, UI constants
parent
dcaf96fa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
18 deletions
+89
-18
Button.qml
qml/components/Button.qml
+23
-9
Tabs.qml
qml/components/Tabs.qml
+60
-9
style.js
qml/constants/style.js
+2
-0
tabs.js
qml/constants/tabs.js
+3
-0
HomeScene.qml
qml/scenes/HomeScene.qml
+1
-0
No files found.
qml/components/Button.qml
View file @
b789050f
import
QtQuick
import
QtQuick
.
Controls
as
C
Rectangle
{
id
:
rectangle
C.Button
{
// control.down
// control.activeFocus
id
:
control
width
:
150
height
:
50
radius
:
5
color
:
"#ffffff"
text
:
qsTr
(
"Button"
)
Text
{
id
:
text1
text
:
qsTr
(
"Text"
)
anchors.fill
:
parent
font.pixelSize
:
12
contentItem
:
Text
{
text
:
control
.
text
font
:
control
.
font
opacity
:
enabled
?
1.0
:
0.3
color
:
control
.
down
?
"#000000"
:
(
control
.
activeFocus
?
"#ff0000"
:
"#555555"
)
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
elide
:
Text
.
ElideRight
}
background
:
Rectangle
{
implicitWidth
:
100
implicitHeight
:
40
opacity
:
enabled
?
1
:
0.3
border.color
:
control
.
down
?
"#000000"
:
(
control
.
activeFocus
?
"#ff0000"
:
"#555555"
)
border.width
:
1
radius
:
8
}
}
qml/components/Tabs.qml
View file @
b789050f
import
QtQuick
import
"../constants/tabs.js"
as
TabConstants
Rectangle
{
// PROPERTIES
property
string
currentTab
:
TabConstants
.
systemManagementTab
// FIELDS
id
:
tabs
x
:
0
y
:
0
...
...
@@ -8,16 +13,52 @@ Rectangle {
height
:
480
color
:
"#ffffff"
// COMPONENTS
Grid
{
id
:
grid
y
:
60
height
:
420
id
:
systemManagementGrid
visible
:
tabs
.
currentTab
==
TabConstants
.
systemManagementTab
columns
:
3
spacing
:
2
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.topMargin
:
60
anchors.rightMargin
:
0
anchors.leftMargin
:
0
anchors.bottomMargin
:
0
Rectangle
{
color
:
"red"
;
width
:
50
;
height
:
50
}
Rectangle
{
color
:
"green"
;
width
:
20
;
height
:
50
}
Rectangle
{
color
:
"blue"
;
width
:
50
;
height
:
20
}
Rectangle
{
color
:
"cyan"
;
width
:
50
;
height
:
50
}
Rectangle
{
color
:
"magenta"
;
width
:
10
;
height
:
10
}
}
Grid
{
id
:
gamesGrid
visible
:
tabs
.
currentTab
==
TabConstants
.
gamesTab
columns
:
3
spacing
:
2
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.topMargin
:
60
anchors.rightMargin
:
0
anchors.leftMargin
:
0
anchors.bottomMargin
:
0
Text
{
id
:
text2
text
:
qsTr
(
"Text"
)
font.pixelSize
:
12
}
}
Rectangle
{
...
...
@@ -45,16 +86,26 @@ Rectangle {
topPadding
:
5
Button
{
id
:
button1
}
Button
{
id
:
button2
id
:
buttonSystemManagement
text
:
"System management"
onClicked
:
function
(){
tabs
.
currentTab
=
TabConstants
.
systemManagementTab
;
// tabs.changeTab();
// console.log(tabs.currentTab);
}
}
Button
{
id
:
button3
id
:
buttonGames
text
:
"Games"
onClicked
:
function
(){
tabs
.
currentTab
=
TabConstants
.
gamesTab
;
// tabs.changeTab();
// console.log(tabs.currentTab);
}
}
}
}
}
qml/constants/style.js
0 → 100644
View file @
b789050f
var
backColor
=
"red"
;
\ No newline at end of file
qml/constants/tabs.js
0 → 100644
View file @
b789050f
var
systemManagementTab
=
"systemManagement"
;
var
gamesTab
=
"games"
;
\ No newline at end of file
qml/scenes/HomeScene.qml
View file @
b789050f
import
QtQuick
import
QtQuick
.
Controls
import
"../components"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment