mirror of
https://github.com/ShiftOS-Rewind/ShiftOS.git
synced 2025-02-02 13:57:34 +00:00
0a552e3954
It's pretty much done. Pair with DE, and serve hot.
34 lines
1 KiB
C#
34 lines
1 KiB
C#
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace ShiftOS.Engine.WindowManager
|
|
{
|
|
public class ShiftWM
|
|
{
|
|
public ShiftWindow Init(UserControl content, string title, Image icon, bool ShowAsInfobox = false, bool resize = true)
|
|
{
|
|
// Setup Window
|
|
ShiftWindow app = new ShiftWindow();
|
|
app.Text = title;
|
|
app.Title.Text = title;
|
|
app.Width = content.Width + app.left.Width + app.right.Width;
|
|
app.Height = content.Height + app.bottom.Height + app.top.Height;
|
|
|
|
// Icon Setup
|
|
if (icon == null)
|
|
{
|
|
app.programIcon.Hide();
|
|
app.programIcon.Image = Properties.Resources.nullIcon;
|
|
app.Title.Location = new Point(2, 7);
|
|
}
|
|
else app.programIcon.Image = icon;
|
|
|
|
// Setup UC
|
|
content.Parent = app.programContent;
|
|
content.BringToFront();
|
|
content.Dock = DockStyle.Fill;
|
|
app.Show();
|
|
return app;
|
|
}
|
|
}
|
|
}
|