-
Notifications
You must be signed in to change notification settings - Fork 703
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
Partially Adresses #2491. Refactors how Focus
works
#3627
Conversation
ViewArrangement.Overlapped
, refactors and beefs up Application
and Toplevel
…work in some edge cases. This will require re-visiting the design at a deep level and fixing some long-standing but ignored issues such as how OnEnter/OnLeave don't follow proper cancelation design. Also, there's a need for keeping track of the old focus state of a tree of subviews when that tree loses focus; FocusDireciton is a hack that causes tons of confusion.
@BDisp I would very much appreciate you reviewing the new You may also want to pull down the latest code and play with Thanks. |
ViewArrangement.Overlapped
, refactors and beefs up Application
and Toplevel
Focus
works
Progess on thinking through new design, but not working yet.
Change the title please, otherwise it will close the issue when merged. |
Focus
worksFocus
works
We're missing SetLayoutNeeded or LayoutSubviews somewhere. |
IIRC, I think I suspected it was someting to do with SubViewsNeedsLayout not getting set right. The logic of all of that is pretty complex. |
Feel you, I do. ...Why does that sound so much worse than "I feel you?" I half wanted to put a 😏 on it.1 Footnotes
|
Oh forgot to say... Yeah, I'll take a final pass over it after all your revisions, in case anything significant sticks out, which I'm starting as soon as I grab a source of caffeine. Huge it definitely is, so it'll likely be a couple hours before I'm finished, simply to just read it all. Loving the work. Focus was one of my biggest gripes from the before times, and this is a huge improvement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not finding any show-stoppers after getting down to TabView.cs.
But it's time for me to hit the hay.
Biggest issues I do see are some pretty obvious performance issues like lines 323 through 325 of ComboBox.cs, where a collection is enumerated multiple times (up to 6 in the worst case). To be fair, that isn't newly broken, so I didn't comment on that and other similar things in-line that weren't actually changed in this PR aside from formatting.
But.
Can you at least drop a // PERF: Fix this
comment or something at the top of OnHasFocusChanged on Line 308 of ComboBox.cs so it doesn't get overlooked later? That one in particular is just being needlessly cruel to the runtime.
There was one little syntax clarity tip I dropped in there, though, to demonstrate an alternative.
I'm gonna say, at this point, unless you want me to finish with the rest tomorrow, which is almost entirely test code, that it looks a'ight to me, with both the "@dodexahedron is bailing for the night" and the "@tig's bored of this one" understanding. 😅
Fixed some overlapped stuff while on a flight. Not really in scope for this PR, but making progress against #2491. Lots to do to make it all work exactly right, but its promising. With far less code than was required to support overlapped in v1. |
@@ -35,7 +35,7 @@ dotnet run | |||
* [API Documentation](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.html) | |||
* [Documentation Home](https://gui-cs.github.io/Terminal.GuiV2Docs) | |||
|
|||
_The Documentation matches the most recent Nuget release from the `v2_develop` branch. The documentation for v1 is here: ([](https://www.nuget.org/packages/Terminal.Gui))_ | |||
The above documentation matches the most recent Nuget release from the `v2_develop` branch. Get the [v1 documentation here](This is the v2 API documentation. For v1 go here: https://gui-cs.github.io/Terminal.Gui/api/Terminal.Gui.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The markdown is still broken.
Format for a URL is [text you want](url)
[v1 documentation here](This is the v2 API documentation. For v1 go here: https://gui-cs.github.io/Terminal.Gui/api/Terminal.Gui.html)
is invalid markdown
This PR paves the way for fixing #2491 by addressing deep design and implementation problems with how
Focus
currently works.This PR used to be way more ambitions... it was going to eventually fully enable any View to work
Overlapped
, removing the need forToplevel
andIsOverlappedContainer
. That will now come later.Fixes
Focus
works.Toplevel
- IntroduceRunnable
andOverlapped
instead #2491Tabindex
andTabIndexes
in v2 #3669ShadowStyle.Transparent
is not rendering bottom-left corner correctly #3645Proposed Changes/Todos
ViewArrangement.Overlapped
will work. UseTabIndexes
and all theView.NextView
focus stuff for navigation (instead of the code inOverlappedMoveNext
). Use theSubview
ordering (for just the subviews with ViewArrangement.Overlapped` set) to manage the z-order.View
#nullable enable
View Experiments
scenario ->Navigation Tester
TabView
Scenario - above item may addressWizards
- above item may addressPull Request checklist:
CTRL-K-D
to automatically reformat your files before committing.dotnet test
before commit///
style comments)