mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Fixes #698 StatusBar position on resizing. * Changed to LayoutComplete in StatusBar.
This commit is contained in:
@@ -269,31 +269,28 @@ namespace Terminal.Gui {
|
||||
|
||||
internal void PositionToplevels ()
|
||||
{
|
||||
if (this != Application.Top) {
|
||||
EnsureVisibleBounds (this, Frame.X, Frame.Y, out int nx, out int ny);
|
||||
if ((nx != Frame.X || ny != Frame.Y) && LayoutStyle != LayoutStyle.Computed) {
|
||||
X = nx;
|
||||
Y = ny;
|
||||
foreach (var top in Subviews) {
|
||||
if (top is Toplevel) {
|
||||
PositionToplevel ((Toplevel)top);
|
||||
}
|
||||
} else {
|
||||
foreach (var top in Subviews) {
|
||||
if (top is Toplevel) {
|
||||
EnsureVisibleBounds ((Toplevel)top, top.Frame.X, top.Frame.Y, out int nx, out int ny);
|
||||
if ((nx != top.Frame.X || ny != top.Frame.Y) && top.LayoutStyle != LayoutStyle.Computed) {
|
||||
top.X = nx;
|
||||
top.Y = ny;
|
||||
}
|
||||
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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void PositionToplevel (Toplevel top)
|
||||
{
|
||||
EnsureVisibleBounds (top, top.Frame.X, top.Frame.Y, out int nx, out int ny);
|
||||
if ((nx != top.Frame.X || ny != top.Frame.Y) && top.LayoutStyle != LayoutStyle.Computed) {
|
||||
top.X = nx;
|
||||
top.Y = ny;
|
||||
}
|
||||
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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,6 +308,7 @@ namespace Terminal.Gui {
|
||||
// (the bounds passed to us).
|
||||
Clear (bounds);
|
||||
Driver.SetAttribute (Colors.Base.Normal);
|
||||
PositionToplevels ();
|
||||
}
|
||||
foreach (var view in Subviews) {
|
||||
if (view.Frame.IntersectsWith (bounds)) {
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Terminal.Gui {
|
||||
Width = Dim.Fill ();
|
||||
Height = 1;
|
||||
|
||||
Application.Resized += (e) => {
|
||||
LayoutComplete += (e) => {
|
||||
X = 0;
|
||||
Height = 1;
|
||||
if (SuperView == null || SuperView == Application.Top) {
|
||||
|
||||
Reference in New Issue
Block a user