BDisp преди 2 години
родител
ревизия
0dcf754733
променени са 3 файла, в които са добавени 35 реда и са изтрити 40 реда
  1. 11 11
      Terminal.Gui/Configuration/ConfigurationManager.cs
  2. 23 29
      Terminal.Gui/Views/FrameView.cs
  3. 1 0
      Terminal.Gui/Windows/Dialog.cs

+ 11 - 11
Terminal.Gui/Configuration/ConfigurationManager.cs

@@ -44,7 +44,7 @@ namespace Terminal.Gui.Configuration {
 	///	3. Application configuration found in the applications's resources (<c>Resources/config.json</c>). 
 	/// </para>
 	/// <para>
-	///	4. Global configuration found in the the user's home directory (<c>~/.tui/config.json</c>).
+	///	4. Global configuration found in the user's home directory (<c>~/.tui/config.json</c>).
 	/// </para>
 	/// <para>
 	///	5. Global configuration found in the directory the app was launched from (<c>./.tui/config.json</c>).
@@ -63,7 +63,7 @@ namespace Terminal.Gui.Configuration {
 			DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
 			WriteIndented = true,
 			Converters = {
-				// No need to set converterss - the ConfigRootConverter uses property attributes apply the correct
+				// No need to set converters - the ConfigRootConverter uses property attributes apply the correct
 				// Converter.
 			},
 		};
@@ -196,7 +196,7 @@ namespace Terminal.Gui.Configuration {
 		/// </summary>
 		/// <remarks>
 		/// Is <see langword="null"/> until <see cref="Reset"/> is called. Gets set to a new instance by
-		/// deserializtion (see <see cref="Load"/>).
+		/// deserialization (see <see cref="Load"/>).
 		/// </remarks>
 		private static SettingsScope? _settings;
 
@@ -230,7 +230,7 @@ namespace Terminal.Gui.Configuration {
 
 		/// <summary>
 		/// Initializes the internal state of ConfiguraitonManager. Nominally called once as part of application
-		/// startup to initilaize global state. Also called from some Unit Tests to ensure correctness (e.g. Reset()).
+		/// startup to initialize global state. Also called from some Unit Tests to ensure correctness (e.g. Reset()).
 		/// </summary>
 		internal static void Initialize ()
 		{
@@ -260,7 +260,7 @@ namespace Terminal.Gui.Configuration {
 					  select p) {
 				if (p.GetCustomAttribute (typeof (SerializableConfigurationProperty)) is SerializableConfigurationProperty scp) {
 					if (p.GetGetMethod (true)!.IsStatic) {
-						// If the class name is ommited, JsonPropertyName is allowed. 
+						// If the class name is omitted, JsonPropertyName is allowed. 
 						_allConfigProperties!.Add (scp.OmitClassName ? ConfigProperty.GetJsonPropertyName (p) : $"{p.DeclaringType?.Name}.{p.Name}", new ConfigProperty {
 							PropertyInfo = p,
 							PropertyValue = null
@@ -357,7 +357,7 @@ namespace Terminal.Gui.Configuration {
 		}
 
 		/// <summary>
-		/// Event fired when the configuration has been upddated from a configuration source.  
+		/// Event fired when the configuration has been updated from a configuration source.  
 		/// application.
 		/// </summary>
 		public static event Action<ConfigurationManagerEventArgs>? Updated;
@@ -378,7 +378,7 @@ namespace Terminal.Gui.Configuration {
 			}
 
 			ClearJsonErrors ();
-			
+
 			Settings = new SettingsScope ();
 			ThemeManager.Reset ();
 			AppSettings = new AppScope ();
@@ -402,7 +402,7 @@ namespace Terminal.Gui.Configuration {
 		/// to generate the JSON doc that is embedded into Terminal.Gui (during development). 
 		/// </para>
 		/// <para>
-		/// WARNING: The <c>Terminal.Gui.Resources.config.json</c> resource has setting defintions (Themes)
+		/// WARNING: The <c>Terminal.Gui.Resources.config.json</c> resource has setting definitions (Themes)
 		/// that are NOT generated by this function. If you use this function to regenerate <c>Terminal.Gui.Resources.config.json</c>,
 		/// make sure you copy the Theme definitions from the existing <c>Terminal.Gui.Resources.config.json</c> file.
 		/// </para>		
@@ -455,7 +455,7 @@ namespace Terminal.Gui.Configuration {
 		public static string AppName { get; set; } = Assembly.GetEntryAssembly ()?.FullName?.Split (',') [0]?.Trim ()!;
 
 		/// <summary>
-		/// Describes the location of the configuration files. The constancts can be
+		/// Describes the location of the configuration files. The constants can be
 		/// combined (bitwise) to specify multiple locations.
 		/// </summary>
 		[Flags]
@@ -488,7 +488,7 @@ namespace Terminal.Gui.Configuration {
 		public static ConfigLocations Locations { get; set; } = ConfigLocations.All;
 
 		/// <summary>
-		/// Loads all settings found in the various configuraiton storage locations to 
+		/// Loads all settings found in the various configuration storage locations to 
 		/// the <see cref="ConfigurationManager"/>. Optionally,
 		/// resets all settings attributed with <see cref="SerializableConfigurationProperty"/> to the defaults 
 		/// defined in <see cref="LoadAppResources"/>.
@@ -508,7 +508,7 @@ namespace Terminal.Gui.Configuration {
 			if (Locations == ConfigLocations.All) {
 				var embeddedStylesResourceName = Assembly.GetEntryAssembly ()?
 					.GetManifestResourceNames ().FirstOrDefault (x => x.EndsWith (_configFilename));
-				if (string.IsNullOrEmpty(embeddedStylesResourceName)) {
+				if (string.IsNullOrEmpty (embeddedStylesResourceName)) {
 					embeddedStylesResourceName = _configFilename;
 				}
 

+ 23 - 29
Terminal.Gui/Views/FrameView.cs

@@ -162,9 +162,9 @@ namespace Terminal.Gui {
 			this.Title = title;
 			if (border == null) {
 				Border = new Border () {
-					BorderStyle = DefaultBorderStyle
-                    Title = title
-                };
+					BorderStyle = DefaultBorderStyle,
+					Title = title
+				};
 			} else {
 				Border = border;
 				if (ustring.IsNullOrEmpty (border.Title)) {
@@ -282,13 +282,7 @@ namespace Terminal.Gui {
 
 			if (!IgnoreBorderPropertyOnRedraw) {
 				Driver.SetAttribute (GetNormalColor ());
-				//Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: false);
 				Border.DrawContent (this, false);
-				if (HasFocus)
-					Driver.SetAttribute (ColorScheme.HotNormal);
-				if (Border.DrawMarginFrame)
-					Driver.DrawWindowTitle (scrRect, Title, padding.Left, padding.Top, padding.Right, padding.Bottom);
-				Driver.SetAttribute (GetNormalColor ());
 			} else {
 				var lc = new LineCanvas ();
 
@@ -310,28 +304,28 @@ namespace Terminal.Gui {
 
 				//}
 
-				Driver.SetAttribute (ColorScheme.Normal);
-				foreach (var p in lc.GenerateImage (bounds)) {
-					this.AddRune (p.Key.X, p.Key.Y, p.Value);
-				}
-				
-				// Redraw the lines so that focus/drag symbol renders
-				foreach (var subview in contentView.Subviews) {
-					//	line.DrawSplitterSymbol ();
-				}
+				//Driver.SetAttribute (ColorScheme.Normal);
+				//foreach (var p in lc.GenerateImage (bounds)) {
+				//	this.AddRune (p.Key.X, p.Key.Y, p.Value);
+				//}
+
+				//// Redraw the lines so that focus/drag symbol renders
+				//foreach (var subview in contentView.Subviews) {
+				//	//	line.DrawSplitterSymbol ();
+				//}
 
 
-				// Draw Titles over Border
-				foreach (var subview in contentView.Subviews) {
-					// TODO: Use reflection to see if subview has a Title property
-					if (subview is FrameView viewWithTite) {
-						var rect = viewWithTite.Frame;
-						rect.X = rect.X + 1;
-						rect.Y = rect.Y + 2;
-						// TODO: Do focus color correctly
-						Driver.DrawWindowTitle (rect, viewWithTite.Title, padding.Left, padding.Top, padding.Right, padding.Bottom);
-					}
-				}
+				//// Draw Titles over Border
+				//foreach (var subview in contentView.Subviews) {
+				//	// TODO: Use reflection to see if subview has a Title property
+				//	if (subview is FrameView viewWithTite) {
+				//		var rect = viewWithTite.Frame;
+				//		rect.X = rect.X + 1;
+				//		rect.Y = rect.Y + 2;
+				//		// TODO: Do focus color correctly
+				//		Driver.DrawWindowTitle (rect, viewWithTite.Title, padding.Left, padding.Top, padding.Right, padding.Bottom);
+				//	}
+				//}
 			}
 		}
 

+ 1 - 0
Terminal.Gui/Windows/Dialog.cs

@@ -79,6 +79,7 @@ namespace Terminal.Gui {
 			Modal = true;
 			ButtonAlignment = DefaultButtonAlignment;
 			Border = DefaultBorder;
+			Border.Title = title;
 
 			if (buttons != null) {
 				foreach (var b in buttons) {