mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 17:57:57 +01:00
Add ability to disable AutoSize
This commit is contained in:
@@ -35,6 +35,13 @@ public enum LayoutStyle
|
||||
|
||||
public partial class View
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines the default usage of <see cref="View.AutoSize"/> in views
|
||||
/// that support it (e.g. <see cref="Button"/>. Set to false if you frequently
|
||||
/// get Exceptions about changing Width when AutoSize is true.
|
||||
/// </summary>
|
||||
public static bool DefaultAutoSize = true;
|
||||
|
||||
#region Frame
|
||||
|
||||
private Rectangle _frame;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class Button : View
|
||||
Height = 1;
|
||||
|
||||
CanFocus = true;
|
||||
AutoSize = true;
|
||||
AutoSize = View.DefaultAutoSize;
|
||||
HighlightStyle |= HighlightStyle.Pressed;
|
||||
#if HOVER
|
||||
HighlightStyle |= HighlightStyle.Hover;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CheckBox : View
|
||||
Height = 1;
|
||||
|
||||
CanFocus = true;
|
||||
AutoSize = true;
|
||||
AutoSize = View.DefaultAutoSize;
|
||||
|
||||
// Things this view knows how to do
|
||||
AddCommand (Command.Accept, OnToggled);
|
||||
|
||||
@@ -16,7 +16,7 @@ public class Label : View
|
||||
public Label ()
|
||||
{
|
||||
Height = 1;
|
||||
AutoSize = true;
|
||||
AutoSize = View.DefaultAutoSize;
|
||||
|
||||
// Things this view knows how to do
|
||||
AddCommand (Command.HotKey, FocusNext);
|
||||
|
||||
Reference in New Issue
Block a user