Skip to content

Commit

Permalink
tweaked Arragnemetns Scenario to test nested transparent views
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Dec 17, 2024
1 parent d4fbba6 commit 557e637
Showing 1 changed file with 41 additions and 23 deletions.
64 changes: 41 additions & 23 deletions UICatalog/Scenarios/Arrangement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,28 @@ public override void Main ()
};
testFrame.Add (datePicker);

TransparentView transparentView = new ()
{
Id = "transparentView",
X = 5,
Y = 11,
Width = 35,
Height = 15
};

testFrame.Add (new TransparentView ());
transparentView.Add (
new TransparentView ()
{
Title = "Transparent SubView",
Text = "Transparent SubView",
Id = "transparentSubView",
X = 10,
Y = 10,
Width = 10,
Height = 5

});
testFrame.Add (transparentView);

adornmentsEditor.AutoSelectSuperView = testFrame;
arrangementEditor.AutoSelectSuperView = testFrame;
Expand Down Expand Up @@ -301,29 +321,27 @@ public override List<Key> GetDemoKeyStrokes ()

return keys;
}
}

public class TransparentView : FrameView
public class TransparentView : FrameView
{
public TransparentView ()
{
public TransparentView()
{
Title = "Transparent";
Text = "Text";
X = 0;
Y = 0;
Width = 30;
Height = 10;
Arrangement = ViewArrangement.Overlapped | ViewArrangement.Resizable | ViewArrangement.Movable;
ViewportSettings |= Terminal.Gui.ViewportSettings.Transparent;

Padding!.Thickness = new Thickness (1);

Add (
new Button ()
{
Title = "_Hi",
X = Pos.Center (),
Y = Pos.Center ()
});
}
Title = "Transparent";
base.Text = "Text";
Arrangement = ViewArrangement.Overlapped | ViewArrangement.Resizable | ViewArrangement.Movable;
ViewportSettings |= Terminal.Gui.ViewportSettings.Transparent;
base.Add (
new Button ()
{
Title = "_Hi",
X = Pos.Center (),
Y = Pos.Center (),
ShadowStyle = ShadowStyle.None,
ColorScheme = Colors.ColorSchemes ["Toplevel"],
});
}

/// <inheritdoc />
protected override bool OnMouseEvent (MouseEventArgs mouseEvent) { return false; }
}

0 comments on commit 557e637

Please sign in to comment.