mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 09:47:58 +01:00
Enabled Adornment Focus in Adornmens scenario
This commit is contained in:
@@ -488,7 +488,6 @@ public partial class View // Focus and cross-view navigation management (TabStop
|
||||
if (previousFocusedView is { HasFocus: true } && GetFocusChain (NavigationDirection.Forward, TabStop).Contains (previousFocusedView))
|
||||
{
|
||||
previousFocusedView.SetHasFocusFalse (this);
|
||||
Debug.Assert (!_hasFocus);
|
||||
}
|
||||
|
||||
_previouslyFocused = null;
|
||||
|
||||
@@ -90,6 +90,7 @@ public class Adornments : Scenario
|
||||
|
||||
window.Padding.Data = "Padding";
|
||||
window.Padding.Thickness = new (3);
|
||||
window.Padding.CanFocus = true;
|
||||
|
||||
var longLabel = new Label
|
||||
{
|
||||
@@ -106,11 +107,22 @@ public class Adornments : Scenario
|
||||
window.Padding.Add (labelInPadding);
|
||||
|
||||
var textFieldInPadding = new TextField
|
||||
{ X = Pos.Right (labelInPadding) + 1, Y = Pos.Top (labelInPadding), Width = 15, Text = "some text" };
|
||||
{
|
||||
X = Pos.Right (labelInPadding) + 1,
|
||||
Y = Pos.Top (labelInPadding), Width = 15,
|
||||
Text = "some text",
|
||||
CanFocus = true
|
||||
};
|
||||
textFieldInPadding.Accept += (s, e) => MessageBox.Query (20, 7, "TextField", textFieldInPadding.Text, "Ok");
|
||||
window.Padding.Add (textFieldInPadding);
|
||||
|
||||
var btnButtonInPadding = new Button { X = Pos.Center (), Y = 0, Text = "_Button in Padding" };
|
||||
var btnButtonInPadding = new Button
|
||||
{
|
||||
X = Pos.Center (),
|
||||
Y = 0,
|
||||
Text = "_Button in Padding",
|
||||
CanFocus = true
|
||||
};
|
||||
btnButtonInPadding.Accept += (s, e) => MessageBox.Query (20, 7, "Hi", "Button in Padding Pressed!", "Ok");
|
||||
btnButtonInPadding.BorderStyle = LineStyle.Dashed;
|
||||
btnButtonInPadding.Border.Thickness = new (1, 1, 1, 1);
|
||||
|
||||
Reference in New Issue
Block a user