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

View should support an option to ignore Border in Redraw #2336

Closed
tig opened this issue Feb 9, 2023 · 0 comments · Fixed by #2337
Closed

View should support an option to ignore Border in Redraw #2336

tig opened this issue Feb 9, 2023 · 0 comments · Fixed by #2337

Comments

@tig
Copy link
Collaborator

tig commented Feb 9, 2023

Some views want to draw their own border and not use Border. Eg. SplitContainer (#2258). Instead of forcing such views to have their own styling properties, they should be able to leverage the fact that View already has a Border property.

To this end, we should add a property to View:

		/// <summary>
		/// Get or sets whether the view will use <see cref="Terminal.Gui.Border"/> (if <see cref="Border"/> is set) to draw the border. 
		/// If <see langword="false"/>
		/// (the default), the <see cref="View.Redraw(Rect)"/> method will call <see cref="Border.DrawContent(View, bool)"/>
		/// to draw the view's border.  If <see langword="true"/> no border is drawn (and the view is expected to draw the border
		/// itself using the properties of <see cref="Border"/>, if set).
		/// </summary>
		public virtual bool IgnoreBorderPropertyOnRedraw { get; set; } = false;
@tig tig added the enhancement label Feb 9, 2023
tig added a commit to tig/Terminal.Gui that referenced this issue Feb 9, 2023
@tig tig closed this as completed in #2337 Feb 9, 2023
tig added a commit that referenced this issue Feb 9, 2023
Fixes #2336. Adds a `IgnoreBorderPropertyOnRedraw` to `View`
BDisp pushed a commit to BDisp/Terminal.Gui that referenced this issue Feb 13, 2023
tig added a commit that referenced this issue Feb 20, 2023
…#2332)

* Proves that the issue #2331 don't have reason to happen.

* fixes #2336

* Fixes #2331. ScrollView may not be honoring clip region; CustomButton shows outside

* More appropriate solution for the issue #2331.

* Start refactoring LineCanvas for mixing line style support (e.g. double into single)

* Add remaining resolvers

* Implement corner border style mixing in LineCanvas

* Refactor and simplify resolvers

* Move tests to Core folder and namespace to Terminal.Gui.CoreTests

* Fixes #2333. TextField is selecting badly a word on double click.

* Add unit test deleting a word with accented char.

* Fixes 2331. ScrollView may not be honoring clip region.

* Add a custom button scenario.

* Fixes #2350. Clipping broke (see Clipping scenario).

* Is preferable use NeedDisplay instead of Bounds.

---------

Co-authored-by: Tig Kindel <tig@users.noreply.github.com>
Co-authored-by: tznind <tznind@dundee.ac.uk>
tig added a commit that referenced this issue Feb 21, 2023
#2372)

* Illustrates #2331 (Scrollview not respecting clip) does not reproduce (#2332)

* Proves that the issue #2331 don't have reason to happen.

* fixes #2336

* Fixes #2331. ScrollView may not be honoring clip region; CustomButton shows outside

* More appropriate solution for the issue #2331.

* Start refactoring LineCanvas for mixing line style support (e.g. double into single)

* Add remaining resolvers

* Implement corner border style mixing in LineCanvas

* Refactor and simplify resolvers

* Move tests to Core folder and namespace to Terminal.Gui.CoreTests

* Fixes #2333. TextField is selecting badly a word on double click.

* Add unit test deleting a word with accented char.

* Fixes 2331. ScrollView may not be honoring clip region.

* Add a custom button scenario.

* Fixes #2350. Clipping broke (see Clipping scenario).

* Is preferable use NeedDisplay instead of Bounds.

---------

Co-authored-by: Tig Kindel <tig@users.noreply.github.com>
Co-authored-by: tznind <tznind@dundee.ac.uk>

* Fixes ASCIICustomButton scenario.

* Adds Snake Scenario (#2353)

* Add empty snake scenario

* Move snake head around

* Snake now has a tail

* Rest of logic implementation

* Ctrl K D layout fixes

* Game gets faster as you collect more apples

* Adjust speed increase rate down

* Use white on black for snake and border and red for apple

* Fix ScenarioTests not Disposing Scenario

* Add disposes and fix to use LineCanvas.GenerateImage

* Fix stack overflow, doh!

---------

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

* Fixes 2368. Nested views with height of 1 not rendering correctly.

---------

Co-authored-by: Tig Kindel <tig@users.noreply.github.com>
Co-authored-by: tznind <tznind@dundee.ac.uk>
Co-authored-by: Thomas Nind <31306100+tznind@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant