mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-23 02:12:14 +00:00
Title text actually centers on resize
(only if your text is set to center)
This commit is contained in:
parent
7d24f19716
commit
b82dfc16ed
1 changed files with 55 additions and 0 deletions
|
@ -515,6 +515,17 @@ namespace ShiftOS.WinForms
|
|||
if(resizing == true)
|
||||
{
|
||||
this.Width += e.X;
|
||||
switch (LoadedSkin.TitleTextCentered)
|
||||
{
|
||||
case false:
|
||||
lbtitletext.Location = new Point(16 + LoadedSkin.TitlebarIconFromSide.X + LoadedSkin.TitleTextLeft.X,
|
||||
LoadedSkin.TitleTextLeft.Y);
|
||||
break;
|
||||
default:
|
||||
lbtitletext.Left = (pnltitle.Width - lbtitletext.Width) / 2;
|
||||
lbtitletext.Top = LoadedSkin.TitleTextLeft.Y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -522,6 +533,17 @@ namespace ShiftOS.WinForms
|
|||
{
|
||||
resizing = false;
|
||||
pnlcontents.Show();
|
||||
switch (LoadedSkin.TitleTextCentered)
|
||||
{
|
||||
case false:
|
||||
lbtitletext.Location = new Point(16 + LoadedSkin.TitlebarIconFromSide.X + LoadedSkin.TitleTextLeft.X,
|
||||
LoadedSkin.TitleTextLeft.Y);
|
||||
break;
|
||||
default:
|
||||
lbtitletext.Left = (pnltitle.Width - lbtitletext.Width) / 2;
|
||||
lbtitletext.Top = LoadedSkin.TitleTextLeft.Y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void pnlleft_MouseMove(object sender, MouseEventArgs e)
|
||||
|
@ -530,6 +552,17 @@ namespace ShiftOS.WinForms
|
|||
{
|
||||
this.Left += e.X;
|
||||
this.Width -= e.X;
|
||||
switch (LoadedSkin.TitleTextCentered)
|
||||
{
|
||||
case false:
|
||||
lbtitletext.Location = new Point(16 + LoadedSkin.TitlebarIconFromSide.X + LoadedSkin.TitleTextLeft.X,
|
||||
LoadedSkin.TitleTextLeft.Y);
|
||||
break;
|
||||
default:
|
||||
lbtitletext.Left = (pnltitle.Width - lbtitletext.Width) / 2;
|
||||
lbtitletext.Top = LoadedSkin.TitleTextLeft.Y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -547,6 +580,17 @@ namespace ShiftOS.WinForms
|
|||
{
|
||||
this.Width += e.X;
|
||||
this.Height += e.Y;
|
||||
switch (LoadedSkin.TitleTextCentered)
|
||||
{
|
||||
case false:
|
||||
lbtitletext.Location = new Point(16 + LoadedSkin.TitlebarIconFromSide.X + LoadedSkin.TitleTextLeft.X,
|
||||
LoadedSkin.TitleTextLeft.Y);
|
||||
break;
|
||||
default:
|
||||
lbtitletext.Left = (pnltitle.Width - lbtitletext.Width) / 2;
|
||||
lbtitletext.Top = LoadedSkin.TitleTextLeft.Y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,6 +601,17 @@ namespace ShiftOS.WinForms
|
|||
this.Width -= e.X;
|
||||
this.Height += e.Y;
|
||||
this.Left += e.X;
|
||||
switch (LoadedSkin.TitleTextCentered)
|
||||
{
|
||||
case false:
|
||||
lbtitletext.Location = new Point(16 + LoadedSkin.TitlebarIconFromSide.X + LoadedSkin.TitleTextLeft.X,
|
||||
LoadedSkin.TitleTextLeft.Y);
|
||||
break;
|
||||
default:
|
||||
lbtitletext.Left = (pnltitle.Width - lbtitletext.Width) / 2;
|
||||
lbtitletext.Top = LoadedSkin.TitleTextLeft.Y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue