mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 00:07:58 +01:00
Enabled ViewArrangement.Overlapped zorder hack
This commit is contained in:
@@ -501,16 +501,31 @@ public partial class View // Drawing APIs
|
||||
// TODO: Implement OnDrawSubviews (cancelable);
|
||||
if (_subviews is { } && SubViewNeedsDisplay)
|
||||
{
|
||||
IEnumerable<View> subviewsNeedingDraw = _subviews.Where (
|
||||
view => view.Visible
|
||||
&& (view.NeedsDisplay || view.SubViewNeedsDisplay || view.LayoutNeeded)
|
||||
);
|
||||
IEnumerable<View> subviewsNeedingDraw;
|
||||
if (TabStop == TabBehavior.TabGroup && _subviews.Count(v => v.Arrangement.HasFlag (ViewArrangement.Overlapped)) > 0)
|
||||
{
|
||||
// TODO: This is a temporary hack to make overlapped non-Toplevels have a zorder. See also View.SetFocus
|
||||
subviewsNeedingDraw = _tabIndexes.Where (
|
||||
view => view.Visible
|
||||
&& (view.NeedsDisplay || view.SubViewNeedsDisplay || view.LayoutNeeded)
|
||||
).Reverse ();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
subviewsNeedingDraw = _subviews.Where (
|
||||
view => view.Visible
|
||||
&& (view.NeedsDisplay || view.SubViewNeedsDisplay || view.LayoutNeeded)
|
||||
);
|
||||
|
||||
}
|
||||
foreach (View view in subviewsNeedingDraw)
|
||||
{
|
||||
if (view.LayoutNeeded)
|
||||
{
|
||||
view.LayoutSubviews ();
|
||||
}
|
||||
|
||||
view.Draw ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,6 +605,13 @@ public partial class View // Focus and cross-view navigation management (TabStop
|
||||
// If there is no SuperView, then this is a top-level view
|
||||
SetFocus (this);
|
||||
}
|
||||
|
||||
// TODO: This is a temporary hack to make overlapped non-Toplevels have a zorder. See also: View.OnDrawContent.
|
||||
if (viewToEnterFocus is { } && (viewToEnterFocus.TabStop == TabBehavior.TabGroup && viewToEnterFocus.Arrangement.HasFlag (ViewArrangement.Overlapped)))
|
||||
{
|
||||
viewToEnterFocus.TabIndex = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user