public static Widget DropDownEntry(
            string text,
            DropDownEntry entry
            )
        {
            var new_entry = Button(text);

            new_entry.VisualSettings.DrawOutline    = false;
            new_entry.VisualSettings.DrawBackground = false;
            new_entry.Behaviors.Get <DrawText>().XTextPositioning = XTextPositioningPolicy.left;

            if (entry.ClickAction != null && entry.SideDropDown == null)
            {
                new_entry.Behaviors.Add(new TriggerWidgetAction(nameof(Widget.OnClick), (WidgetAction)entry.ClickAction.InitialClone()));
            }

            if (entry.SideDropDown != null)
            {
                new_entry.Behaviors.Add(new TriggerWidgetAction(nameof(Widget.OnLongHover), new AddMainWidget(DropDown(entry.SideDropDown), OverlayWidgetLocation.SideOfParent(1, Direction2D.right))));
            }

            return(new_entry);
        }
Exemple #2
0
 DropDownEntry(
     DropDownEntry source
     ) =>