Skip to content

Commit ce8fe91

Browse files
committed
✨ Resize console in terminal app
1 parent 653417e commit ce8fe91

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

SRC/Aura_OS/Properties/VersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace Aura_OS
22
{
33
public class VersionInfo
44
{
5-
public static string revision = "010320241920";
5+
public static string revision = "010320241932";
66
}
77
}

SRC/Aura_OS/System/Graphics/UI/GUI/Application.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,15 @@ public override void Update()
247247
{
248248
_newX = _firstX - currentX;
249249
int newWidth = Window.Width + _newX;
250-
Window.Resize(newWidth, Window.Height);
250+
ResizeWindow(newWidth, Window.Height);
251251
Window.X = currentX;
252252
}
253253

254254
if (_resizeHeightPressed)
255255
{
256256
_newY = _firstY - currentY;
257257
int newHeight = Window.Height + _newY;
258+
ResizeWindow(Window.Width, newHeight);
258259
Window.Resize(Window.Width, newHeight);
259260
Window.Y = currentY;
260261
}
@@ -300,6 +301,11 @@ public virtual void Draw()
300301
}
301302
}
302303

304+
public virtual void ResizeWindow(int width, int height)
305+
{
306+
Window.Resize(width, height);
307+
}
308+
303309
public bool IsDirty()
304310
{
305311
return _isDirty;

SRC/Aura_OS/System/Graphics/UI/GUI/Components/Console.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public Console(int x, int y, int width, int height) : base(x, y, width, height)
9494
_pallete[14] = 0xFFFFFF55; // Yellow
9595
_pallete[15] = 0xFFFFFFFF; //White
9696

97+
InitConsole(width, height);
98+
}
99+
100+
public void InitConsole(int width, int height)
101+
{
97102
mCols = width / Kernel.font.Width - 1;
98103
mRows = height / Kernel.font.Height - 2;
99104

SRC/Aura_OS/System/Processing/Applications/Terminal/TerminalApp.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@ public override void Draw()
184184
Console.DrawInParent();
185185
}
186186

187+
public override void ResizeWindow(int width, int height)
188+
{
189+
base.ResizeWindow(width, height);
190+
191+
int newWidth = width - 7;
192+
int newHeight = height - Window.TopBar.Height - 9;
193+
194+
Console.Resize(newWidth, newHeight);
195+
Console.InitConsole(newWidth, newHeight);
196+
BeforeCommand();
197+
}
198+
187199
public override void MarkDirty()
188200
{
189201
base.MarkDirty();

0 commit comments

Comments
 (0)