Skip to content

Commit

Permalink
🐛 Fix OK dialog button
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinbreiz committed Feb 28, 2024
1 parent 6f8d3d8 commit c089ad5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 63 deletions.
2 changes: 1 addition & 1 deletion SRC/Aura_OS/Properties/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ namespace Aura_OS
{
public class VersionInfo
{
public static string revision = "280220241720";
public static string revision = "280220241724";
}
}
52 changes: 1 addition & 51 deletions SRC/Aura_OS/System/Graphics/UI/GUI/Dialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Aura_OS.System.Graphics.UI.GUI.Components;
using Cosmos.System;
using Cosmos.System.Graphics;
using Aura_OS.System.Graphics.UI.GUI.Components;

namespace Aura_OS.System.Graphics.UI.GUI
{
Expand All @@ -20,12 +18,6 @@ internal class Dialog : Window
private List<Button> _buttons;
private Bitmap AlertIcon;

private int _px;
private int _py;
private bool _lck = false;
private bool _pressed;
private bool _hasWindowMoving = false;

public Dialog(string title, string message, int x, int y) : base(title, x, y, 302, 119, false, false)
{
_title = title;
Expand Down Expand Up @@ -55,48 +47,6 @@ public void AddButton(string buttonText, Action onClickAction)
AddChild(newButton);
}

public override void Update()
{
base.Update();

if (Kernel.MouseManager.IsLeftButtonDown)
{
if (!_hasWindowMoving && Close.IsInside((int)MouseManager.X, (int)MouseManager.Y))
{
Close.Click();

return;
}
else if (!_hasWindowMoving && TopBar.IsInside((int)MouseManager.X, (int)MouseManager.Y))
{
_hasWindowMoving = true;

_pressed = true;
if (!_lck)
{
_px = (int)MouseManager.X - X;
_py = (int)MouseManager.Y - Y;
_lck = true;
}
}
}
else
{
_pressed = false;
_lck = false;
_hasWindowMoving = false;
}

if (_pressed)
{
X = (int)(MouseManager.X - _px);
Y = (int)(MouseManager.Y - _py);

X = (int)(MouseManager.X - _px + 3);
Y = (int)(MouseManager.Y - _py + TopBar.Height + 3);
}
}

public override void Draw()
{
base.Draw();
Expand Down
11 changes: 0 additions & 11 deletions SRC/Aura_OS/System/Processing/Applications/EditorApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,6 @@ public EditorApp(string filePath, int width, int height, int x = 0, int y = 0)
}
MarkDirty();
}));
_dialog.Close.Click = new Action(() =>
{
_showDialog = false;
_dialog.Visible = false;

foreach (var child in Window.Children)
{
child.MarkDirty();
}
MarkDirty();
});
AddChild(_dialog);
}

Expand Down

0 comments on commit c089ad5

Please sign in to comment.