mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
proper titletext
This commit is contained in:
parent
0b175d1332
commit
f887a5ff8a
2 changed files with 17 additions and 1 deletions
|
@ -37,7 +37,7 @@ namespace ShiftOS.Frontend.Apps
|
|||
{
|
||||
if(!FileExists("2:/" + loot.LootName))
|
||||
{
|
||||
var bytes = Hacking.GetLootBytes(loot.PointTo);
|
||||
var bytes = Hacking.GetLootBytes(loot.PointTo);
|
||||
WriteAllBytes($"2:/{loot.LootName}", bytes);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,9 +75,19 @@ namespace ShiftOS.Frontend.Desktop
|
|||
brdr.Text = title;
|
||||
}
|
||||
|
||||
public string GetTitle(IShiftOSWindow win)
|
||||
{
|
||||
var type = win.GetType();
|
||||
var attr = type.GetCustomAttributes(false).FirstOrDefault(x => x is DefaultTitleAttribute) as DefaultTitleAttribute;
|
||||
if (attr != null)
|
||||
return Localization.Parse(attr.Title);
|
||||
return "ShiftOS Window";
|
||||
}
|
||||
|
||||
public override void SetupDialog(IShiftOSWindow win)
|
||||
{
|
||||
var wb = new WindowBorder();
|
||||
wb.Text = GetTitle(win);
|
||||
var ctl = win as GUI.Control;
|
||||
if (ctl.Width < 30)
|
||||
ctl.Width = 30;
|
||||
|
@ -127,7 +137,9 @@ namespace ShiftOS.Frontend.Desktop
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
var wb = new WindowBorder();
|
||||
wb.Text = GetTitle(win);
|
||||
wb.Width = (win as GUI.Control).Width + LoadedSkin.LeftBorderWidth + LoadedSkin.RightBorderWidth;
|
||||
wb.Height = (win as GUI.Control).Height + LoadedSkin.TitlebarHeight + LoadedSkin.BottomBorderWidth;
|
||||
wb.ParentWindow = win;
|
||||
|
@ -256,6 +268,10 @@ namespace ShiftOS.Frontend.Desktop
|
|||
|
||||
protected override void OnLayout(GameTime gameTime)
|
||||
{
|
||||
if (IsFocusedControl || ContainsFocusedControl)
|
||||
{
|
||||
UIManager.BringToFront(this);
|
||||
}
|
||||
int titlebarheight = LoadedSkin.TitlebarHeight;
|
||||
int borderleft = LoadedSkin.LeftBorderWidth;
|
||||
int borderright = LoadedSkin.RightBorderWidth;
|
||||
|
|
Loading…
Reference in a new issue