Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2360 - v2 View re-architecture.. #2361

Merged
merged 85 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
9171afb
view2 WIP
tig Feb 17, 2023
d006d02
view2 WIP mostly working
tig Feb 20, 2023
cec325d
merge
tig Feb 20, 2023
af41c59
Merge branch 'v2' into v2_view2_experiment
tig Feb 20, 2023
6613c39
Merge branch 'v2' into v2_view2_experiment
tig Feb 21, 2023
7d7537e
unit tests pass; view2 stuff still broken
tig Feb 21, 2023
7c08652
new Frame stuff working
tig Feb 21, 2023
4bbd359
Removed a ton of code
tig Feb 21, 2023
b2865d2
Comments and some cleanup
tig Feb 21, 2023
674dc93
Updated view spec. Still a WIP and WRONG in a few ways
tig Feb 21, 2023
57cd5ff
Fixed broken Dialog scenario and other issues
tig Feb 22, 2023
214fe97
Diagnostic padding and ruler
tig Feb 22, 2023
16f8ab8
WIP - futzing with different layout math ideas
tig Feb 24, 2023
d7b1192
Merge branch 'v2' into v2_view2_experiment
tig Feb 25, 2023
5826321
WIP - currently broken after merge
tig Feb 25, 2023
9a18e30
merged ; pretty broken
tig Mar 7, 2023
d62bcb4
still broken
tig Mar 10, 2023
1de683c
still broken - documenting weird behavior
tig Mar 11, 2023
f4aa58e
Got visuals working again
tig Mar 16, 2023
27ca37e
merged v2_develop
tig Mar 17, 2023
6340f48
merge; broken
tig Mar 18, 2023
7f14712
mergeed
tig Mar 18, 2023
73b7a5d
progress
tig Mar 18, 2023
3896276
Fixes bug in MessageBox scenario that is latent in v1
tig Mar 19, 2023
60eb543
removed commented code
tig Mar 19, 2023
2ea0bcb
Merge branch 'v2_toposort_view_ref_subview' into v2_view2_experiment
tig Mar 19, 2023
ca7720f
post merge tweaks
tig Mar 19, 2023
8d0c709
Fixed dialog button alignment
tig Mar 19, 2023
482f553
Fixed dialog box border
tig Mar 19, 2023
2e69bd1
Fixed charmap
tig Mar 19, 2023
70b24a6
Merge branch 'v2_develop' into v2_view2_experiment
tig Mar 19, 2023
280d2f9
Fixed progressbar
tig Mar 19, 2023
5d3b7f3
Updated BordersComparison partially
tig Mar 20, 2023
45c3d08
Got FramesEditor scenario working
tig Mar 20, 2023
b564b44
Comment cleanup
tig Mar 20, 2023
fdf1e0d
Mostly got mouse working
tig Mar 20, 2023
54fc9fc
More progress
tig Mar 20, 2023
292d24c
Updated spec
tig Mar 20, 2023
b6ea0e1
Updated spec more
tig Mar 20, 2023
ee93ac9
Added thickness tests. Updated tests
tig Mar 20, 2023
10971ec
adusted more tests
tig Mar 20, 2023
7919764
merged !!! woot.
tig Mar 20, 2023
1ec5afb
Got new title bar look working
tig Mar 21, 2023
66e2490
merged
tig Mar 22, 2023
38fd0a6
merged
tig Mar 22, 2023
d7c6553
Merge branch 'v2_develop' into v2_view2_experiment
tig Mar 22, 2023
7eb4f4c
merged
tig Mar 22, 2023
371453c
renamed Thickenss.InnerRect to Thickness.Inside
tig Mar 24, 2023
108c0e6
Simplifiede
tig Mar 25, 2023
cb9ce86
Tweaked api docs
tig Mar 25, 2023
6252956
Tweaked view2 spec
tig Mar 26, 2023
584dc27
Fixed layouttests including textdirection
tig Mar 27, 2023
4de48b6
Fixed many tests
tig Mar 27, 2023
503a3e0
Fixed sommeore tests
tig Mar 27, 2023
f7604ed
Fixed issue with border being drawn with focus color vs just title
tig Mar 27, 2023
5615795
Fixed textformatter tests
tig Mar 27, 2023
f81862b
Fixed dialog & messagebox
tig Mar 27, 2023
4956143
Fixed and simplified dialog tests
tig Mar 27, 2023
43d5efc
Fixed Window tests; fixed XML doc errors
tig Mar 27, 2023
1c5fc2d
Fixed Title event test
tig Mar 27, 2023
a312b2a
Fixed Wizard tests
tig Mar 27, 2023
689b752
Fixed Dialog tests and Text tess
tig Mar 28, 2023
29fa28f
Fixed Toplevel & MDI tests
tig Mar 28, 2023
506eb10
Fixed Dim tests
tig Mar 28, 2023
9161e03
Fixed AxisTests
tig Mar 28, 2023
f387a8a
Fixed PathAnnotationsTests
tig Mar 28, 2023
259ae0e
Fixed SeriesTests
tig Mar 28, 2023
fa87e6d
Fixed TreeTests
tig Mar 28, 2023
824e6c2
Fixed TextAnnotationsTests
tig Mar 28, 2023
fb09d94
Fixed TextAnnotationsTests
tig Mar 28, 2023
44e371a
Disabled graphview tests
tig Mar 29, 2023
8e88682
Adding absolute layout tests
tig Mar 29, 2023
176e622
merged v2_develop
tig Mar 30, 2023
3b7f4af
Fixed layout test
tig Mar 31, 2023
24155ac
Merge branch 'v2_develop' into v2_view2_experiment
tig Mar 31, 2023
093b80c
broke toplevel tests again
tig Apr 3, 2023
d00b11a
Added and fixed ScrollBarView and ScrollView tests
tig Apr 4, 2023
6de8642
All unit tests PASS!!!
tig Apr 4, 2023
271813f
Working around #2474
tig Apr 4, 2023
82e41a9
Add SpinnerView
tznind Mar 27, 2023
b41bf86
Code formatting
tznind Mar 27, 2023
13bbc6a
Add AutoSpin test
tznind Mar 27, 2023
fe3e159
Avoid ever removing spinner timeout twice
tznind Mar 27, 2023
6209632
Make SpinnerView show/hide instead of stopping
tznind Mar 27, 2023
b7c29b0
Merge branch 'v2_develop' into v2_view2_experiment
tig Apr 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Example/Example.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<!-- Version numbers are automatically updated by gitversion when a release is released -->
<!-- In the source tree the version will always be 1.0 for all projects. -->
<!-- Do not modify these. -->
Expand Down
2 changes: 1 addition & 1 deletion ReactiveExample/ReactiveExample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<!-- Version numbers are automatically updated by gitversion when a release is released -->
<!-- In the source tree the version will always be 2.0 for all projects. -->
<!-- Do not modify these. -->
Expand Down
2 changes: 2 additions & 0 deletions Terminal.Gui/ClassDiagram1.cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />
5 changes: 4 additions & 1 deletion Terminal.Gui/ConsoleDrivers/CursesDriver/binding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,10 @@ static public int IsAlt (int key)
static public int set_escdelay (int size) => methods.set_escdelay (size);
}

#pragma warning disable RCS1102 // Make class static.
#pragma warning disable RCS1102 // Make class static.'
internal class Delegates {
#pragma warning restore RCS1102 // Make class static.
#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
public delegate IntPtr initscr ();
public delegate int endwin ();
public delegate bool isendwin ();
Expand Down Expand Up @@ -555,4 +556,6 @@ public NativeMethods (UnmanagedLibrary lib)
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.

}
35 changes: 23 additions & 12 deletions Terminal.Gui/Core/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,15 @@ static View FindDeepestMdiView (View start, int x, int y, out int resx, out int
return start;
}

/// <summary>
/// Finds the deepest view at the specified coordinates, specified relative to <paramref name="start"/>'s superview.
/// </summary>
/// <param name="start"></param>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="resx"></param>
/// <param name="resy"></param>
/// <returns></returns>
static View FindDeepestView (View start, int x, int y, out int resx, out int resy)
{
var startFrame = start.Frame;
Expand All @@ -680,12 +689,11 @@ static View FindDeepestView (View start, int x, int y, out int resx, out int res
resy = 0;
return null;
}

if (start.InternalSubviews != null) {
int count = start.InternalSubviews.Count;
if (count > 0) {
var rx = x - startFrame.X;
var ry = y - startFrame.Y;
var rx = x - (startFrame.X + start.GetBoundsOffset ().X);
var ry = y - (startFrame.Y + start.GetBoundsOffset ().Y);
for (int i = count - 1; i >= 0; i--) {
View v = start.InternalSubviews [i];
if (v.Visible && v.Frame.Contains (rx, ry)) {
Expand Down Expand Up @@ -826,10 +834,11 @@ static void ProcessMouseEvent (MouseEvent me)

var view = FindDeepestView (Current, me.X, me.Y, out int rx, out int ry);

if (view != null && view.WantContinuousButtonPressed)
if (view != null && view.WantContinuousButtonPressed) {
WantContinuousButtonPressedView = view;
else
} else {
WantContinuousButtonPressedView = null;
}
if (view != null) {
me.View = view;
}
Expand All @@ -842,7 +851,7 @@ static void ProcessMouseEvent (MouseEvent me)
if (mouseGrabView != null) {
view ??= mouseGrabView;

var newxy = mouseGrabView.ScreenToView (me.X, me.Y);
var newxy = mouseGrabView.ScreenToBounds (me.X, me.Y);
var nme = new MouseEvent () {
X = newxy.X,
Y = newxy.Y,
Expand Down Expand Up @@ -1045,8 +1054,9 @@ public static RunState Begin (Toplevel toplevel)
}

Driver.PrepareToRun (MainLoop, ProcessKeyEvent, ProcessKeyDownEvent, ProcessKeyUpEvent, ProcessMouseEvent);
if (toplevel.LayoutStyle == LayoutStyle.Computed)
if (toplevel.LayoutStyle == LayoutStyle.Computed) {
toplevel.SetRelativeLayout (new Rect (0, 0, Driver.Cols, Driver.Rows));
}
toplevel.LayoutSubviews ();
toplevel.PositionToplevels ();
toplevel.WillPresent ();
Expand Down Expand Up @@ -1261,7 +1271,7 @@ public static void RunMainLoopIteration (ref RunState state, bool wait, ref bool
firstIteration = false;

if (state.Toplevel != Top
&& (!Top.NeedDisplay.IsEmpty || Top.ChildNeedsDisplay || Top.LayoutNeeded)) {
&& (!Top._needsDisplay.IsEmpty || Top._childNeedsDisplay || Top.LayoutNeeded)) {
Top.Redraw (Top.Bounds);
foreach (var top in toplevels.Reverse ()) {
if (top != Top && top != state.Toplevel) {
Expand All @@ -1273,13 +1283,14 @@ public static void RunMainLoopIteration (ref RunState state, bool wait, ref bool
}
if (toplevels.Count == 1 && state.Toplevel == Top
&& (Driver.Cols != state.Toplevel.Frame.Width || Driver.Rows != state.Toplevel.Frame.Height)
&& (!state.Toplevel.NeedDisplay.IsEmpty || state.Toplevel.ChildNeedsDisplay || state.Toplevel.LayoutNeeded)) {
&& (!state.Toplevel._needsDisplay.IsEmpty || state.Toplevel._childNeedsDisplay || state.Toplevel.LayoutNeeded)) {

Driver.SetAttribute (Colors.TopLevel.Normal);
state.Toplevel.Clear (new Rect (0, 0, Driver.Cols, Driver.Rows));

}
if (!state.Toplevel.NeedDisplay.IsEmpty || state.Toplevel.ChildNeedsDisplay || state.Toplevel.LayoutNeeded

if (!state.Toplevel._needsDisplay.IsEmpty || state.Toplevel._childNeedsDisplay || state.Toplevel.LayoutNeeded
|| MdiChildNeedsDisplay ()) {
state.Toplevel.Redraw (state.Toplevel.Bounds);
if (DebugDrawBounds) {
Expand All @@ -1291,7 +1302,7 @@ public static void RunMainLoopIteration (ref RunState state, bool wait, ref bool
Driver.UpdateCursor ();
}
if (state.Toplevel != Top && !state.Toplevel.Modal
&& (!Top.NeedDisplay.IsEmpty || Top.ChildNeedsDisplay || Top.LayoutNeeded)) {
&& (!Top._needsDisplay.IsEmpty || Top._childNeedsDisplay || Top.LayoutNeeded)) {
Top.Redraw (Top.Bounds);
}
}
Expand Down Expand Up @@ -1320,7 +1331,7 @@ static bool MdiChildNeedsDisplay ()
}

foreach (var top in toplevels) {
if (top != Current && top.Visible && (!top.NeedDisplay.IsEmpty || top.ChildNeedsDisplay || top.LayoutNeeded)) {
if (top != Current && top.Visible && (!top._needsDisplay.IsEmpty || top._childNeedsDisplay || top.LayoutNeeded)) {
MdiTop.SetSubViewNeedsDisplay ();
return true;
}
Expand Down
Loading