From 2d713bbc6c19f2741b5a15402b20e0b5d0b5b236 Mon Sep 17 00:00:00 2001 From: mklingen Date: Tue, 16 Oct 2018 17:45:37 -0400 Subject: [PATCH] move apply button to the top of the options screen --- .../DwarfCorpXNA/GameStates/OptionsState.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/DwarfCorp/DwarfCorpXNA/GameStates/OptionsState.cs b/DwarfCorp/DwarfCorpXNA/GameStates/OptionsState.cs index 9665a855a..d05e6a6cc 100644 --- a/DwarfCorp/DwarfCorpXNA/GameStates/OptionsState.cs +++ b/DwarfCorp/DwarfCorpXNA/GameStates/OptionsState.cs @@ -117,12 +117,18 @@ private void RebuildGui() { Rect = rect, Padding = new Margin(4,4,4,4), - Transparent = true, MinimumSize = new Point(640, 480), - Font = "font10" - }); + Font = "font10", + Background = new TileReference("basic", 0), + BackgroundColor = new Vector4(0, 0, 0, 0.5f), + }); + var topbar = MainPanel.AddChild(new Widget() + { + AutoLayout = AutoLayout.DockTop, + MinimumSize = new Point(0, 36) + }); - CloseButton = MainPanel.AddChild(new Gui.Widgets.Button + CloseButton = topbar.AddChild(new Gui.Widgets.Button { Text = "Close", Font = "font16", @@ -158,10 +164,10 @@ private void RebuildGui() } } }, - AutoLayout = AutoLayout.FloatBottomRight + AutoLayout = AutoLayout.FloatTopLeft }); - MainPanel.AddChild(new Gui.Widgets.Button + topbar.AddChild(new Gui.Widgets.Button { Text = "@options-apply", Font = "font16", @@ -172,8 +178,7 @@ private void RebuildGui() { ConfirmSettings(); }, - AutoLayout = AutoLayout.FloatBottomRight, - OnLayout = s => s.Rect.X -= 128 // Hack to keep it from floating over the other button. + AutoLayout = AutoLayout.FloatTopRight }); TabPanel = MainPanel.AddChild(new Gui.Widgets.TabPanel