浏览代码

Revamps CharMap (#2625)

* Remove NStack and replace ustring to string.

* Add unit test and improving some code.

* Adjust code and fix all unit tests errors.

* Add XML Document and move the Rune folder into the Text folder.

* Improve unit tests with byte array on DecodeRune and DecodeLastRune.

* Fix unit test.

* Fixed bugs

* Scenario desc

* 😂Code review

* Fixed merge issue

* Reduce unit tests code.

* Change StringExtensions.Make to StringExtensions.ToString and added some more unit tests.

* Fix merge errors.

* Remove GetTextWidth and calls replaced with StringExtensions.GetColumns.

* Hack to use UseSystemConsole passed in the command line arguments.

* Revert "Hack to use UseSystemConsole passed in the command line arguments."

This reverts commit b74d11c7864fa6e20d40ef5cbead89a42f81ee5e.

* Remove Application.UseSystemConsole from the config file.

* Fix errors related by removing UseSystemConsole from the config file.

* Fixes #2633. DecodeEscSeq throw an exception if cki is null.

* Fix an exception if SelectedItem is -1.

* Set SelectedItem to 0 and remove unnecessary ToString.

* Using a unique ToString method for Rune and other for byte.

* Fix a bug where a wider rune is added with only a width of 1.

* Force the SelectedGlyph is the one that was typed after jumpList is executed.

* Added more InlineData to RuneTests.

* Reducing significantly the code by using Theory attribute in the TextFormatterTests.

* Override PositionCursor to handle the CharMap cursor position.

* Fix merge errors.

* Fixed cursor issue?

* Switched to TableView

* Fixed select when sorted by range

* SearchNav now works with start/end

* Fixed text changed bug

* Added abilty to sort ascending/descending

* Minor tweaks to API docs

* Column width = 3

---------

Co-authored-by: BDisp <[email protected]>
Tig 2 年之前
父节点
当前提交
ecf6d4f340

+ 2 - 3
Terminal.Gui/Views/ScrollBarView.cs

@@ -705,7 +705,6 @@ namespace Terminal.Gui {
 
 
 			if (mouseEvent.Flags != MouseFlags.Button1Released
 			if (mouseEvent.Flags != MouseFlags.Button1Released
 				&& (Application.MouseGrabView == null || Application.MouseGrabView != this)) {
 				&& (Application.MouseGrabView == null || Application.MouseGrabView != this)) {
-
 				Application.GrabMouse (this);
 				Application.GrabMouse (this);
 			} else if (mouseEvent.Flags == MouseFlags.Button1Released && Application.MouseGrabView != null && Application.MouseGrabView == this) {
 			} else if (mouseEvent.Flags == MouseFlags.Button1Released && Application.MouseGrabView != null && Application.MouseGrabView == this) {
 				_lastLocation = -1;
 				_lastLocation = -1;
@@ -718,11 +717,11 @@ namespace Terminal.Gui {
 				return Host.MouseEvent (mouseEvent);
 				return Host.MouseEvent (mouseEvent);
 			}
 			}
 
 
-			if (location == 0) {
+			if (mouseEvent.Flags == MouseFlags.Button1Pressed && location == 0) {
 				if (pos > 0) {
 				if (pos > 0) {
 					Position = pos - 1;
 					Position = pos - 1;
 				}
 				}
-			} else if (location == barsize + 1) {
+			} else if (mouseEvent.Flags == MouseFlags.Button1Pressed && location == barsize + 1) {
 				if (CanScroll (1, out _, _vertical)) {
 				if (CanScroll (1, out _, _vertical)) {
 					Position = pos + 1;
 					Position = pos + 1;
 				}
 				}

+ 3 - 1
Terminal.Gui/Views/ScrollView.cs

@@ -366,7 +366,9 @@ namespace Terminal.Gui {
 			Driver.SetAttribute (GetNormalColor ());
 			Driver.SetAttribute (GetNormalColor ());
 			Clear ();
 			Clear ();
 
 
-			_contentView.Draw ();
+			if (!string.IsNullOrEmpty (_contentView.Text) || _contentView.Subviews.Count > 0) {
+				_contentView.Draw ();
+			}
 
 
 			DrawScrollBars ();
 			DrawScrollBars ();
 
 

文件差异内容过多而无法显示
+ 574 - 454
UICatalog/Scenarios/CharacterMap.cs


+ 1 - 1
UICatalog/Scenarios/TableEditor.cs

@@ -663,7 +663,7 @@ namespace UICatalog.Scenarios {
 			new UnicodeRange(0xFB00, 0xFb4f,"Alphabetic Presentation Forms"),
 			new UnicodeRange(0xFB00, 0xFb4f,"Alphabetic Presentation Forms"),
 			new UnicodeRange(0x12400, 0x1240f,"Cuneiform Numbers and Punctuation"),
 			new UnicodeRange(0x12400, 0x1240f,"Cuneiform Numbers and Punctuation"),
 			new UnicodeRange(0x1FA00, 0x1FA0f,"Chess Symbols"),
 			new UnicodeRange(0x1FA00, 0x1FA0f,"Chess Symbols"),
-			new UnicodeRange((uint)(CharMap.MaxCodePointVal - 16), (uint)CharMap.MaxCodePointVal,"End"),
+			new UnicodeRange((uint)(CharMap.MaxCodePoint - 16), (uint)CharMap.MaxCodePoint,"End"),
 
 
 			new UnicodeRange (0x0020 ,0x007F        ,"Basic Latin"),
 			new UnicodeRange (0x0020 ,0x007F        ,"Basic Latin"),
 			new UnicodeRange (0x00A0 ,0x00FF        ,"Latin-1 Supplement"),
 			new UnicodeRange (0x00A0 ,0x00FF        ,"Latin-1 Supplement"),

部分文件因为文件数量过多而无法显示