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 #3750 - MouseEnter/Leave #3751

Merged
merged 99 commits into from
Sep 24, 2024
Merged

Fixes #3750 - MouseEnter/Leave #3751

merged 99 commits into from
Sep 24, 2024

Conversation

tig
Copy link
Collaborator

@tig tig commented Sep 20, 2024

I've decided to rebase v2_2491->Overlapped, which was here:

... onto this PR given this PR is dependent on it. This will make is so there's only one big PR merging into v2_develop.

Fixes

Proposed Changes/Todos

  • Remove temporary code in OnDrawContent and get z-order correct.
  • Enhance Bars scenario to illustrate Popover menu concept
  • Enhance Navigation scenario with ArrangementEditor; like AdornmentEditor makes it wasy to change view settings related to arrangement for testing/demos.
  • Clone Navigation scenario to Arrangement scenario - one for each
  • Implement support for ViewArrangement.Resizable
  • Fix Draw
  • Remove more code from Toplevel - See how far I can get in removing Toplevel allogether without re-doing all the Runnable stuff (for a later PR focused on IRunnable).
  • Fix Add mouse/keyboard resizing of views #2537
  • Update docfx/docs and other API docs
  • Refactor FindDeepestView into GetViewsUnderMouse. -> GetViewsUnderMouse ().LastOrDefault () is equivalent to FindDeepestView
  • Change MouseEnteredView to List <View?>? ViewsUnderMouse
  • Add internal Application.RaiseMouseEnterLeaveEvents () called by OnMouseEvent - manages ViewsUnderMouse and raises events as appropriate.
  • Update Mouse Scenario to really stress GetViewsUnderMouse and events
  • Add more unit tests for GetViewsUnderMouse
  • Re-add demo of wantcontinuousbutton press in Mouse scenario.
  • Remove MouseEvent params from MouseEnter/Leave events; there's no need for them.
  • Determine if MouseEnter should be cancellable. Yes.
  • Enable `HighlightStyle.Hover" <--- @bidisp!
  • Re-enable ViewDiagnostics.Hover
  • Update config.json with more themes and change colors to make prettier
  • Refactor Color handling to exclusively use ColorStrings instead of legacy ColorName values.

For future PRs

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

@BDisp
Copy link
Collaborator

BDisp commented Sep 23, 2024

I think the shadow button shouldn't move to the right, like as it isn't moving to the bottom, when it's pressed. Only the shadow effect should be hidden when the button is pressed. In my opinion the button is always in the same place and only the light is placed on top/left side chaining a shadow on the bottom/right. If the light is projected in others directions the shadows will be propagate accordingly.

Copy link
Collaborator

@BDisp BDisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting reviewing this wit some observations. If necessary I'll will add more.

Terminal.Gui/Application/Application.Mouse.cs Outdated Show resolved Hide resolved
Terminal.Gui/Drawing/Color.Formatting.cs Show resolved Hide resolved
@tig
Copy link
Collaborator Author

tig commented Sep 23, 2024

I think the shadow button shouldn't move to the right, like as it isn't moving to the bottom, when it's pressed. Only the shadow effect should be hidden when the button is pressed. In my opinion the button is always in the same place and only the light is placed on top/left side chaining a shadow on the bottom/right. If the light is projected in others directions the shadows will be propagate accordingly.

My opinion is the current effect looks great.

This was discussed here:

#2144 (comment)

And the code has this comment:

image

It would be trivial to add a CM property to control this, but we'd still need to have a default.

I enabled the effect by default in this PR so that it was in everone's face and we could get good debate going.

The right place to further opine on it is here:

#3493

@BDisp
Copy link
Collaborator

BDisp commented Sep 23, 2024

I already noted that unit tests are extremely slow in this PR.

@tig
Copy link
Collaborator Author

tig commented Sep 23, 2024

I already noted that unit tests are extremely slow in this PR.

Fixed.

@tig tig requested a review from BDisp September 24, 2024 15:55
@BDisp
Copy link
Collaborator

BDisp commented Sep 24, 2024

These two images bellow refer to the same inline data in the GetKeyChar_Shifted_Char_From_UnShifted_Char unit tests. They show different bitwise masks. That why it's showing as not run tests. I think the reason for this is how the bits are set because the KeyCode is a enum using the [Flags] attribute. He may represent a combination of KeyCode values but mustn't have a new variant value. I think this is very strange and that's why the Test Explorer sees it as a new unit test. I commented the others InlineData to only show the one below.

[InlineData ('9', ')', (KeyCode)')' | KeyCode.ShiftMask)]

image

image

@tig tig merged commit d47e765 into gui-cs:v2_develop Sep 24, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment