Title text actually centers on resize

(only if your text is set to center)
This commit is contained in:
william341 2017-05-06 16:11:09 -07:00
parent 7d24f19716
commit b82dfc16ed

View file

@ -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;
}
}
}