mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-28 16:58:01 +01:00
f51ec9cf66bdd3a45799e5635331ff91eb4ce585
11 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
646b8dd597 | Added Reset() calls to CM tests | ||
|
|
4430fe2cc6 |
Fixes #3192. Improve correctness / clarity of existing View.AutoSize functionality/unit tests (#3202)
* Removed resharper settings from editorconfig * Remove constructors with frame parameters from Button class. * Remove constructors with frame parameters from CheckBox class. * Cleanup code. * Remove constructors with frame parameters from ComboBox class. * @BDisp Remove constructors with frame parameters from FrameView class. * Remove constructors with frame parameters from Label class. * Remove constructors with frame parameters from ListView class. * Remove constructors with frame parameters from ScrollBarView class. * Remove constructors with frame parameters from ScrollView class. * Remove namespace braces. * Cleanup code. * Cleanup code. * Cleanup code. * Remove constructors with frame parameters from TextField class. * Remove constructors with frame parameters from TimeField class. * Fixes #3182. OnResizeNeeded returns int.MaxValue and int.MaxValue when Application.Top is null, should return Size.Empty. * Remove constructors with frame parameters from Toplevel class. * Remove constructors with frame parameters from Window class. * Fix merge errors. * Revert "Fixes #3182. OnResizeNeeded returns int.MaxValue and int.MaxValue when Application.Top is null, should return Size.Empty." This reverts commit |
||
|
|
92a601254e |
Fixes #3170. Color improvements (#3204)
* Reduces indentation by remove the namespace braces. * Reduces indentation and removes unused using. * Ensures clear selection if it isn't selecting. * Turn on nullability context for TryParse and update usages as needed. * Use IsNullOrWhiteSpace, which includes IsNullOrEmpty All-whitespace values are also illegal, so may as well handle that here too * Respect the nullable here * It's a struct * Use byte.MaxValue and add remark * Just use the bytes directly * Must respect endianness * Add uint constructor so consumers don't have to do unchecked math * Completely re-work parsing and implement ISpanParsable<Color> All parsing is now almost-0 allocation, and is significantly faster than before * Extension methods required by new code * Use standard Math.Clamp method here * Add some new unit tests for TryParse * De-duplicate code and handle more cases * Enable nullability context for the file * Go ahead and enable the language features and analysis * Implicit usings remove a lot of boilerplate usings. * Add these to the dictionary to shut spell check up * Make this thing a record struct and a union, and update constructors This commit won't build. I'm just breaking out changes a little bit. * Some additional XmlDoc standardizing * Make FindClosestColor and CalculateColorDistance use the vector for SIMD * Add a TryFormat method for support of I*Formattable * Add an interface for support of custom formatting of Colors * Pass by in reference * Parse string delegates to Parse span * Parse now does all the work * Remove the old new code from TryParse * Some new cast operators * Add IFormattable.ToString implementation * Add the rest of the code for Color in its current (unfinished) state * Move that interface to its own file * Add ColorParseException class * Move Attribute to its own file, too. * Re-implement these operators as explicit methods * Get rid of fuzzy equality operators and update tests to use the named methods that replace them * Add an explicit test case for ToString with null format string and explicitly specified Invariant culture * Fix byte orders for hex format to be standard ARGB * Prove that ToString and Parse can round-trip values * Unroll this test into parameterized cases * Fix a couple of comments to match byte order * Update R# dictionary to match correct byte orders * Remove stray comment * Separate all types in this to their own files * Convert this one to use the handy extension * Add test for Argb property * Add a file nesting rule to make some incoming file changes display nicely * Move constructor tests to their own file and add some new tests * Add implicit cast from uint * More constructor tests * Since this is now a record, the equality operators are compiler generated Still spot-checking a few arbitrary values for completeness * Override ToString to delegate to Attribute * Simplify and clean up ToString. Delegate to ColorScheme * Update the test to match new output * These should be fields, really. It's a value type. * Add some type checks for change control * Allow unsafe and turn on implicit usings * Make this one better * Rename tests and remove redundant checks (the type checks already guarantee field consistency) * Reorganize a bit * Make these test 16 random values * Existing operator tests converted * That one is now redundant with both of the other tests that check all the named colors * Move this to type checks and simplify a little bit * These lambdas can be static * Move operators to another file. * Add global using for System.Text because it's EVERYWHERE * Reorganization of Color and some related types. Updated usages to reflect changes * Update tests to reflect changes in Terminal.Gui * Add missing keyword * Add entry to dictionary * Add dotsettings for Terminal.Gui Only specifies language level * Commit unsaved changes for usings here * Implement last remaining TryFormat method * A little cleanup/formality * Sorting rules Sort methods by name and interface they implement * Sort code * Match namespace for tests None! * Unroll ordinal check and reorganize. * Sort before writing new tests * These got reversed... * Add test to prove explicit cast to Vector3 works properly * Sort these too * Add test for uint->Color implicit operator * Add test for Color->uint implicit operator * Correct this test name and re-order * Add test for implicit conversion from Vector3 to Color * Add test for implicit conversion from Vector4 to Color * These also got reversed, like with Vector3 * Add test for implicit conversion from Color to Vector4 * Add test for GetHashCode * Make sure these are all under the same namespace * Remove a now-redundant test * Reorganize formatting and parsing tests to another type part * Tests moved back to Terminal.Gui.DrawingTests namespace as before. * Add tests for the constructor taking 3 or 4 integers and sort * Cleanup - Renamed some tests - Make a test even clearer - Removed redundant code - Got rid of unused parameter in Constructor_WithColorName_AllChannelsCorrect * That needs to be from the reverse map Not broken - just was sub-optimal due to my error. * Enable nullability context in this file Not sure how it got removed but whatev * Respect nullability context in this file now that it's on 🤦♂️ * Add tests for expected exceptions with whitespace or null values * Add test for parameterless constructor * A couple more places for reference passing and some SkipLocalsInit attributes. * Some XmlDoc corrections to reflect the final implementation * Remove namespace qualifier * Can't use these because of lambdas :( * Removed a collection that never ended up being needed. * Add bracing, newline, and modifier style rules * Add spacing rules inside parens/brackets * This was still under the Terminal.Gui.Drawing namespace. Revert that. * Applied updated formatting settings and addressed XmlDoc reviews in #3204 * More places where spaces got added in dependent code. Also a couple of null checks fixed to not use the equality operator * More dependent code format fixes * Finished re-formatting modified code that got spaces added everywhere * Visual studio didn't actually write this file to disk til I closed out of VS... Grr * Delete the ReSharper settings files from this branch. --------- Co-authored-by: BDisp <bd.bdisp@gmail.com> |
||
|
|
2c725b877f |
Fixes #2944. Makes ColorScheme explicitly readonly, removes Colors.Base, etc..., Fixes intermittent TreeView unit test failures (#3175)
* Removed resharper settings from editorconfig * Moved ColorScheme to ColorScheme.cs * Moved ColorScheme to ColorScheme.cs * Potential fix. PlatformColor was not being set by FakeDriver correctly. * Made ColorScheme effectively readonly * Removed Color.Base etc... Updated API docs. |
||
|
|
5ffaf55efc | (Color)foo -> new Color (foo) | ||
|
|
30e9b363d3 | Updated color names to match ANSI spec | ||
|
|
1fa6267895 | WIP - Revamped Color | ||
|
|
325180ae48 |
Fixes #2680. Make the TextView API more extensible. (#2682)
* Fixes #2680. Make the TextView API more extensible. * Remove unnecessary using. * Add GetLine method. * Change RuneCell Attribute property to ColorScheme property. * Add LoadRuneCells method and unit test. * Add helper method to set all the Colors.ColorSchemes with the same attribute. * Change RuneCell to class. * Add IEquatable<RuneCell> interface. * Fix unit test. * Still fixing unit test. * Fixes #2688. ReadOnly TextView's broken scrolling after version update. * keyModifiers must be reset after key up was been processed. * Trying fix server unit test error. * Prevents throw an exception if RuneCell is null. * Still trying fix this unit test. * Cleaning code. * Fix when the RuneCell is null. * Fix throwing an exception if current column position is greater than the line length. * Fixes #2689. Autocomplete doesn't popup after typing the first character. * Fix Used on TextField. * Always use the original ColorScheme if RuneCell.ColorScheme is null. * Fix Used on TextView. * Add RuneCellEventArgs and draw colors events. * Add two more samples to the scenario. * Fix a bug which was causing unit tests with ColorScheme fail. * Fix a issue when WordWrap is true by always loading the old text. * Improves debugging in RuneCell. * WordWrap is now preserving the ColorScheme of the unwrapped lines. * Simplifying unit test. * Ensures the foreground and background colors are never the same if Used is false. * Remove nullable from the parameter. * Merge syntax highlighting of quotes and keywords together * Add IdxRow property into the RuneCellEventArgs. * Fix pos calculation on windows (where newline in Text is \r\n not \n) * Fix events not being cleared when toggling samples. * Change Undo and Redo to a public method. * Changes some methods names to be more explicit. * Call OnContentsChanged on needed methods and fix some more bugs. * Adds InheritsPreviousColorScheme to allow LoadRuneCells uses personalized color schemes. * Serializes and deserializes RuneCell to a .rce extension file. * Prevents throwing if column is bigger than the line. * Avoids create a color attribute without one of the foreground or background values. In Linux using -1 throws an exception. * Replace SetAllAttributesBasedOn method with a ColorScheme constructor. * Move RuneCell string extensions to TextView.cs * Reverted parameter name from cell to rune. * Change Row to UnwrappedPosition which provide the real unwrapped text position within the Col. * Add brackets to Undo and Redo methods. * Replace all the LoadXXX with Load and rely on the param type to differentiate. * Open a file inside a using. * Proves that the events run twice for WordWrap disabled and the enabled. * Remove GetColumns extension for RuneCell. * Add braces to Undo an Redo. * Change comment. * Add braces. * Delete remarks tag. * Explaining used color and ProcessInheritsPreviousColorScheme. * Fix comment. * Created a RuneCellTests.cs file. * Rename to StringToLinesOfRuneCells. * Make ToRuneCells private. --------- Co-authored-by: Thomas <tznind@dundee.ac.uk> Co-authored-by: Thomas Nind <31306100+tznind@users.noreply.github.com> |
||
|
|
a637f8a29c |
Fixes #2486 - Removes old Border and fixes a litany of related things (#2525)
* Added View.BorderStyle and renamed BorderStyle enum to LineStyle * Fixed a lot of things and broke everything else * Fixed things * Updated DialogTests * Updates including Rect unit tests * Fixed Dialog & MessagBox tests * Fixed AllviewsTester bug * Fixed AllviewsTester bug * Removed Border class * Renamed View privates with _ * Removed comments in MessageBox.cs |
||
|
|
574ed8fec7 |
Fixes #2469 - Revamp file structure and namespace (#2471)
* initial commit * All tests pass * Updated readme * Revert "All tests pass" This reverts commit |
||
|
|
9425b2a720 | Fixes #2181 - (Really) Adds configuration manager (#2365) |