UI: Fixed game selection screen issues with fullscreen & autohide menu option

This commit is contained in:
Souryo 2017-05-28 10:33:09 -04:00
parent 06cbbcf9d5
commit 735c3e583b
3 changed files with 27 additions and 9 deletions

View file

@ -16,6 +16,18 @@ namespace Mesen.GUI.Controls
{
public partial class ctrlRecentGames : UserControl
{
public new event MouseEventHandler MouseMove
{
add { this.tlpPreviousState.MouseMove += value; }
remove { this.tlpPreviousState.MouseMove -= value; }
}
public new event EventHandler DoubleClick
{
add { this.tlpPreviousState.DoubleClick += value; }
remove { this.tlpPreviousState.DoubleClick -= value; }
}
private int _currentIndex = 0;
private List<RecentGameInfo> _recentGames = new List<RecentGameInfo>();
private PrivateFontCollection _fonts = new PrivateFontCollection();

View file

@ -260,11 +260,13 @@ namespace Mesen.GUI.Forms
// ctrlRecentGames
//
this.ctrlRecentGames.BackColor = System.Drawing.Color.Transparent;
this.ctrlRecentGames.Dock = System.Windows.Forms.DockStyle.Top;
this.ctrlRecentGames.Location = new System.Drawing.Point(0, 0);
this.ctrlRecentGames.Name = "ctrlRecentGames";
this.ctrlRecentGames.Size = new System.Drawing.Size(430, 309);
this.ctrlRecentGames.TabIndex = 7;
this.ctrlRecentGames.Visible = false;
this.ctrlRecentGames.DoubleClick += new System.EventHandler(this.ctrlRenderer_DoubleClick);
this.ctrlRecentGames.MouseMove += new System.Windows.Forms.MouseEventHandler(this.ctrlRenderer_MouseMove);
//
// ctrlNsfPlayer
//
@ -325,50 +327,50 @@ namespace Mesen.GUI.Forms
this.mnuOpen.Image = global::Mesen.GUI.Properties.Resources.FolderOpen;
this.mnuOpen.Name = "mnuOpen";
this.mnuOpen.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.mnuOpen.Size = new System.Drawing.Size(146, 22);
this.mnuOpen.Size = new System.Drawing.Size(152, 22);
this.mnuOpen.Text = "Open";
this.mnuOpen.Click += new System.EventHandler(this.mnuOpen_Click);
//
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(143, 6);
this.toolStripMenuItem4.Size = new System.Drawing.Size(149, 6);
//
// mnuSaveState
//
this.mnuSaveState.Name = "mnuSaveState";
this.mnuSaveState.Size = new System.Drawing.Size(146, 22);
this.mnuSaveState.Size = new System.Drawing.Size(152, 22);
this.mnuSaveState.Text = "Save State";
this.mnuSaveState.DropDownOpening += new System.EventHandler(this.mnuSaveState_DropDownOpening);
//
// mnuLoadState
//
this.mnuLoadState.Name = "mnuLoadState";
this.mnuLoadState.Size = new System.Drawing.Size(146, 22);
this.mnuLoadState.Size = new System.Drawing.Size(152, 22);
this.mnuLoadState.Text = "Load State";
this.mnuLoadState.DropDownOpening += new System.EventHandler(this.mnuLoadState_DropDownOpening);
//
// toolStripMenuItem7
//
this.toolStripMenuItem7.Name = "toolStripMenuItem7";
this.toolStripMenuItem7.Size = new System.Drawing.Size(143, 6);
this.toolStripMenuItem7.Size = new System.Drawing.Size(149, 6);
//
// mnuRecentFiles
//
this.mnuRecentFiles.Name = "mnuRecentFiles";
this.mnuRecentFiles.Size = new System.Drawing.Size(146, 22);
this.mnuRecentFiles.Size = new System.Drawing.Size(152, 22);
this.mnuRecentFiles.Text = "Recent Files";
//
// toolStripMenuItem6
//
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(143, 6);
this.toolStripMenuItem6.Size = new System.Drawing.Size(149, 6);
//
// mnuExit
//
this.mnuExit.Image = global::Mesen.GUI.Properties.Resources.Exit;
this.mnuExit.Name = "mnuExit";
this.mnuExit.Size = new System.Drawing.Size(146, 22);
this.mnuExit.Size = new System.Drawing.Size(152, 22);
this.mnuExit.Text = "Exit";
this.mnuExit.Click += new System.EventHandler(this.mnuExit_Click);
//

View file

@ -368,6 +368,8 @@ namespace Mesen.GUI.Forms
} else {
ctrlRecentGames.Height = this.ClientSize.Height - 125;
}
ctrlRecentGames.Width = this.ClientSize.Width;
ctrlRecentGames.Top = (this.HideMenuStrip && this.menuStrip.Visible) ? -menuStrip.Height : 0;
}
private void frmMain_Resize(object sender, EventArgs e)
@ -1259,6 +1261,7 @@ namespace Mesen.GUI.Forms
UpdateRecentFiles();
UpdateViewerSize();
}
ResizeRecentGames(sender, e);
}
private void mnuRegion_Click(object sender, EventArgs e)
@ -1646,6 +1649,7 @@ namespace Mesen.GUI.Forms
this.BeginInvoke((MethodInvoker)(() => {
int rendererTop = (panelRenderer.Height + (this.menuStrip.Visible ? menuStrip.Height : 0) - ctrlRenderer.Height) / 2;
this.ctrlRenderer.Top = rendererTop + (this.menuStrip.Visible ? -menuStrip.Height : 0);
this.ctrlRecentGames.Top = this.menuStrip.Visible ? -menuStrip.Height : 0;
}));
}
}