예제 #1
0
 public AddMainWidget(
     Widget widget,
     OverlayWidgetLocation location
     )
 {
     Widget   = widget;
     Location = location;
 }
예제 #2
0
        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);
        }