Browse Source

Fixes #1206. NetDriver now print the selected text. Attribute struct now create a valid Value for the current driver. Insert key is detected by NetDriver. (#1207)

BDisp 4 years ago
parent
commit
ae2f713e23

+ 3 - 0
Terminal.Gui/ConsoleDrivers/NetDriver.cs

@@ -969,6 +969,9 @@ namespace Terminal.Gui {
 			case '1':
 				key = ConsoleKey.F10;
 				break;
+			case '2':
+				key = ConsoleKey.Insert;
+				break;
 			case '3':
 				if (length == 5) {
 					key = ConsoleKey.F11;

+ 1 - 1
Terminal.Gui/Core/ConsoleDriver.cs

@@ -124,7 +124,7 @@ namespace Terminal.Gui {
 		/// <param name="background">Background</param>
 		public Attribute (Color foreground = new Color (), Color background = new Color ())
 		{
-			Value = (int)foreground | ((int)background << 4);
+			Value = Make (foreground, background).Value;
 			Foreground = foreground;
 			Background = background;
 		}

+ 1 - 1
Terminal.Gui/Views/TextField.cs

@@ -223,7 +223,7 @@ namespace Terminal.Gui {
 				var rune = text [idx];
 				var cols = Rune.ColumnWidth (rune);
 				if (idx == point && HasFocus && !Used && length == 0 && !ReadOnly) {
-					Driver.SetAttribute (Colors.Menu.HotFocus);
+					Driver.SetAttribute (selColor);
 				} else if (ReadOnly) {
 					Driver.SetAttribute (idx >= start && length > 0 && idx < start + length ? selColor : roc);
 				} else if (!HasFocus) {