diff --git a/Apps/NesMenuFolder.cs b/Apps/NesMenuFolder.cs index 2ffd74da7..a3869c725 100644 --- a/Apps/NesMenuFolder.cs +++ b/Apps/NesMenuFolder.cs @@ -262,18 +262,20 @@ public override bool Save() Directory.CreateDirectory(basePath); getAdjustedDesktopFile().Save(Path.Combine(basePath, desktop.Code + ".desktop"), false, true); + var maxX = hakchi.IsSnes(ConfigIni.Instance.ConsoleType) ? 228 : 204; + var maxY = 204; var sourcePath = getImagePath(ImageId); if (sourcePath != null) { var smallSourcePath = sourcePath.Replace(".png", "_small.png"); if (!File.Exists(smallSourcePath)) smallSourcePath = sourcePath; - ProcessImageFile(sourcePath, iconPath, 204, 204, true, false, false); + ProcessImageFile(sourcePath, iconPath, maxX, maxY, true, false, false); ProcessImageFile(smallSourcePath, smallIconPath, 40, 40, true, false, false); } else { - ProcessImage(Image, iconPath, 204, 204, true, false, false); + ProcessImage(Image, iconPath, maxX, maxY, true, false, false); ProcessImage(Image, smallIconPath, 40, 40, true, false, false); } return true; @@ -293,6 +295,8 @@ public long CopyTo(string relativeTargetPath, HashSet local var desktopStream = getAdjustedDesktopFile().SaveTo(new MemoryStream(), false, true); localGameSet.Add(new ApplicationFileInfo($"./{targetDir}/{desktop.Code}.desktop", DateTime.UtcNow, desktopStream)); + var maxX = hakchi.IsSnes(ConfigIni.Instance.ConsoleType) ? 228 : 204; + var maxY = 204; var sourcePath = getImagePath(ImageId); Stream iconStream, smallIconStream; if (sourcePath != null) @@ -300,7 +304,7 @@ public long CopyTo(string relativeTargetPath, HashSet local var smallSourcePath = sourcePath.Replace(".png", "_small.png"); if (!File.Exists(smallSourcePath)) smallSourcePath = sourcePath; - iconStream = ProcessImageFileToStream(sourcePath, 204, 204, true, false, false); + iconStream = ProcessImageFileToStream(sourcePath, maxX, maxY, true, false, false); smallIconStream = ProcessImageFileToStream(smallSourcePath, 40, 40, true, false, false); localGameSet.Add(new ApplicationFileInfo($"./{targetDir}/{desktop.Code}.png", File.GetLastWriteTimeUtc(sourcePath), iconStream)); @@ -308,7 +312,7 @@ public long CopyTo(string relativeTargetPath, HashSet local } else { - iconStream = ProcessImageToStream(Image, 204, 204, true, false, false); + iconStream = ProcessImageToStream(Image, maxX, maxY, true, false, false); smallIconStream = ProcessImageToStream(Image, 40, 40, true, false, false); localGameSet.Add(new ApplicationFileInfo($"./{targetDir}/{desktop.Code}.png", DateTime.UtcNow, iconStream)); diff --git a/FoldersManagerForm.cs b/FoldersManagerForm.cs index 3af22b0b3..a06aadd78 100644 --- a/FoldersManagerForm.cs +++ b/FoldersManagerForm.cs @@ -264,13 +264,14 @@ private void treeView_AfterSelect(object sender, TreeViewEventArgs e) private void ShowSelected() { + var maxX = (hakchi.IsSnes(ConfigIni.Instance.ConsoleType) ? 228 : 204); var node = treeView.SelectedNode; listViewContent.Clear(); if (node != null && (node.Nodes.Count > 0 || node.Tag is NesMenuFolder)) // Folder or root { pictureBoxArt.Image = (node.Tag is NesMenuFolder) ? (node.Tag as NesMenuFolder).Image : null; - pictureBoxArt.Width = 204; - pictureBoxArt.Left = pictureBoxLeft + 7; + pictureBoxArt.Width = maxX; + pictureBoxArt.Left = pictureBoxLeft + ((maxX - 204) / 2); groupBoxArt.Enabled = (node.Tag is NesMenuFolder); groupBoxSplitModes.Enabled = true; pictureBoxArt.Cursor = Cursors.Hand; @@ -304,7 +305,7 @@ private void ShowSelected() if (pictureBoxArt.Image != null) { - pictureBoxArt.SizeMode = (pictureBoxArt.Image.Width > 204 || pictureBoxArt.Image.Height > 204) ? PictureBoxSizeMode.Zoom : PictureBoxSizeMode.CenterImage; + pictureBoxArt.SizeMode = (pictureBoxArt.Image.Width > pictureBoxArt.Width || pictureBoxArt.Image.Height > 204) ? PictureBoxSizeMode.Zoom : PictureBoxSizeMode.CenterImage; } ShowFolderStats(); diff --git a/SelectIconForm.cs b/SelectIconForm.cs index ca4a9d7d6..21af03e8f 100644 --- a/SelectIconForm.cs +++ b/SelectIconForm.cs @@ -82,7 +82,7 @@ private void listBox_SelectedIndexChanged(object sender, EventArgs e) { buttonOk.Enabled = true; pictureBoxArt.Image = Image.FromFile((listBox.SelectedItem as IconItem).Path); - pictureBoxArt.SizeMode = (pictureBoxArt.Image.Width > 204 || pictureBoxArt.Image.Height > 204) ? PictureBoxSizeMode.Zoom : PictureBoxSizeMode.CenterImage; + pictureBoxArt.SizeMode = (pictureBoxArt.Image.Width > (hakchi.IsSnes(ConfigIni.Instance.ConsoleType) ? 228 : 204) || pictureBoxArt.Image.Height > 204) ? PictureBoxSizeMode.Zoom : PictureBoxSizeMode.CenterImage; } else { diff --git a/SelectIconForm.resx b/SelectIconForm.resx index 6fcef66bf..448468d18 100644 --- a/SelectIconForm.resx +++ b/SelectIconForm.resx @@ -126,7 +126,7 @@ 12, 12 - 300, 238 + 276, 238 @@ -181,10 +181,10 @@ NoControl - 318, 12 + 294, 12 - 204, 204 + 228, 204 CenterImage