aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-07-19 22:09:04 -0400
committerMichael <[email protected]>2017-07-19 22:09:04 -0400
commit5ab60d77068edce177841e94b8260e1a40231730 (patch)
tree6129ebbddd9c24d9c2852b3661d23dbdada6f800
parent90f0e64d8017e8ef2d241e21c14aa19a6cce152b (diff)
downloadshiftos_thereturn-5ab60d77068edce177841e94b8260e1a40231730.tar.gz
shiftos_thereturn-5ab60d77068edce177841e94b8260e1a40231730.tar.bz2
shiftos_thereturn-5ab60d77068edce177841e94b8260e1a40231730.zip
Focus a control when it's added to a parent.HEADwinforms
-rw-r--r--ShiftOS.Frontend/GUI/Control.cs1
-rw-r--r--ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs2
2 files changed, 2 insertions, 1 deletions
diff --git a/ShiftOS.Frontend/GUI/Control.cs b/ShiftOS.Frontend/GUI/Control.cs
index b78f032..4d05470 100644
--- a/ShiftOS.Frontend/GUI/Control.cs
+++ b/ShiftOS.Frontend/GUI/Control.cs
@@ -240,6 +240,7 @@ namespace ShiftOS.Frontend.GUI
ctrl._parent = this;
_children.Add(ctrl);
Invalidate();
+ UIManager.FocusedControl = ctrl;
}
}
diff --git a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs
index d16685b..4ec1292 100644
--- a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs
+++ b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs
@@ -135,7 +135,7 @@ namespace ShiftOS.Frontend.GraphicsSubsystem
{
if (!topLevels.Contains(ctrl))
topLevels.Add(ctrl);
-
+ FocusedControl = ctrl;
}
public static void InvalidateAll()