Commit 7456e9a5 authored by Exc404's avatar Exc404

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

parent bc7d82d8
......@@ -13,7 +13,7 @@ Rectangle {
property var activeButtonTab: buttonGames
id: tabs
x: 100
x: 0
y: 0
anchors.fill: parent
......@@ -42,23 +42,39 @@ Rectangle {
ColumnLayout{
id:topNavigation
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 {
id: tabButtons
property int tempX: 100
property bool toggle: false
//anchors.leftMargin: parent.width / 10
//anchors.rightMargin: parent.width / 10
Component.onCompleted: {
tabButtons.changeButtonActiveTab(tabs.activeButtonTab);
tabButtons.x = tabButtons.tempX;
console.log("tabButtons completed!");
}
Layout.bottomMargin: buttonSystemManagement.height / 2
Layout.topMargin: buttonSystemManagement.height / 3
x:100
x:0
// Состояния
states: [
State {
......@@ -147,17 +163,7 @@ Rectangle {
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 {
id: testbut2
text: "Test"
......@@ -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 {
......@@ -253,6 +274,7 @@ Rectangle {
model: core_app.games
// Карточка игры
Game {
id: game
gameTitle: model.name
gameExec: model.exec
gameIcon: model.icon
......@@ -267,6 +289,40 @@ Rectangle {
gamesGrid.rowSpacing - gamesGrid.anchors.rightMargin - gamesGrid.anchors.leftMargin)
/ gamesGrid.columns
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 {
font.family: globalFont.font
font.weight: 400
font.styleName: globalFont.font.styleName
font.pointSize: 14
font.pointSize: 16
//font.bold : true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
......
......@@ -31,9 +31,6 @@ Rectangle {
gameRect.anchors.left = startPos.left
gameRect.anchors.top = startPos.top
runGameButton.focus = true
// gameRect.width = startPos.Layout.preferredWidth
// gameRect.Height = startPos.Layout.preferredHeight
root.state = "completed"
}
states:[
......@@ -67,7 +64,6 @@ Rectangle {
]
transitions: Transition {
// smoothly reanchor myRect and move into new position
AnchorAnimation { duration: 300 }
}
......@@ -190,8 +186,8 @@ Rectangle {
anchors.top: gameRect.parent.top
anchors.leftMargin: root.width / 100 * 3
anchors.topMargin: root.width / 100 * 3
width:root.width / 100 * 20
height: width / 2 * 3
width: height /3 * 2 //root.width / 100 * 20
height: root.height / 2 //width / 2 * 3
color:"#00000000"
}
......@@ -226,13 +222,9 @@ Rectangle {
RowLayout{
id:info
width: parent.width - finishPos.width - root.width / 100 * 6
//height: content.height - topPanel.height
anchors.left: finishPos.right
anchors.top: finishPos.top
anchors.leftMargin: root.width / 100 * 3
ColumnLayout{
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillWidth: true
......@@ -240,45 +232,119 @@ Rectangle {
spacing: 40
Text {
id: title
//width: root.width / 100 * 10
Layout.maximumWidth: root.width / 100 * 30
font.weight: 600
wrapMode: Text.Wrap
text: root.title
//font.pixelSize: 32
font.pixelSize:Math.max(19,root.height / 100 * 4.2)
color: "white"
}
Button {
id: runGameButton
text: "Run game"
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(){
if(window.scene !== S.gameInfoScene) return;
if(core_app === undefined) return;
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
//width: root.width / 100 * 10
Layout.maximumWidth: root.width / 100 * 30
Layout.maximumHeight: root.height / 100 * 70
elide: Text.ElideRight
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 "
font.pixelSize:Math.max(13,root.height / 100 * 2.2)
......@@ -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