Fixes #4502. Shadows in overlapping views are not rendered consistently (#4465)

* Fixes Wide Glyphs

* Fix some unit tests failure

* Fix more unit tests

* Fixes #4468 - `MouseGrab` regressions (#4469)

* Fixed mouse grab issue

* Fixed mouse grab regrssions.

* Update Terminal.Gui/ViewBase/View.Mouse.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/View.Mouse.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/View.Mouse.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/View.Mouse.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/View.Mouse.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/View.Mouse.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* code cleanup

* Update Terminal.Gui/ViewBase/View.Mouse.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Addressing pr feedback

* updated mouse.md

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4050. Rename Command.Select and Selecting to Activate/Activating (#4470)

* Initial plan

* Rename Command.Select to Command.Activate and Selecting to Activating

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Add Activating event propagation to SuperView

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update all comments and docs referencing Select to Activate

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix event log messages in examples to use Activating/Activate

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Revert automatic Activating event propagation that broke tests

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update docfx documentation to use Activate/Activating terminology

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* renames

* Revert "Add Activating event propagation to SuperView"

This reverts commit 6d82bee9ad.

* added command diagrams

* mermaid

* updated level 3

* again

* Select->Activate in MouseTests.cs

* Update Terminal.Gui/Views/Selectors/FlagSelector.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Refactor: Rename Selecting to Activating in View APIs

Renamed the `Selecting` event and `OnSelecting` method to
`Activating` and `OnActivating` to better reflect their purpose.
Updated all related comments, test method names, variables,
and assertions in `View` and `ViewCommandTests` to align with
the new terminology.

Improved code clarity by using `_` for unused parameters in
lambda expressions. Renamed properties like `HandleSelecting`
to `HandleActivating` and adjusted naming conventions for
consistency (e.g., `OnactivatingCount` to `OnActivatingCount`).

These changes enhance readability, maintainability, and
terminology consistency across the codebase.

* Update Terminal.Gui/Views/Selectors/OptionSelector.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Typos

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add support for wide glyphs into the ShadowStyle.Transparent

* The "IsDirty" content of the wide glyphs should be completely false after being displayed on the screen.

* FillRect must always call AddStr method to properly handle wide characters to invalidate overlapped wide glyphs, etc.

* We must set clip to the driver screen in the case where the view isn't Adornment and SuperView is null, allowing dialogs, popovers, etc to be drawn

* These assertions are important to ensure that the drawing state is consistent

* Subviews must be drawn after the superview content being drawn

* The attribute of next column of a wide glyph should be the same if it's in the clipped area

* Applied #4486

* Updated root view clipping logic to use App's screen or a large default rectangle, ensuring proper drawing area. Added comments clarifying subview drawing order and explaining issues with certain Debug.Assert checks in complex hierarchies, suggesting unit tests instead.

* Remove ClearFrame and always draw Margin if Thickness set

Removed the unused ClearFrame method from the View class. Updated DrawAdornments to always draw the Margin when its Thickness is not empty, regardless of ShadowStyle. This simplifies the drawing logic and removes unnecessary checks.

* Fix margin thickness adjustment

* Fix shadow draw on overlapped views

* Only draw shadows at the end of each runnable

* Only call ClearNeedsDraw in the static Draw method

* Replace unit test as requested

* Also use reverse in margins although not making difference

* Fix the ShadowStyle, ShadowWidth and ShadowHeight logic

* Making sure nothing broke.

* ShadowWidth and ShadowHeight always default to 1 at invalid values

* Removes unused parameter

* Using Rune.ReplacementChar to not confusing with space char inserted by the clearing region

* Using Rune.ReplacementChar

* Using Rune.ReplacementChar

* Fix merge error

* Fixing unit tests

* Reverting changes

* Fixing unit tests

* Fix unit test

* Fix shadow on overlapped views

* Cleanup code

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
BDisp
2025-12-17 18:56:31 +00:00
committed by GitHub
parent c19ca48c7b
commit 1a54ff0872
7 changed files with 318 additions and 23 deletions

View File

@@ -63,7 +63,7 @@ public class AdornmentTests (ITestOutputHelper output)
Assert.Equal (6, view.Width);
Assert.Equal (3, view.Height);
view.SetClipToScreen ();
view.App.LayoutAndDraw (true);
view.Draw ();
DriverAssert.AssertDriverContentsWithFrameAre (