Skip to content

Commit 90844e1

Browse files
committed
Improved UI and fixed bug
bug fixed: The game is quit be the game continues to run in the background
1 parent af6026b commit 90844e1

File tree

3 files changed

+48
-90
lines changed

3 files changed

+48
-90
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"desktop": "qvbam.desktop"
1111
}
1212
},
13-
"version": "0.2.3",
13+
"version": "0.2.4",
1414
"maintainer": "Emanuele Sorce <emanuele.sorce@hotmail.com>"
1515
}

src/qt/qml/PlayPage.qml

Lines changed: 45 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,8 @@ Page {
5858
height: units.gu(28)
5959
anchors.bottom: parent.bottom
6060
anchors.horizontalCenter: parent.horizontalCenter
61-
color: showPad ? "#4E2865" : "transparent"
61+
color: showPad ? "white" : "transparent"
6262
opacity: showPad ? 1.0 : 0.5
63-
//[startx, starty, endx, endy, key]
64-
//position in absolute value
65-
//keyname, x,y,width, height left or right, key, image
6663
property var buttonsPositions: [
6764
["L", 2.25, 21.25, 11, 5, "left", Qt.Key_A, "./img/LButton.png"],
6865
["R", 2.25, 21.25, 11, 5, "right", Qt.Key_S, "./img/RButton.png"],
@@ -74,7 +71,7 @@ Page {
7471
]
7572
property var directRatio: 0.31;
7673
property var lastKeyStatus: [false, false, false, false, false, false, false, false, false, false]
77-
property var buttonKeys: [Qt.Key_A, Qt.Key_S, Qt.Key_Z, Qt.Key_X, Qt.Key_Return, Qt.Key_Backspace, Qt.Key_Up, Qt.Key_Left, Qt.Key_Down, Qt.Key_Right]
74+
property var buttonKeys: [Qt.Key_A, Qt.Key_S, Qt.Key_Z, Qt.Key_X, Qt.Key_Return, Qt.Key_Backspace, Qt.Key_Up, Qt.Key_Left, Qt.Key_Down, Qt.Key_Right]
7875

7976
MultiPointTouchArea {
8077
anchors.fill: parent
@@ -173,97 +170,57 @@ Page {
173170
}
174171
}
175172

176-
MouseArea {
177-
id: toolbarMask
178-
anchors {
179-
top: parent.top
180-
left: parent.left
181-
right: parent.right
182-
bottom: tools.top
183-
}
184-
enabled: tools.opened
185-
onClicked: tools.close()
186-
}
187-
188-
Icon {
189-
name: "contextual-menu"
190-
opacity: 0.5
191-
width: units.gu(5)
192-
height: width
193-
x: units.gu(2)
194-
y: units.gu(2)
195-
MouseArea {
196-
anchors.fill: parent
197-
onClicked: tools.open()
198-
}
199-
}
173+
//MouseArea {
174+
// id: toolbarMask
175+
// anchors {
176+
// top: tools.bottom
177+
// left: parent.left
178+
// right: parent.right
179+
// bottom: parent.bottom
180+
// }
181+
// enabled: tools.opened
182+
// onClicked: tools.close()
183+
//}
200184

201-
Panel {
185+
header: PageHeader {
202186
id: tools
203-
anchors {
204-
left: parent.left
205-
right: parent.right
206-
bottom: parent.bottom
207-
}
208-
height: units.gu(8)
209-
Component.onCompleted: {
210-
tools.open();
211-
closeToolbarTimer.start();
212-
}
213-
Rectangle {
214-
anchors.fill: parent
215-
color: "white"
216-
}
217-
218-
Timer {
219-
id: closeToolbarTimer
220-
interval: 2000
221-
repeat: false
222-
onTriggered: tools.close()
223-
}
224-
225-
ToolbarItems {
226-
back: ToolbarButton {
227-
action: Action {
228-
text: "Close"
229-
iconName: "close"
230-
onTriggered: {
231-
pageStack.pop();
232-
iwindow.vOnFileClose();
233-
}
234-
}
235-
}
236-
ToolbarButton {
237-
action: Action {
238-
text: "Settings"
239-
iconName: "settings"
240-
onTriggered: {
241-
pageStack.push(Qt.resolvedUrl("SettingPage.qml"));
242-
}
187+
188+
leadingActionBar.actions: [
189+
Action {
190+
text: "Quit"
191+
iconName: "close"
192+
onTriggered: {
193+
iwindow.vOnFileClose();
194+
pageStack.pop();
243195
}
244196
}
197+
]
245198

246-
ToolbarButton {
247-
action: Action {
248-
text: "Save Slot"
249-
iconName: "save"
250-
onTriggered: {
251-
slotAction = "save";
252-
PopupUtils.open(slotSheet)
253-
}
199+
trailingActionBar.actions: [
200+
Action {
201+
text: "Save Slot"
202+
iconName: "save"
203+
onTriggered: {
204+
slotAction = "save";
205+
PopupUtils.open(slotSheet)
254206
}
255-
}
256-
ToolbarButton {
257-
action: Action {
258-
text: "Load Slot"
259-
iconName: "keyboard-caps-disabled"
260-
onTriggered: {
261-
slotAction = "load";
262-
PopupUtils.open(slotSheet)
263-
}
207+
},
208+
Action {
209+
text: "Load Slot"
210+
iconName: "keyboard-caps-disabled"
211+
onTriggered: {
212+
slotAction = "load";
213+
PopupUtils.open(slotSheet)
214+
}
215+
},
216+
Action {
217+
text: "Settings"
218+
iconName: "settings"
219+
onTriggered: {
220+
pageStack.push(Qt.resolvedUrl("SettingPage.qml"));
264221
}
265222
}
266-
}
223+
]
267224
}
268225
Component {
269226
id: slotSheet

src/qt/qml/TopPage.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import QtQuick 2.4
22
import Ubuntu.Components 1.3
33
import Ubuntu.Components.ListItems 1.3 as ListItem
44
import Ubuntu.Components.Popups 1.3
5+
56
Tabs {
67
id: tabs
78
Tab {
89
id: romTab
9-
title: "Load Roms"
10+
title: i18n.tr("Load Roms")
1011
page: Page {
1112
head.actions: [
1213
Action {

0 commit comments

Comments
 (0)