Skip to content

Commit 01b7af1

Browse files
authored
Merge pull request #1023 from cjakeman/adjust-f1-command-window
Fix: Adjusts division in F1 command window for longer descriptions
2 parents fa7b1a9 + 2f9061c commit 01b7af1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Source/RunActivity/Viewer3D/Popups/HelpWindow.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ public HelpWindow(WindowManager owner)
9595
foreach (UserCommand command in Enum.GetValues(typeof(UserCommand)))
9696
{
9797
var line = scrollbox.AddLayoutHorizontalLineOfText();
98-
var width = line.RemainingWidth / 2;
99-
line.Add(new Label(width, line.RemainingHeight, InputSettings.GetPrettyLocalizedName(command)));
100-
line.Add(new Label(width, line.RemainingHeight, Owner.Viewer.Settings.Input.Commands[(int)command].ToString()));
98+
var width = line.RemainingWidth / 2; // Split pane into 2 equal parts
99+
var offset = (int)(line.RemainingWidth * 0.10); // Offset pushes command keys 10% rightwards to allow for longer command descriptions.
100+
line.Add(new Label(width + offset, line.RemainingHeight, InputSettings.GetPrettyLocalizedName(command)));
101+
line.Add(new Label(width - offset, line.RemainingHeight, Owner.Viewer.Settings.Input.Commands[(int)command].ToString()));
101102
}
102103
}));
103104
if (owner.Viewer.Simulator.Activity != null)

0 commit comments

Comments
 (0)