Implement "hide UI" option (#2411)

* Implement jduncanator method

* Rename function/button ID

* Move option to Actions menu (makes no sense while emulation is inactive...)
This commit is contained in:
ooa113y 2021-07-24 21:48:00 +03:00 committed by GitHub
parent 8c7986eb58
commit 06cd3abe6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -1072,6 +1072,15 @@ namespace Ryujinx.Ui
ConfigurationState.Instance.Graphics.AspectRatio.Value = ((int)aspectRatio + 1) > Enum.GetNames(typeof(AspectRatio)).Length - 1 ? AspectRatio.Fixed4x3 : aspectRatio + 1; ConfigurationState.Instance.Graphics.AspectRatio.Value = ((int)aspectRatio + 1) > Enum.GetNames(typeof(AspectRatio)).Length - 1 ? AspectRatio.Fixed4x3 : aspectRatio + 1;
} }
private void Focus_Menu_Bar(object sender, KeyReleaseEventArgs args)
{
if (args.Event.Key == Gdk.Key.Alt_L)
{
ToggleExtraWidgets(true);
_menuBar.GrabFocus();
}
}
private void Row_Clicked(object sender, ButtonReleaseEventArgs args) private void Row_Clicked(object sender, ButtonReleaseEventArgs args)
{ {
if (args.Event.Button != 3 /* Right Click */) if (args.Event.Button != 3 /* Right Click */)
@ -1364,6 +1373,11 @@ namespace Ryujinx.Ui
settingsWindow.Show(); settingsWindow.Show();
} }
private void HideUi_Pressed(object sender, EventArgs args)
{
ToggleExtraWidgets(false);
}
private void ManageUserProfiles_Pressed(object sender, EventArgs args) private void ManageUserProfiles_Pressed(object sender, EventArgs args)
{ {
UserProfilesManagerWindow userProfilesManagerWindow = new UserProfilesManagerWindow(_accountManager, _contentManager, _virtualFileSystem); UserProfilesManagerWindow userProfilesManagerWindow = new UserProfilesManagerWindow(_accountManager, _contentManager, _virtualFileSystem);

View file

@ -6,6 +6,7 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="title" translatable="yes">Ryujinx</property> <property name="title" translatable="yes">Ryujinx</property>
<property name="window_position">center</property> <property name="window_position">center</property>
<signal name="key-release-event" handler="Focus_Menu_Bar" swapped="no" />
<child> <child>
<object class="GtkBox" id="_box"> <object class="GtkBox" id="_box">
<property name="visible">True</property> <property name="visible">True</property>
@ -14,7 +15,7 @@
<child> <child>
<object class="GtkMenuBar" id="_menuBar"> <object class="GtkMenuBar" id="_menuBar">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<child> <child>
<object class="GtkMenuItem" id="_fileMenu"> <object class="GtkMenuItem" id="_fileMenu">
<property name="visible">True</property> <property name="visible">True</property>
@ -338,6 +339,15 @@
<signal name="activate" handler="Take_Screenshot" swapped="no"/> <signal name="activate" handler="Take_Screenshot" swapped="no"/>
</object> </object>
</child> </child>
<child>
<object class="GtkMenuItem" id="_hideUi">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Hide UI (Alt to show)</property>
<property name="use_underline">True</property>
<signal name="activate" handler="HideUi_Pressed" swapped="no" />
</object>
</child>
</object> </object>
</child> </child>
</object> </object>