|
@@ -1522,12 +1522,12 @@ namespace Terminal.Gui {
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Check id current toplevel has menu bar
|
|
/// Check id current toplevel has menu bar
|
|
/// </summary>
|
|
/// </summary>
|
|
- public bool HasMenuBar { get; set; }
|
|
|
|
|
|
+ public MenuBar MenuBar { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Check id current toplevel has status bar
|
|
/// Check id current toplevel has status bar
|
|
/// </summary>
|
|
/// </summary>
|
|
- public bool HasStatusBar { get; set; }
|
|
|
|
|
|
+ public StatusBar StatusBar { get; set; }
|
|
|
|
|
|
public override bool ProcessKey (KeyEvent keyEvent)
|
|
public override bool ProcessKey (KeyEvent keyEvent)
|
|
{
|
|
{
|
|
@@ -1584,9 +1584,9 @@ namespace Terminal.Gui {
|
|
{
|
|
{
|
|
if (this == Application.Top) {
|
|
if (this == Application.Top) {
|
|
if (view is MenuBar)
|
|
if (view is MenuBar)
|
|
- HasMenuBar = true;
|
|
|
|
|
|
+ MenuBar = view as MenuBar;
|
|
if (view is StatusBar)
|
|
if (view is StatusBar)
|
|
- HasStatusBar = true;
|
|
|
|
|
|
+ StatusBar = view as StatusBar;
|
|
}
|
|
}
|
|
base.Add (view);
|
|
base.Add (view);
|
|
}
|
|
}
|
|
@@ -1595,9 +1595,9 @@ namespace Terminal.Gui {
|
|
{
|
|
{
|
|
if (this == Application.Top) {
|
|
if (this == Application.Top) {
|
|
if (view is MenuBar)
|
|
if (view is MenuBar)
|
|
- HasMenuBar = true;
|
|
|
|
|
|
+ MenuBar = null;
|
|
if (view is StatusBar)
|
|
if (view is StatusBar)
|
|
- HasStatusBar = true;
|
|
|
|
|
|
+ StatusBar = null;
|
|
}
|
|
}
|
|
base.Remove (view);
|
|
base.Remove (view);
|
|
}
|
|
}
|
|
@@ -1605,8 +1605,8 @@ namespace Terminal.Gui {
|
|
public override void RemoveAll ()
|
|
public override void RemoveAll ()
|
|
{
|
|
{
|
|
if (this == Application.Top) {
|
|
if (this == Application.Top) {
|
|
- HasMenuBar = false;
|
|
|
|
- HasStatusBar = false;
|
|
|
|
|
|
+ MenuBar = null;
|
|
|
|
+ StatusBar = null;
|
|
}
|
|
}
|
|
base.RemoveAll ();
|
|
base.RemoveAll ();
|
|
}
|
|
}
|
|
@@ -1617,15 +1617,15 @@ namespace Terminal.Gui {
|
|
nx = nx + top.Frame.Width > Driver.Cols ? Math.Max(Driver.Cols - top.Frame.Width, 0) : nx;
|
|
nx = nx + top.Frame.Width > Driver.Cols ? Math.Max(Driver.Cols - top.Frame.Width, 0) : nx;
|
|
bool m, s;
|
|
bool m, s;
|
|
if (SuperView == null)
|
|
if (SuperView == null)
|
|
- m = Application.Top.HasMenuBar;
|
|
|
|
|
|
+ m = Application.Top.MenuBar != null;
|
|
else
|
|
else
|
|
- m = ((Toplevel)SuperView).HasMenuBar;
|
|
|
|
|
|
+ m = ((Toplevel)SuperView).MenuBar != null;
|
|
int l = m ? 1 : 0;
|
|
int l = m ? 1 : 0;
|
|
ny = Math.Max (y, l);
|
|
ny = Math.Max (y, l);
|
|
if (SuperView == null)
|
|
if (SuperView == null)
|
|
- s = Application.Top.HasStatusBar;
|
|
|
|
|
|
+ s = Application.Top.StatusBar != null;
|
|
else
|
|
else
|
|
- s = ((Toplevel)SuperView).HasStatusBar;
|
|
|
|
|
|
+ s = ((Toplevel)SuperView).StatusBar != null;
|
|
l = s ? Driver.Rows - 1 : Driver.Rows;
|
|
l = s ? Driver.Rows - 1 : Driver.Rows;
|
|
ny = Math.Min (ny, l);
|
|
ny = Math.Min (ny, l);
|
|
ny = ny + top.Frame.Height > l ? Math.Max(l - top.Frame.Height, m ? 1 : 0) : ny;
|
|
ny = ny + top.Frame.Height > l ? Math.Max(l - top.Frame.Height, m ? 1 : 0) : ny;
|
|
@@ -1647,9 +1647,15 @@ namespace Terminal.Gui {
|
|
top.X = nx;
|
|
top.X = nx;
|
|
top.Y = ny;
|
|
top.Y = ny;
|
|
}
|
|
}
|
|
- if (HasStatusBar && ny + top.Frame.Height > Driver.Rows - 1) {
|
|
|
|
- if (top.Height is Dim.DimFill)
|
|
|
|
- top.Height = Dim.Fill () - 1;
|
|
|
|
|
|
+ if (StatusBar != null) {
|
|
|
|
+ if (ny + top.Frame.Height > Driver.Rows - 1) {
|
|
|
|
+ if (top.Height is Dim.DimFill)
|
|
|
|
+ top.Height = Dim.Fill () - 1;
|
|
|
|
+ }
|
|
|
|
+ if (StatusBar.Frame.Y != Driver.Rows - 1) {
|
|
|
|
+ StatusBar.Y = Driver.Rows - 1;
|
|
|
|
+ SetNeedsDisplay ();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|