mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
enables hiding statusbar
This commit is contained in:
@@ -333,9 +333,9 @@ namespace Terminal.Gui {
|
||||
}
|
||||
ny = Math.Max (y, l);
|
||||
if (SuperView == null || SuperView.GetType () != typeof (Toplevel)) {
|
||||
s = Application.Top.StatusBar != null;
|
||||
s = Application.Top.StatusBar != null && Application.Top.StatusBar.Visible;
|
||||
} else {
|
||||
s = ((Toplevel)SuperView).StatusBar != null;
|
||||
s = ((Toplevel)SuperView).StatusBar != null && ((Toplevel)SuperView).StatusBar.Visible;
|
||||
}
|
||||
if (SuperView == null || SuperView is Toplevel) {
|
||||
l = s ? Driver.Rows - 1 : Driver.Rows;
|
||||
@@ -368,12 +368,12 @@ namespace Terminal.Gui {
|
||||
}
|
||||
}
|
||||
if (top.StatusBar != null) {
|
||||
if (ny + top.Frame.Height > top.Frame.Height - 1) {
|
||||
if (ny + top.Frame.Height > top.Frame.Height - (top.StatusBar.Visible ? 1 : 0)) {
|
||||
if (top.Height is Dim.DimFill)
|
||||
top.Height = Dim.Fill () - 1;
|
||||
top.Height = Dim.Fill () - (top.StatusBar.Visible ? 1 : 0);
|
||||
}
|
||||
if (top.StatusBar.Frame.Y != top.Frame.Height - 1) {
|
||||
top.StatusBar.Y = top.Frame.Height - 1;
|
||||
if (top.StatusBar.Frame.Y != top.Frame.Height - (top.StatusBar.Visible ? 1 : 0)) {
|
||||
top.StatusBar.Y = top.Frame.Height - (top.StatusBar.Visible ? 1 : 0);
|
||||
top.LayoutSubviews ();
|
||||
}
|
||||
top.BringSubviewToFront (top.StatusBar);
|
||||
|
||||
@@ -105,8 +105,8 @@ namespace Terminal.Gui {
|
||||
return delegate {
|
||||
X = 0;
|
||||
Height = 1;
|
||||
if (SuperView == null || SuperView is Toplevel) {
|
||||
Y = SuperView.Frame.Height - 1;
|
||||
if (SuperView != null || SuperView is Toplevel) {
|
||||
Y = SuperView.Frame.Height - (Visible ? 1 : 0);
|
||||
} else {
|
||||
//Y = Pos.Bottom (SuperView);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,10 @@ namespace UICatalog {
|
||||
_numlock = new StatusItem (Key.CharMask, "Num", null);
|
||||
_scrolllock = new StatusItem (Key.CharMask, "Scroll", null);
|
||||
|
||||
_statusBar = new StatusBar (new StatusItem [] {
|
||||
_statusBar = new StatusBar () {
|
||||
Visible = true,
|
||||
};
|
||||
_statusBar.Items = new StatusItem [] {
|
||||
_capslock,
|
||||
_numlock,
|
||||
_scrolllock,
|
||||
@@ -228,7 +231,14 @@ namespace UICatalog {
|
||||
_runningScenario.RequestStop();
|
||||
}
|
||||
}),
|
||||
});
|
||||
new StatusItem(Key.F10, "~F10~ Hide/Show Status Bar", () => {
|
||||
_statusBar.Visible = !_statusBar.Visible;
|
||||
_leftPane.Height = Dim.Fill(_statusBar.Visible ? 1 : 0);
|
||||
_rightPane.Height = Dim.Fill(_statusBar.Visible ? 1 : 0);
|
||||
_top.LayoutSubviews();
|
||||
_top.ChildNeedsDisplay();
|
||||
}),
|
||||
};
|
||||
|
||||
SetColorScheme ();
|
||||
_top = Application.Top;
|
||||
|
||||
Reference in New Issue
Block a user