Lock inspect preview size

This commit is contained in:
Tyfon
2024-05-13 02:50:06 -07:00
parent dae222cdfb
commit 8479a6b44c
2 changed files with 19 additions and 0 deletions

View File

@@ -72,6 +72,15 @@ namespace UIFixes
[PatchPostfix]
private static void Postfix(ItemSpecificationPanel __instance, LayoutElement ___layoutElement_0)
{
if (Settings.LockInspectPreviewSize.Value)
{
LayoutElement previewPanel = __instance.GetComponentsInChildren<LayoutElement>().FirstOrDefault(e => e.name == "Preview Panel");
if (previewPanel != null)
{
previewPanel.flexibleHeight = -1;
}
}
Button closeButton = __instance.GetComponentsInChildren<Button>().FirstOrDefault(b => b.name == "Close Button");
if (closeButton != null)
{

View File

@@ -32,6 +32,7 @@ namespace UIFixes
public static ConfigEntry<TransferConfirmationOption> ShowTransferConfirmations { get; set; }
public static ConfigEntry<bool> ShowModStats { get; set; }
public static ConfigEntry<bool> RememberInspectSize { get; set; }
public static ConfigEntry<bool> LockInspectPreviewSize { get; set; }
// Input
public static ConfigEntry<bool> UseHomeEnd { get; set; }
@@ -92,6 +93,15 @@ namespace UIFixes
null,
new ConfigurationManagerAttributes { })));
configEntries.Add(LockInspectPreviewSize = config.Bind(
GeneralSection,
"Lock Inspect Preview Size",
true,
new ConfigDescription(
"Keep the 3D preview from growing when you resize inspect panels",
null,
new ConfigurationManagerAttributes { })));
// Input
configEntries.Add(UseHomeEnd = config.Bind(
InputSection,