aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-08-02 11:14:29 -0400
committerMichael <[email protected]>2017-08-02 11:14:29 -0400
commitf887a5ff8a284bf446ed4e66f6c27657c3ea6aff (patch)
treedb598b0b20e09c3ac9ade4037984f512ac2c4e26
parent0b175d13327aa0e60811cb062c5cb25e52916cf8 (diff)
downloadshiftos_thereturn-f887a5ff8a284bf446ed4e66f6c27657c3ea6aff.tar.gz
shiftos_thereturn-f887a5ff8a284bf446ed4e66f6c27657c3ea6aff.tar.bz2
shiftos_thereturn-f887a5ff8a284bf446ed4e66f6c27657c3ea6aff.zip
proper titletext
-rw-r--r--ShiftOS.Frontend/Apps/FileSkimmer.cs2
-rw-r--r--ShiftOS.Frontend/Desktop/WindowManager.cs16
2 files changed, 17 insertions, 1 deletions
diff --git a/ShiftOS.Frontend/Apps/FileSkimmer.cs b/ShiftOS.Frontend/Apps/FileSkimmer.cs
index 672446c..9249595 100644
--- a/ShiftOS.Frontend/Apps/FileSkimmer.cs
+++ b/ShiftOS.Frontend/Apps/FileSkimmer.cs
@@ -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);
}
}
diff --git a/ShiftOS.Frontend/Desktop/WindowManager.cs b/ShiftOS.Frontend/Desktop/WindowManager.cs
index 23769bf..b130b03 100644
--- a/ShiftOS.Frontend/Desktop/WindowManager.cs
+++ b/ShiftOS.Frontend/Desktop/WindowManager.cs
@@ -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;