mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Fixed rendering issue * Removed dead code * Removed dead code
This commit is contained in:
@@ -93,6 +93,22 @@ public class Dialog : Window
|
||||
KeyBindings.Add (Key.Esc, Command.QuitToplevel);
|
||||
}
|
||||
|
||||
// BUGBUG: We override GetNormal/FocusColor because "Dialog" ColorScheme is goofy.
|
||||
// BUGBUG: By defn, a Dialog is Modal, and thus HasFocus is always true. OnDrawContent
|
||||
// BUGBUG: Calls these methods.
|
||||
// TODO: Fix this in https://github.com/gui-cs/Terminal.Gui/issues/2381
|
||||
/// <inheritdoc />
|
||||
public override Attribute GetNormalColor ()
|
||||
{
|
||||
return ColorScheme.Normal;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Attribute GetFocusColor ()
|
||||
{
|
||||
return ColorScheme.Normal;
|
||||
}
|
||||
|
||||
private bool _canceled;
|
||||
|
||||
/// <summary>Gets a value indicating whether the <see cref="Dialog"/> was canceled.</summary>
|
||||
@@ -166,12 +182,5 @@ public class Dialog : Window
|
||||
|
||||
_buttons.Add (button);
|
||||
Add (button);
|
||||
|
||||
SetNeedsDisplay ();
|
||||
|
||||
if (IsInitialized)
|
||||
{
|
||||
LayoutSubviews ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,11 +400,6 @@ public static class MessageBox
|
||||
d.TextFormatter.WordWrap = wrapMessage;
|
||||
d.TextFormatter.MultiLine = !wrapMessage;
|
||||
|
||||
d.ColorScheme = new ColorScheme (d.ColorScheme)
|
||||
{
|
||||
Focus = d.ColorScheme.Normal
|
||||
};
|
||||
|
||||
// Setup actions
|
||||
Clicked = -1;
|
||||
|
||||
@@ -418,11 +413,6 @@ public static class MessageBox
|
||||
Clicked = buttonId;
|
||||
Application.RequestStop ();
|
||||
};
|
||||
|
||||
if (b.IsDefault)
|
||||
{
|
||||
b.SetFocus ();
|
||||
}
|
||||
}
|
||||
|
||||
// Run the modal; do not shut down the mainloop driver when done
|
||||
|
||||
@@ -263,6 +263,7 @@ public class Dialogs : Scenario
|
||||
dialog = new ()
|
||||
{
|
||||
Title = titleEdit.Text,
|
||||
Text = "Dialog Text",
|
||||
ButtonAlignment = (Alignment)Enum.Parse (typeof (Alignment), alignmentRadioGroup.RadioLabels [alignmentRadioGroup.SelectedItem]),
|
||||
|
||||
Buttons = buttons.ToArray ()
|
||||
|
||||
Reference in New Issue
Block a user