Skip to content

Commit

Permalink
Improve rendering of info panel
Browse files Browse the repository at this point in the history
- Images no longer take up space when disabled
- Fixed longstanding issue where some entries would not display images when selected
  • Loading branch information
WumboSpasm committed Feb 4, 2023
1 parent 7e28d87 commit fbb771c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ private void Main_load(object sender, EventArgs e)

// Initialize list columns and their widths.

ArchiveList.SecondarySortColumn = TitleColumn;

for (int i = 0; i < ArchiveList.Columns.Count; i++)
{
columnWidths.Add(ArchiveList.Columns[i].Width);
Expand Down Expand Up @@ -236,8 +238,6 @@ private void ArchiveList_itemSelect(object sender, EventArgs e)

ArchiveInfoDeveloper.Text = metadataOutput.Developer != "" ? $"by {metadataOutput.Developer}" : "by unknown developer";

ArchiveInfoData.Height = GetInfoHeight();

/* METADATA */

ArchiveInfoData.Rtf = BuildEntryData(metadataOutput);
Expand All @@ -246,10 +246,7 @@ private void ArchiveList_itemSelect(object sender, EventArgs e)

if (Config.DisplayImages)
{
if (!ArchiveImagesContainer.Visible)
{
ArchiveImagesContainer.Visible = true;
}
ArchiveImagesContainer.Visible = true;

// TODO: make images persistent.
foreach (string folder in new string[] { "Logos", "Screenshots" })
Expand Down Expand Up @@ -284,6 +281,9 @@ private void ArchiveList_itemSelect(object sender, EventArgs e)
}
}

// Set info height now that images are ready.
ArchiveInfoData.Height = GetInfoHeight();

/* FOOTER */

// If additional applications exist for the selected entry, display an arrow button with a menu.
Expand Down Expand Up @@ -1090,7 +1090,7 @@ private int GetInfoHeight()

foreach (Control control in ArchiveInfoContainer.Controls)
{
if (control.Name != "ArchiveInfoData")
if (control.Name != "ArchiveInfoData" && control.Visible)
{
desiredHeight -= control.Height;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Main.resx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABO
CQAAAk1TRnQBSQFMAgEBAgEAAaABAgGgAQIBGQEAARkBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFk
CQAAAk1TRnQBSQFMAgEBAgEAAagBAgGoAQIBGQEAARkBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFk
AwABGQMAAQEBAAEYBQABTAEd/wBOAAbAIQAGwB8AAcAB8AEAAcAB8CIAAcAB8AEAAcAB8LEAA8AGAAbA
FQAGwAYAA8AZAAHAAfABAAGAAeABAAGAAeABAAHAAfABAAHAAfAWAAHAAfABAAHAAfABAAGAAeABAAGA
AeABAAHAAfCuAAPADAAGwAkABsAMAAPAGQABwAHwAQABgAHgAQABgAHgAQABgAHgAQABgAHgAQABwAHw
Expand Down

0 comments on commit fbb771c

Please sign in to comment.