1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-10-01 12:30:00 +02:00

Add Docked/Handheld text on status bar (#1205)

* Add Dock/Handheld on status bar

* Simplified the code & move next to V-Sync

* Nit.
This commit is contained in:
HorrorTroll 2020-05-05 05:10:01 +07:00 committed by GitHub
parent f84fb20959
commit 371b9999f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 7 deletions

View file

@ -326,6 +326,8 @@ namespace Ryujinx.Ui
_device.ProcessFrame();
}
string dockedMode = ConfigurationState.Instance.System.EnableDockedMode ? "Docked" : "Handheld";
if (_ticks >= _ticksPerFrame)
{
_device.PresentFrame(SwapBuffers);
@ -333,8 +335,9 @@ namespace Ryujinx.Ui
_device.Statistics.RecordSystemFrameTime();
StatusUpdatedEvent?.Invoke(this, new StatusUpdatedEventArgs(
_device.EnableDeviceVsync,
$"Host: {_device.Statistics.GetSystemFrameRate():00.00} FPS",
_device.EnableDeviceVsync,
dockedMode,
$"Host: {_device.Statistics.GetSystemFrameRate():00.00} FPS",
$"Game: {_device.Statistics.GetGameFrameRate():00.00} FPS",
$"GPU: {_renderer.GpuVendor}"));

View file

@ -66,6 +66,7 @@ namespace Ryujinx.Ui
[GUI] CheckMenuItem _fileExtToggle;
[GUI] CheckMenuItem _pathToggle;
[GUI] CheckMenuItem _fileSizeToggle;
[GUI] Label _dockedMode;
[GUI] Label _gameStatus;
[GUI] TreeView _gameTable;
[GUI] TreeSelection _gameTableSelection;
@ -665,6 +666,7 @@ namespace Ryujinx.Ui
_hostStatus.Text = args.HostStatus;
_gameStatus.Text = args.GameStatus;
_gpuName.Text = args.GpuName;
_dockedMode.Text = args.DockedMode;
if (args.VSyncEnabled)
{

View file

@ -494,7 +494,7 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="_hostStatus">
<object class="GtkLabel" id="_dockedMode">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
@ -519,7 +519,7 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="_gameStatus">
<object class="GtkLabel" id="_hostStatus">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
@ -543,6 +543,31 @@
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="_gameStatus">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="_gpuName">
<property name="visible">True</property>
@ -553,7 +578,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">6</property>
<property name="position">8</property>
</packing>
</child>
</object>

View file

@ -5,16 +5,18 @@ namespace Ryujinx.Ui
public class StatusUpdatedEventArgs : EventArgs
{
public bool VSyncEnabled;
public string DockedMode;
public string HostStatus;
public string GameStatus;
public string GpuName;
public StatusUpdatedEventArgs(bool vSyncEnabled, string hostStatus, string gameStatus, string gpuName)
public StatusUpdatedEventArgs(bool vSyncEnabled, string dockedMode, string hostStatus, string gameStatus, string gpuName)
{
VSyncEnabled = vSyncEnabled;
DockedMode = dockedMode;
HostStatus = hostStatus;
GameStatus = gameStatus;
GpuName = gpuName;
}
}
}
}