Selaa lähdekoodia

Changing Dim.DimCombine class as public.

BDisp 4 vuotta sitten
vanhempi
commit
be840f31cc
2 muutettua tiedostoa jossa 2 lisäystä ja 4 poistoa
  1. 1 1
      Terminal.Gui/Core/PosDim.cs
  2. 1 3
      Terminal.Gui/Views/Button.cs

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

@@ -499,7 +499,7 @@ namespace Terminal.Gui {
 			return new DimAbsolute (n);
 		}
 
-		class DimCombine : Dim {
+		public class DimCombine : Dim {
 			Dim left, right;
 			bool add;
 			public DimCombine (bool add, Dim left, Dim right)

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

@@ -145,9 +145,7 @@ namespace Terminal.Gui {
 				base.Text = ustring.Make (_leftBracket) + " " + text + " " + ustring.Make (_rightBracket);
 
 			int w = base.Text.RuneCount - (base.Text.Contains (HotKeySpecifier) ? 1 : 0);
-			try {
-				Width = w;
-			} catch (Exception) {
+			if (Width is Dim.DimCombine) {
 				// It's a Dim.DimCombine and so can't be assigned. Let it have it's own anchor.
 				w = Width.Anchor (w);
 			}