@@ -8,12 +8,6 @@ namespace BetterModMenu.Patches;
88internal static class ModdingScreenDialogs
99{
1010 private const int MaxVisibleBackupChoices = 12 ;
11- private const int LogPopupWidth = 1080 ;
12- private const int LogPopupHeight = 680 ;
13- private const int LogContentWidth = 1020 ;
14- private const int LogContentHeight = 600 ;
15- private const int LogBodyFontSize = 22 ;
16- private const int LogButtonFontSize = 22 ;
1711
1812 public static void ShowInfoDialog ( NModdingScreen screen , string title , string message )
1913 {
@@ -100,30 +94,26 @@ public static void ShowBackupSelectionDialog(NModdingScreen screen, IReadOnlyLis
10094
10195 public static void ShowLogDialog ( NModdingScreen screen , string title , string content , string logPath )
10296 {
97+ LogDialogLayout layout = ModdingScreenDialogRules . GetPreferredLogDialogLayout ( ) ;
10398 var popup = new AcceptDialog
10499 {
105100 Title = title ,
106101 DialogText = string . Empty
107102 } ;
108103
109- var scroll = new ScrollContainer
110- {
111- HorizontalScrollMode = ScrollContainer . ScrollMode . Disabled ,
112- SizeFlagsHorizontal = Control . SizeFlags . ExpandFill ,
113- SizeFlagsVertical = Control . SizeFlags . ExpandFill
114- } ;
115104 var panel = new PanelContainer
116105 {
117- CustomMinimumSize = new Vector2 ( LogContentWidth , LogContentHeight )
106+ CustomMinimumSize = new Vector2 ( layout . PanelWidth , layout . PanelHeight )
118107 } ;
119108 ModdingScreenVanillaStyle . ApplyLogPanel ( panel ) ;
120- var contentBox = new VBoxContainer
109+ var panelBox = new VBoxContainer
121110 {
122111 SizeFlagsHorizontal = Control . SizeFlags . ExpandFill ,
123112 SizeFlagsVertical = Control . SizeFlags . ExpandFill
124113 } ;
125114 var actionRow = new HBoxContainer
126115 {
116+ CustomMinimumSize = new Vector2 ( 0 , layout . ActionRowHeight ) ,
127117 SizeFlagsHorizontal = Control . SizeFlags . ExpandFill
128118 } ;
129119 var copyButton = new Button
@@ -143,7 +133,20 @@ public static void ShowLogDialog(NModdingScreen screen, string title, string con
143133 ModdingScreenVanillaStyle . ApplyButton ( openFolderButton ) ;
144134 openFolderButton . Pressed += ( ) => OpenLogFolder ( screen , logPath ) ;
145135 actionRow . AddChild ( openFolderButton ) ;
146- contentBox . AddChild ( actionRow ) ;
136+ panelBox . AddChild ( actionRow ) ;
137+
138+ var scroll = new ScrollContainer
139+ {
140+ HorizontalScrollMode = ScrollContainer . ScrollMode . Disabled ,
141+ CustomMinimumSize = new Vector2 ( 0 , layout . ScrollHeight ) ,
142+ SizeFlagsHorizontal = Control . SizeFlags . ExpandFill ,
143+ SizeFlagsVertical = Control . SizeFlags . ExpandFill
144+ } ;
145+ var contentBox = new VBoxContainer
146+ {
147+ SizeFlagsHorizontal = Control . SizeFlags . ExpandFill ,
148+ SizeFlagsVertical = Control . SizeFlags . ExpandFill
149+ } ;
147150
148151 var label = new RichTextLabel
149152 {
@@ -158,15 +161,16 @@ public static void ShowLogDialog(NModdingScreen screen, string title, string con
158161 SizeFlagsVertical = Control . SizeFlags . ExpandFill
159162 } ;
160163 label . AddThemeColorOverride ( "default_color" , new Color ( 0.92f , 0.86f , 0.74f , 1f ) ) ;
161- label . AddThemeFontSizeOverride ( "font_size" , LogBodyFontSize ) ;
164+ label . AddThemeFontSizeOverride ( "font_size" , layout . BodyFontSize ) ;
162165
163166 contentBox . AddChild ( label ) ;
164167 scroll . AddChild ( contentBox ) ;
165- panel . AddChild ( scroll ) ;
168+ panelBox . AddChild ( scroll ) ;
169+ panel . AddChild ( panelBox ) ;
166170 popup . AddChild ( panel ) ;
167- ApplyReadableDialogButtons ( popup , LogButtonFontSize ) ;
171+ ApplyReadableDialogButtons ( popup , layout . ButtonFontSize ) ;
168172 screen . AddChild ( popup ) ;
169- popup . PopupCentered ( new Vector2I ( LogPopupWidth , LogPopupHeight ) ) ;
173+ popup . PopupCentered ( new Vector2I ( layout . PopupWidth , layout . PopupHeight ) ) ;
170174 }
171175
172176 private static void OpenLogFolder ( NModdingScreen screen , string logPath )
0 commit comments