base app gui
This commit is contained in:
parent
70553885f8
commit
75135a183f
7 changed files with 168 additions and 4 deletions
|
@ -1,12 +1,23 @@
|
|||
using System;
|
||||
using Qml.Net;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.UI
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
static int Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
QQuickStyle.SetStyle("Material");
|
||||
|
||||
using (var Application = new QGuiApplication(args))
|
||||
{
|
||||
using (var QmlEngine = new QQmlApplicationEngine())
|
||||
{
|
||||
QmlEngine.Load("UI/MainWindow.qml");
|
||||
|
||||
return Application.Exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
@ -8,7 +8,19 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Qml.Net" Version="0.6.2" />
|
||||
<PackageReference Include="Qml.Net.LinuxBinaries" Version="0.6.2" />
|
||||
<PackageReference Include="Qml.Net.OSXBinaries" Version="0.6.2" />
|
||||
<PackageReference Include="Qml.Net.WindowsBinaries" Version="0.6.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="UI\Models\" />
|
||||
<Folder Include="UI\Views\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="UI\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
BIN
Ryujinx.UI/UI/Images/drawer.png
Normal file
BIN
Ryujinx.UI/UI/Images/drawer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 131 B |
1
Ryujinx.UI/UI/Images/loadFolder.svg
Normal file
1
Ryujinx.UI/UI/Images/loadFolder.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M40 12H24l-4-4H8c-2.21 0-3.98 1.79-3.98 4L4 36c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V16c0-2.21-1.79-4-4-4zm0 24H8V16h32v20z"/></svg>
|
After Width: | Height: | Size: 225 B |
1
Ryujinx.UI/UI/Images/loadGame.svg
Normal file
1
Ryujinx.UI/UI/Images/loadGame.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h8v-4h-8V16h28v20h-8v4h8c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM24 20l-8 8h6v12h4V28h6l-8-8z"/></svg>
|
After Width: | Height: | Size: 242 B |
BIN
Ryujinx.UI/UI/Images/menu.png
Normal file
BIN
Ryujinx.UI/UI/Images/menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 223 B |
139
Ryujinx.UI/UI/MainWindow.qml
Normal file
139
Ryujinx.UI/UI/MainWindow.qml
Normal file
|
@ -0,0 +1,139 @@
|
|||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Material 2.1
|
||||
import QtQuick.Dialogs 1.0
|
||||
|
||||
ApplicationWindow {
|
||||
id: window
|
||||
width: 840
|
||||
height: 680
|
||||
visible: true
|
||||
title: "Ryujinx"
|
||||
|
||||
Material.theme: Material.Light
|
||||
Material.accent: '#41cd52'
|
||||
Material.primary: '#41cd52'
|
||||
|
||||
header: ToolBar {
|
||||
id: toolBar
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
anchors.fill: parent
|
||||
spacing: 20
|
||||
|
||||
ToolButton {
|
||||
id: drawerButton
|
||||
text: qsTr("")
|
||||
spacing: 3
|
||||
display: AbstractButton.IconOnly
|
||||
icon.source: "./Images/drawer.png"
|
||||
|
||||
onClicked: {
|
||||
if (contentStack.depth > 1) {
|
||||
contentStack.pop()
|
||||
} else {
|
||||
drawer.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: mainControlPanel
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
ToolButton {
|
||||
id: openGameFileButton
|
||||
display: AbstractButton.IconOnly
|
||||
icon.source: "./Images/loadGame.svg"
|
||||
ToolTip {
|
||||
text: qsTr("Load Game File")
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
loadDialog.loadGame()
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: openGameFolderButton
|
||||
display: AbstractButton.IconOnly
|
||||
icon.source: "./Images/loadFolder.svg"
|
||||
ToolTip {
|
||||
text: qsTr("Load Game Folder")
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
loadDialog.loadGameFolder()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: menuButton
|
||||
text: qsTr("Tool Button")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StackView {
|
||||
id: contentStack
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
Drawer {
|
||||
id: drawer
|
||||
width: Math.min(window.width, window.height) / 3 * 2
|
||||
height: window.height
|
||||
interactive: stackView.depth === 1
|
||||
|
||||
ListView {
|
||||
id: drawerMenuList
|
||||
focus: true
|
||||
currentIndex: -1
|
||||
anchors.fill: parent
|
||||
|
||||
delegate: ItemDelegate {
|
||||
width: parent.width
|
||||
text: model.title
|
||||
highlighted: ListView.isCurrentItem
|
||||
}
|
||||
|
||||
model: ListModel {
|
||||
ListElement { title: "Games"}
|
||||
ListElement { title: "Settings"}
|
||||
ListElement { title: "Exit"}
|
||||
}
|
||||
|
||||
ScrollIndicator.vertical: ScrollIndicator { }
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: loadDialog
|
||||
selectMultiple: false
|
||||
nameFilters: ["Game Carts (*.xci)",
|
||||
"Application Packages (*.nca *.nsp)",
|
||||
"Executable (*.nso *.nro)",
|
||||
"All Supported Formats (*.xci *.nca *.nsp *.nso *.nro)"]
|
||||
|
||||
Component.onCompleted: visible = false
|
||||
|
||||
function loadGame() {
|
||||
selectFolder = false
|
||||
title = qsTr("Load Game File")
|
||||
|
||||
show()
|
||||
}
|
||||
|
||||
function loadGameFolder() {
|
||||
selectFolder = true
|
||||
title = qsTr("Load Game Folder")
|
||||
|
||||
show()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue