Skip to content

Commit

Permalink
move apply button to the top of the options screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mklingen committed Oct 16, 2018
1 parent 29d321c commit 2d713bb
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions DwarfCorp/DwarfCorpXNA/GameStates/OptionsState.cs
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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
Expand Down

0 comments on commit 2d713bb

Please sign in to comment.