diff options
| author | Michael <[email protected]> | 2017-07-24 21:09:48 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-07-24 21:09:48 -0400 |
| commit | 2cd1452ff1dd9813cedb15ee18bf9a84e0baaf84 (patch) | |
| tree | 257a13c3c1ff5752d872a6da5292ab7f551f7699 /ShiftOS.Frontend/Apps | |
| parent | 5ab60d77068edce177841e94b8260e1a40231730 (diff) | |
| download | shiftos_thereturn-2cd1452ff1dd9813cedb15ee18bf9a84e0baaf84.tar.gz shiftos_thereturn-2cd1452ff1dd9813cedb15ee18bf9a84e0baaf84.tar.bz2 shiftos_thereturn-2cd1452ff1dd9813cedb15ee18bf9a84e0baaf84.zip | |
Fucking fuckrape the motherfucking winforms proj
Diffstat (limited to 'ShiftOS.Frontend/Apps')
| -rw-r--r-- | ShiftOS.Frontend/Apps/Terminal.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/ShiftOS.Frontend/Apps/Terminal.cs b/ShiftOS.Frontend/Apps/Terminal.cs index aea246e..b425063 100644 --- a/ShiftOS.Frontend/Apps/Terminal.cs +++ b/ShiftOS.Frontend/Apps/Terminal.cs @@ -152,6 +152,8 @@ namespace ShiftOS.Frontend.Apps Invalidate(); } + public bool ReadOnly = false; + /// <summary> /// Gets the X and Y coordinates (in pixels) of the caret. /// </summary> @@ -194,8 +196,17 @@ namespace ShiftOS.Frontend.Apps protected override void OnKeyEvent(KeyEvent a) { - if (a.Key == Keys.Enter) + if (a.Key == Keys.Enter && !ReadOnly) { + if (!PerformTerminalBehaviours) + { + Text = Text.Insert(Index, Environment.NewLine); + Index+=2; + RecalculateLayout(); + Invalidate(); + return; + } + try { if (!TerminalBackend.PrefixEnabled) @@ -249,7 +260,7 @@ namespace ShiftOS.Frontend.Apps } } - else if (a.Key == Keys.Back) + else if (a.Key == Keys.Back && !ReadOnly) { try { @@ -320,7 +331,7 @@ namespace ShiftOS.Frontend.Apps } else { - if (TerminalBackend.InStory) + if ((PerformTerminalBehaviours && TerminalBackend.InStory) || ReadOnly) { return; } @@ -428,7 +439,7 @@ namespace ShiftOS.Frontend.Apps var measure = gfx.MeasureString(s, font, width, textformat); if (string.IsNullOrEmpty(s)) measure.Width = 0; - return new SizeF((float)Math.Ceiling(measure.Width), (float)Math.Ceiling(measure.Height)); + return new SizeF((float)Math.Ceiling(Math.Max(1,measure.Width)), (float)Math.Ceiling(Math.Max(1,measure.Height))); } public static SizeF SmartMeasureString(this Graphics gfx, string s, Font font) |
