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
9500e2d5
Commit
9500e2d5
authored
Apr 08, 2024
by
Exc404
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dynamic scaling of the game grid
parent
8c3903d8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
29 deletions
+40
-29
Tabs.qml
qml/components/Tabs.qml
+14
-6
Game.qml
qml/delegates/Game.qml
+24
-23
PUBG.png
qml/images/PUBG.png
+0
-0
App.py
src/models/App.py
+2
-0
No files found.
qml/components/Tabs.qml
View file @
9500e2d5
...
@@ -7,7 +7,7 @@ import "../constants/tabs.js" as TabConstants
...
@@ -7,7 +7,7 @@ import "../constants/tabs.js" as TabConstants
Rectangle
{
Rectangle
{
// PROPERTIES
// PROPERTIES
property
string
currentTab
:
TabConstants
.
systemManagement
Tab
property
string
currentTab
:
TabConstants
.
games
Tab
// FIELDS
// FIELDS
id
:
tabs
id
:
tabs
...
@@ -53,25 +53,29 @@ Rectangle {
...
@@ -53,25 +53,29 @@ Rectangle {
anchors.topMargin
:
60
anchors.topMargin
:
60
clip
:
true
clip
:
true
GridLayout
{
GridLayout
{
id
:
gamesGrid
id
:
gamesGrid
readonly
property
int
elementWidth
:
2
56
+
gamesGrid
.
rowSpacing
*
2
readonly
property
int
elementWidth
:
2
28
+
15
//
+ gamesGrid.rowSpacing*2
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
//Layout.alignment: AlignCenter
// columns: Math.max(Math.floor(parent.width / elementWidth), 1)
// columns: Math.max(Math.floor(parent.width / elementWidth), 1)
// rows: Math.max(Math.ceil(children.length / columns), 1)
// rows: Math.max(Math.ceil(children.length / columns), 1)
columns
:
Math
.
max
(
Math
.
floor
(
gamesScroller
.
width
/
elementWidth
),
1
)
//columns: Math.max(Math.min(Math.floor(gamesScroller.width / elementWidth),6), 1)
columns
:
5
rows
:
Math
.
max
(
Math
.
ceil
(
children
.
length
/
columns
),
1
)
rows
:
Math
.
max
(
Math
.
ceil
(
children
.
length
/
columns
),
1
)
anchors.rightMargin
:
8
anchors.rightMargin
:
8
anchors.leftMargin
:
8
anchors.leftMargin
:
8
anchors.bottomMargin
:
8
anchors.bottomMargin
:
8
anchors.topMargin
:
8
anchors.topMargin
:
8
rowSpacing
:
8
rowSpacing
:
15
columnSpacing
:
rowSpacing
columnSpacing
:
rowSpacing
Repeater
{
Repeater
{
...
@@ -84,8 +88,12 @@ Rectangle {
...
@@ -84,8 +88,12 @@ Rectangle {
gameExec
:
model
.
exec
gameExec
:
model
.
exec
gameIcon
:
model
.
icon
gameIcon
:
model
.
icon
width
:
256
// Layout.fillWidth: true
height
:
256
// Layout.preferredWidth: 1000
//width: parent.width / 4
Layout.preferredWidth
:
(
gamesScroller
.
width
)
/
gamesGrid
.
columns
-
gamesGrid
.
rowSpacing
Layout.preferredHeight
:
Layout
.
preferredWidth
/
2
*
3
// icon: core_app.games.icon
// icon: core_app.games.icon
// exec: core_app.games.exec
// exec: core_app.games.exec
}
}
...
...
qml/delegates/Game.qml
View file @
9500e2d5
import
QtQuick
import
QtQuick
import
"../constants/scene.js"
as
SceneConstants
import
"../constants/scene.js"
as
SceneConstants
import
"../components/"
as
C
//import "../components/" as C
import
QtQuick
.
Controls
as
C
C.Button
{
C.Button
{
property
string
gameTitle
:
"Generic title"
property
string
gameTitle
:
"Generic title"
...
@@ -8,11 +11,8 @@ C.Button {
...
@@ -8,11 +11,8 @@ C.Button {
property
string
gameExec
:
""
property
string
gameExec
:
""
id
:
game
id
:
game
width
:
256
height
:
256
implicitWidth
:
256
implicitHeight
:
256
text
:
""
text
:
""
// color: "#efefef"
// color: "#efefef"
//radius: 5
//radius: 5
// border.width: 1
// border.width: 1
...
@@ -33,27 +33,28 @@ C.Button {
...
@@ -33,27 +33,28 @@ C.Button {
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
source
:
game
.
gameIcon
source
:
game
.
gameIcon
anchors.rightMargin
:
8
//
anchors.rightMargin: 8
anchors.bottomMargin
:
47
//
anchors.bottomMargin: 47
anchors.leftMargin
:
8
//
anchors.leftMargin: 8
anchors.topMargin
:
8
//
anchors.topMargin: 8
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
}
}
Text
{
// Text {
id
:
title
// id: title
y
:
439
// y: 439
height
:
33
// height: 33
text
:
game
.
gameTitle
// color: "#e23f3f"
anchors.left
:
parent
.
left
// text: game.gameTitle
anchors.right
:
parent
.
right
// anchors.left: parent.left
anchors.bottom
:
parent
.
bottom
// anchors.right: parent.right
font.pixelSize
:
22
// anchors.bottom: parent.bottom
horizontalAlignment
:
Text
.
AlignHCenter
// font.pixelSize: 22
anchors.rightMargin
:
8
// horizontalAlignment: Text.AlignHCenter
anchors.leftMargin
:
8
// anchors.rightMargin: 8
anchors.bottomMargin
:
8
// anchors.leftMargin: 8
}
// anchors.bottomMargin: 8
// }
}
}
qml/images/PUBG.png
0 → 100644
View file @
9500e2d5
785 KB
src/models/App.py
View file @
9500e2d5
...
@@ -66,6 +66,8 @@ class App(QtCore.QObject):
...
@@ -66,6 +66,8 @@ class App(QtCore.QObject):
icon
=
(
os
.
path
.
isfile
(
icon
)
and
icon
icon
=
(
os
.
path
.
isfile
(
icon
)
and
icon
or
os
.
path
.
realpath
(
f
"{Path(__file__).resolve().parent}../../../qml/images/game_icon.png"
))
or
os
.
path
.
realpath
(
f
"{Path(__file__).resolve().parent}../../../qml/images/game_icon.png"
))
# Тест карточек
icon
=
os
.
path
.
realpath
(
f
"{Path(__file__).resolve().parent}../../../qml/images/PUBG.png"
)
self
.
games_model
.
add_game
(
Game
(
name
=
name
,
icon
=
icon
,
exec
=
exec
))
self
.
games_model
.
add_game
(
Game
(
name
=
name
,
icon
=
icon
,
exec
=
exec
))
except
FileNotFoundError
:
except
FileNotFoundError
:
...
...
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