mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +01:00
FixedCM issues
This commit is contained in:
@@ -14,6 +14,24 @@ public class DialogTests
|
||||
View.DebugIDisposable = true;
|
||||
#endif
|
||||
_output = output;
|
||||
|
||||
// Override CM
|
||||
ConfigurationManager.RuntimeConfig = """
|
||||
{
|
||||
"Themes": [
|
||||
{
|
||||
"Default": {
|
||||
"Dialog.DefaultButtonAlignment" : "Center",
|
||||
"Dialog.DefaultBorderStyle" : "Single",
|
||||
"Dialog.DefaultShadow" : "None",
|
||||
"Button.DefaultShadow" : "None"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
""";
|
||||
ConfigurationManager.Locations = ConfigLocations.Runtime;
|
||||
ConfigurationManager.Load ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -34,12 +52,6 @@ public class DialogTests
|
||||
int width = $@"{Glyphs.VLine} {btn1} {btn2} {Glyphs.VLine}".Length;
|
||||
d.SetBufferSize (width, 1);
|
||||
|
||||
// Override CM
|
||||
Dialog.DefaultButtonAlignment = Alignment.Center;
|
||||
Dialog.DefaultBorderStyle = LineStyle.Single;
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
|
||||
// Default (center)
|
||||
var dlg = new Dialog
|
||||
{
|
||||
@@ -914,13 +926,6 @@ public class DialogTests
|
||||
{
|
||||
((FakeDriver)Driver).SetBufferSize (20, 5);
|
||||
|
||||
// Override CM
|
||||
Window.DefaultBorderStyle = LineStyle.Single;
|
||||
Dialog.DefaultButtonAlignment = Alignment.Center;
|
||||
Dialog.DefaultBorderStyle = LineStyle.Single;
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
|
||||
var win = new Window ();
|
||||
|
||||
var iterations = 0;
|
||||
@@ -1021,13 +1026,7 @@ public class DialogTests
|
||||
var win = new Window ();
|
||||
|
||||
int iterations = -1;
|
||||
|
||||
// Override CM
|
||||
Dialog.DefaultButtonAlignment = Alignment.Center;
|
||||
Dialog.DefaultBorderStyle = LineStyle.Single;
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
|
||||
|
||||
Iteration += (s, a) =>
|
||||
{
|
||||
iterations++;
|
||||
@@ -1065,13 +1064,7 @@ public class DialogTests
|
||||
public void Dialog_Opened_From_Another_Dialog ()
|
||||
{
|
||||
((FakeDriver)Driver).SetBufferSize (30, 10);
|
||||
|
||||
// Override CM
|
||||
Dialog.DefaultButtonAlignment = Alignment.Center;
|
||||
Dialog.DefaultBorderStyle = LineStyle.Single;
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
|
||||
|
||||
var btn1 = new Button { Text = "press me 1" };
|
||||
Button btn2 = null;
|
||||
Button btn3 = null;
|
||||
@@ -1233,12 +1226,6 @@ public class DialogTests
|
||||
[AutoInitShutdown]
|
||||
public void Location_When_Application_Top_Not_Default ()
|
||||
{
|
||||
// Override CM
|
||||
Window.DefaultBorderStyle = LineStyle.Single;
|
||||
Dialog.DefaultButtonAlignment = Alignment.Center;
|
||||
Dialog.DefaultBorderStyle = LineStyle.Single;
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
|
||||
var expected = 5;
|
||||
var d = new Dialog { X = expected, Y = expected, Height = 5, Width = 5 };
|
||||
@@ -1268,8 +1255,6 @@ public class DialogTests
|
||||
|
||||
var d = (FakeDriver)Driver;
|
||||
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
|
||||
var title = "";
|
||||
var btnText = "ok";
|
||||
|
||||
@@ -1312,8 +1297,6 @@ public class DialogTests
|
||||
[AutoInitShutdown]
|
||||
public void Size_Not_Default ()
|
||||
{
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
var d = new Dialog { Width = 50, Height = 50 };
|
||||
|
||||
Begin (d);
|
||||
@@ -1325,7 +1308,7 @@ public class DialogTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[SetupFakeDriver]
|
||||
[AutoInitShutdown]
|
||||
public void Zero_Buttons_Works ()
|
||||
{
|
||||
RunState runstate = null;
|
||||
@@ -1353,11 +1336,6 @@ public class DialogTests
|
||||
params Button [] btns
|
||||
)
|
||||
{
|
||||
// Override CM
|
||||
Dialog.DefaultButtonAlignment = Alignment.Center;
|
||||
Dialog.DefaultBorderStyle = LineStyle.Single;
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
|
||||
var dlg = new Dialog
|
||||
{
|
||||
|
||||
@@ -156,8 +156,23 @@ public class MessageBoxTests
|
||||
int iterations = -1;
|
||||
|
||||
((FakeDriver)Application.Driver!).SetBufferSize (15, 15); // 15 x 15 gives us enough room for a button with one char (9x1)
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
|
||||
|
||||
// Override CM
|
||||
ConfigurationManager.RuntimeConfig = """
|
||||
{
|
||||
"Themes": [
|
||||
{
|
||||
"Default": {
|
||||
"Dialog.DefaultShadow": "None",
|
||||
"Button.DefaultShadow": "None"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
""";
|
||||
ConfigurationManager.Locations = ConfigLocations.Runtime;
|
||||
ConfigurationManager.Load ();
|
||||
|
||||
var mbFrame = Rectangle.Empty;
|
||||
|
||||
@@ -195,10 +210,22 @@ public class MessageBoxTests
|
||||
$"{Glyphs.LeftBracket}{Glyphs.LeftDefaultIndicator} btn {Glyphs.RightDefaultIndicator}{Glyphs.RightBracket}";
|
||||
|
||||
// Override CM
|
||||
MessageBox.DefaultButtonAlignment = Alignment.End;
|
||||
MessageBox.DefaultBorderStyle = LineStyle.Double;
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
ConfigurationManager.RuntimeConfig = """
|
||||
{
|
||||
"Themes": [
|
||||
{
|
||||
"Default": {
|
||||
"Dialog.DefaultShadow": "None",
|
||||
"MessageBox.DefaultButtonAlignment": "End",
|
||||
"MessageBox.DefaultBorderStyle": "Double",
|
||||
"Button.DefaultShadow": "None"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
""";
|
||||
ConfigurationManager.Locations = ConfigLocations.Runtime;
|
||||
ConfigurationManager.Load ();
|
||||
|
||||
Application.Iteration += (s, a) =>
|
||||
{
|
||||
@@ -267,10 +294,22 @@ public class MessageBoxTests
|
||||
$"{Glyphs.LeftBracket}{Glyphs.LeftDefaultIndicator} btn {Glyphs.RightDefaultIndicator}{Glyphs.RightBracket}";
|
||||
|
||||
// Override CM
|
||||
MessageBox.DefaultButtonAlignment = Alignment.End;
|
||||
MessageBox.DefaultBorderStyle = LineStyle.Double;
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
ConfigurationManager.RuntimeConfig = """
|
||||
{
|
||||
"Themes": [
|
||||
{
|
||||
"Default": {
|
||||
"Dialog.DefaultShadow": "None",
|
||||
"MessageBox.DefaultButtonAlignment": "End",
|
||||
"MessageBox.DefaultBorderStyle": "Double",
|
||||
"Button.DefaultShadow": "None"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
""";
|
||||
ConfigurationManager.Locations = ConfigLocations.Runtime;
|
||||
ConfigurationManager.Load ();
|
||||
|
||||
Application.Iteration += (s, a) =>
|
||||
{
|
||||
@@ -449,10 +488,22 @@ public class MessageBoxTests
|
||||
((FakeDriver)Application.Driver).SetBufferSize (70, 15);
|
||||
|
||||
// Override CM
|
||||
MessageBox.DefaultButtonAlignment = Alignment.End;
|
||||
MessageBox.DefaultBorderStyle = LineStyle.Double;
|
||||
Dialog.DefaultShadow = ShadowStyle.None;
|
||||
Button.DefaultShadow = ShadowStyle.None;
|
||||
ConfigurationManager.RuntimeConfig = """
|
||||
{
|
||||
"Themes": [
|
||||
{
|
||||
"Default": {
|
||||
"Dialog.DefaultShadow": "None",
|
||||
"MessageBox.DefaultButtonAlignment": "End",
|
||||
"MessageBox.DefaultBorderStyle": "Double",
|
||||
"Button.DefaultShadow": "None"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
""";
|
||||
ConfigurationManager.Locations = ConfigLocations.Runtime;
|
||||
ConfigurationManager.Load ();
|
||||
|
||||
Application.Iteration += (s, a) =>
|
||||
{
|
||||
@@ -462,7 +513,7 @@ public class MessageBoxTests
|
||||
{
|
||||
MessageBox.Query (
|
||||
"",
|
||||
UICatalog.UICatalogTop.GetAboutBoxMessage (),
|
||||
UICatalogTop.GetAboutBoxMessage (),
|
||||
wrapMessage: false,
|
||||
buttons: "_Ok"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user