Commit 7456e9a5 authored by Exc404's avatar Exc404

Кнопка Play + LB, RB кнопки

parent bc7d82d8
...@@ -13,7 +13,7 @@ Rectangle { ...@@ -13,7 +13,7 @@ Rectangle {
property var activeButtonTab: buttonGames property var activeButtonTab: buttonGames
id: tabs id: tabs
x: 100 x: 0
y: 0 y: 0
anchors.fill: parent anchors.fill: parent
...@@ -42,23 +42,39 @@ Rectangle { ...@@ -42,23 +42,39 @@ Rectangle {
ColumnLayout{ ColumnLayout{
id:topNavigation id:topNavigation
width: parent.width width: parent.width
Rectangle{
width: parent.width
height: buttonSystemManagement.height
color:"#00000000"
Layout.bottomMargin: buttonSystemManagement.height / 2
Layout.topMargin: buttonSystemManagement.height / 3
Image {
id: iconLB
source: "../icons/XboxController/left-bumper.svg"
fillMode: Image.Tile
sourceSize.width: tabButtons.width / 100 * 15
//sourceSize.height:
//Layout.alignment: Qt.AlignLeft;
anchors.leftMargin: window.width / 100 * 6
anchors.left: parent.left
anchors.verticalCenter: tabButtons.verticalCenter
//Layout.leftMargin: Math.floor( parent.width / 100 * 6)
}
RowLayout { RowLayout {
id: tabButtons id: tabButtons
property int tempX: 100 property int tempX: 100
property bool toggle: false property bool toggle: false
//anchors.leftMargin: parent.width / 10
//anchors.rightMargin: parent.width / 10
Component.onCompleted: { Component.onCompleted: {
tabButtons.changeButtonActiveTab(tabs.activeButtonTab); tabButtons.changeButtonActiveTab(tabs.activeButtonTab);
tabButtons.x = tabButtons.tempX; tabButtons.x = tabButtons.tempX;
console.log("tabButtons completed!"); console.log("tabButtons completed!");
} }
Layout.bottomMargin: buttonSystemManagement.height / 2
Layout.topMargin: buttonSystemManagement.height / 3 x:0
x:100
// Состояния // Состояния
states: [ states: [
State { State {
...@@ -147,17 +163,7 @@ Rectangle { ...@@ -147,17 +163,7 @@ Rectangle {
onReleased: tabButtons.toggle = false onReleased: tabButtons.toggle = false
} }
TopMenuBut.TextButton {
id: testbut1
text: "Mega"
onClicked: function(){
tabButtons.x = tabButtons.tempX
tabButtons.changeButtonActiveTab(this)
tabButtons.toggle = true
}
onReleased: tabButtons.toggle = false
}
TopMenuBut.TextButton { TopMenuBut.TextButton {
id: testbut2 id: testbut2
text: "Test" text: "Test"
...@@ -174,6 +180,21 @@ Rectangle { ...@@ -174,6 +180,21 @@ Rectangle {
} }
} }
Image {
id: iconRB
source: "../icons/XboxController/right-bumper.svg"
fillMode: Image.Tile
//sourceSize.width: text.font.pixelSize * 2
//sourceSize.height: tabButtons.width / 10
sourceSize.width: tabButtons.width / 100 * 15
//Layout.alignment: Qt.AlignRight;
anchors.verticalCenter: tabButtons.verticalCenter
anchors.rightMargin: window.width / 100 * 6
anchors.right: parent.right
}
}
} }
// Заглушка Системных настроек // Заглушка Системных настроек
Grid { Grid {
...@@ -253,6 +274,7 @@ Rectangle { ...@@ -253,6 +274,7 @@ Rectangle {
model: core_app.games model: core_app.games
// Карточка игры // Карточка игры
Game { Game {
id: game
gameTitle: model.name gameTitle: model.name
gameExec: model.exec gameExec: model.exec
gameIcon: model.icon gameIcon: model.icon
...@@ -267,6 +289,40 @@ Rectangle { ...@@ -267,6 +289,40 @@ Rectangle {
gamesGrid.rowSpacing - gamesGrid.anchors.rightMargin - gamesGrid.anchors.leftMargin) gamesGrid.rowSpacing - gamesGrid.anchors.rightMargin - gamesGrid.anchors.leftMargin)
/ gamesGrid.columns / gamesGrid.columns
Layout.preferredHeight: Layout.preferredWidth / 2 * 3 Layout.preferredHeight: Layout.preferredWidth / 2 * 3
// Component.onCompleted: {a3.start()}
// SequentialAnimation {
// id:a3
// NumberAnimation {
// property:Layout.topMargin;
// easing.type: Easing.InOutQuad;
// duration: 300;
// from: 100//Layout.preferredHeight;
// to: 0;
// }
// NumberAnimation {
// property:Layout.topMargin;
// easing.type: Easing.InOutQuad;
// duration: 300;
// from: 0//Layout.preferredHeight;
// to: 100;
// }
// loops: Animation.Infinite
// }
//Layout.topMargin: Layout.preferredHeight
} }
} }
} }
......
...@@ -19,7 +19,7 @@ C.Button { ...@@ -19,7 +19,7 @@ C.Button {
font.family: globalFont.font font.family: globalFont.font
font.weight: 400 font.weight: 400
font.styleName: globalFont.font.styleName font.styleName: globalFont.font.styleName
font.pointSize: 14 font.pointSize: 16
//font.bold : true //font.bold : true
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
......
...@@ -31,9 +31,6 @@ Rectangle { ...@@ -31,9 +31,6 @@ Rectangle {
gameRect.anchors.left = startPos.left gameRect.anchors.left = startPos.left
gameRect.anchors.top = startPos.top gameRect.anchors.top = startPos.top
runGameButton.focus = true runGameButton.focus = true
// gameRect.width = startPos.Layout.preferredWidth
// gameRect.Height = startPos.Layout.preferredHeight
root.state = "completed" root.state = "completed"
} }
states:[ states:[
...@@ -67,7 +64,6 @@ Rectangle { ...@@ -67,7 +64,6 @@ Rectangle {
] ]
transitions: Transition { transitions: Transition {
// smoothly reanchor myRect and move into new position
AnchorAnimation { duration: 300 } AnchorAnimation { duration: 300 }
} }
...@@ -190,8 +186,8 @@ Rectangle { ...@@ -190,8 +186,8 @@ Rectangle {
anchors.top: gameRect.parent.top anchors.top: gameRect.parent.top
anchors.leftMargin: root.width / 100 * 3 anchors.leftMargin: root.width / 100 * 3
anchors.topMargin: root.width / 100 * 3 anchors.topMargin: root.width / 100 * 3
width:root.width / 100 * 20 width: height /3 * 2 //root.width / 100 * 20
height: width / 2 * 3 height: root.height / 2 //width / 2 * 3
color:"#00000000" color:"#00000000"
} }
...@@ -226,13 +222,9 @@ Rectangle { ...@@ -226,13 +222,9 @@ Rectangle {
RowLayout{ RowLayout{
id:info id:info
width: parent.width - finishPos.width - root.width / 100 * 6 width: parent.width - finishPos.width - root.width / 100 * 6
//height: content.height - topPanel.height
anchors.left: finishPos.right anchors.left: finishPos.right
anchors.top: finishPos.top anchors.top: finishPos.top
anchors.leftMargin: root.width / 100 * 3 anchors.leftMargin: root.width / 100 * 3
ColumnLayout{ ColumnLayout{
Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillWidth: true Layout.fillWidth: true
...@@ -240,45 +232,119 @@ Rectangle { ...@@ -240,45 +232,119 @@ Rectangle {
spacing: 40 spacing: 40
Text { Text {
id: title id: title
//width: root.width / 100 * 10
Layout.maximumWidth: root.width / 100 * 30 Layout.maximumWidth: root.width / 100 * 30
font.weight: 600 font.weight: 600
wrapMode: Text.Wrap wrapMode: Text.Wrap
text: root.title text: root.title
//font.pixelSize: 32
font.pixelSize:Math.max(19,root.height / 100 * 4.2) font.pixelSize:Math.max(19,root.height / 100 * 4.2)
color: "white" color: "white"
} }
Button { Button {
id: runGameButton id: runGameButton
text: "Run game"
focus: true focus: true
//background.opacity: 0.2
leftPadding: textGame.font.pixelSize * 3
rightPadding: leftPadding
topPadding: leftPadding/ 8
bottomPadding: leftPadding/8
//opacity: 0.8
text:"Play"
width: textGame.contentWidth + 5
hoverEnabled: true
contentItem: Text {
id: textGame
text: runGameButton.text
font.pixelSize:Math.max(19,root.height / 100 * 3)
font.family: globalFont.font
font.weight: 800
font.styleName: globalFont.font.styleName
color: 'white'
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
padding:10
background: Rectangle {
id:runGameBg
color: "white" //control.down ? "#aaaaaa" : (control.activeFocus ? "#aaaaaa" : "#000000")
opacity: 0.1
radius: runGameButton.width * 0.3
}
onClicked: function(){ onClicked: function(){
if(window.scene !== S.gameInfoScene) return; if(window.scene !== S.gameInfoScene) return;
if(core_app === undefined) return; if(core_app === undefined) return;
core_app.start_game(root.exec); core_app.start_game(root.exec);
} }
// Состояния
states: [
// Карточка в фокуске
State {
name: "focus"; when: runGameButton.activeFocus
PropertyChanges {
target: runGameBg;
opacity: 1;
}
PropertyChanges {
target: textGame;
font.weight: 800;
color:"black"
}
},
// На карточку навели курсор мыши
State {
name: "hover"; when: runGameButton.hovered
PropertyChanges {
target: runGameBg;
opacity: 1;
}
PropertyChanges {
target: textGame;
color:"black"
}
}
]
// Анимации при изменениях состояний
transitions: Transition {
reversible: true
NumberAnimation {
property: "opacity";
duration: 300
}
}
} }
} }
Text {
//anchors.top: info.top
// anchors.right: info.right
horizontalAlignment: Text.AlignJustif
Layout.alignment:Qt.AlignRight| Qt.AlignTop
//Layout.preferredWidth:
Text {
horizontalAlignment: Text.AlignJustif
Layout.alignment:Qt.AlignRight| Qt.AlignTop
id: title2 id: title2
//width: root.width / 100 * 10
Layout.maximumWidth: root.width / 100 * 30 Layout.maximumWidth: root.width / 100 * 30
Layout.maximumHeight: root.height / 100 * 70 Layout.maximumHeight: root.height / 100 * 70
elide: Text.ElideRight elide: Text.ElideRight
wrapMode: Text.Wrap wrapMode: Text.Wrap
text: "SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfvSD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfvSD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv " text: "SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfvSD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfvSD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv SD ferwf f wqefewf wekj fn wfaksljf dskvjblds vdfkjvb dvlkdfsj vd vjdfk vkldfjv dfkl vd vfkjlbdf kdfljb fkdjn kdjf vd kdfjv vdfkvjdv dfvjkf vdfv "
font.pixelSize:Math.max(13,root.height / 100 * 2.2) font.pixelSize:Math.max(13,root.height / 100 * 2.2)
...@@ -287,14 +353,8 @@ Rectangle { ...@@ -287,14 +353,8 @@ Rectangle {
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment