mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Fix windows scaling for tool
This commit is contained in:
parent
06af62fe39
commit
d39ca57044
8 changed files with 13 additions and 16 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -55,7 +55,6 @@ namespace Switch_Toolbox.Library.Forms
|
|||
private const int WM_NCHITTEST = 0x84;
|
||||
protected STPanel contentContainer;
|
||||
private const int WM_NCLBUTTONDOWN = 0xa1;
|
||||
private const int WM_NCLBUTTONDBLCLK = 0x00A3; //double click on a title bar a.k.a. non-client area of the form
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
|
||||
|
@ -146,7 +145,6 @@ namespace Switch_Toolbox.Library.Forms
|
|||
this.LblTitle.Size = new System.Drawing.Size(33, 17);
|
||||
this.LblTitle.TabIndex = 5;
|
||||
this.LblTitle.Text = "Title";
|
||||
this.LblTitle.DoubleClick += new System.EventHandler(this.TitleBar_DoubleClick);
|
||||
this.LblTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TitleBar_MouseDown);
|
||||
//
|
||||
// PicIcon
|
||||
|
@ -238,11 +236,11 @@ namespace Switch_Toolbox.Library.Forms
|
|||
}
|
||||
public void Maximize()
|
||||
{
|
||||
MaximumSize = Screen.FromControl(this).WorkingArea.Size;
|
||||
WindowState = FormWindowState.Maximized;
|
||||
|
||||
if (IsMdiChild)
|
||||
MDIMaximized();
|
||||
|
||||
MaximumSize = Screen.FromControl(this).WorkingArea.Size;
|
||||
WindowState = FormWindowState.Maximized;
|
||||
}
|
||||
private void CheckWindowState()
|
||||
{
|
||||
|
@ -277,7 +275,6 @@ namespace Switch_Toolbox.Library.Forms
|
|||
private void BtnClose_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
Close();
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
private void BtnClose_MouseEnter(object sender, System.EventArgs e)
|
||||
|
@ -313,7 +310,7 @@ namespace Switch_Toolbox.Library.Forms
|
|||
|
||||
private void TitleBar_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left && e.Y < 28 && e.Clicks < 2)
|
||||
if (e.Button == MouseButtons.Left && e.Y < 28)
|
||||
{
|
||||
ReleaseCapture();
|
||||
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
|
||||
|
@ -425,9 +422,6 @@ namespace Switch_Toolbox.Library.Forms
|
|||
{
|
||||
base.WndProc(ref message);
|
||||
|
||||
if (message.Msg == WM_NCLBUTTONDBLCLK)
|
||||
return;
|
||||
|
||||
if (message.Msg == WM_NCHITTEST && CanResize && WindowState == FormWindowState.Normal)
|
||||
{
|
||||
int x = message.LParam.ToInt32() & 0xffff;
|
||||
|
@ -451,4 +445,4 @@ namespace Switch_Toolbox.Library.Forms
|
|||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ namespace Switch_Toolbox.Library.Forms
|
|||
{
|
||||
BackColor = FormThemes.BaseTheme.TextBackColor;
|
||||
ForeColor = FormThemes.BaseTheme.TextForeColor;
|
||||
AutoSize = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,9 @@ namespace Switch_Toolbox.Library.Rendering
|
|||
{
|
||||
// Make a permanent context to share resources.
|
||||
GraphicsContext.ShareContexts = true;
|
||||
dummyResourceWindow = CreateGameWindowContext();
|
||||
var control = new OpenTK.GLControl();
|
||||
control.MakeCurrent();
|
||||
// dummyResourceWindow = CreateGameWindowContext();
|
||||
|
||||
if (Runtime.enableOpenTKDebugOutput)
|
||||
EnableOpenTKDebugOutput();
|
||||
|
|
|
@ -103,10 +103,10 @@ namespace Toolbox
|
|||
|
||||
Runtime.OpenTKInitialized = true;
|
||||
|
||||
// Runtime.renderer = GL.GetString(StringName.Renderer);
|
||||
// Runtime.openGLVersion = GL.GetString(StringName.Version);
|
||||
// Runtime.GLSLVersion = GL.GetString(StringName.ShadingLanguageVersion);
|
||||
// ParseGLVersion();
|
||||
Runtime.renderer = GL.GetString(StringName.Renderer);
|
||||
Runtime.openGLVersion = GL.GetString(StringName.Version);
|
||||
Runtime.GLSLVersion = GL.GetString(StringName.ShadingLanguageVersion);
|
||||
ParseGLVersion();
|
||||
}
|
||||
|
||||
LoadPLugins();
|
||||
|
|
Loading…
Reference in a new issue