public IDMigrationTabItem(IDMigrationMode mode) { Mode = mode; Anchor = Anchor.CentreLeft; Origin = Anchor.CentreLeft; // Set this to (80, 50) once the Y positioning of the tab items works Size = new Vector2(80, 23); CornerRadius = 10; Masking = true; Children = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColor }, new SpriteText { // Set this to Top = 3 once Y positioning of the tab items works Margin = new MarginPadding { Top = 1 }, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Font = new FontUsage(size: 20), Text = mode.ToString() } }; }
public void HandleTabSelected(IDMigrationMode newMode) { if (currentTab != null) { currentTab.MoveToOffset(new Vector2(0, -10), 500, Easing.OutQuint); currentTab.Selected = false; } (currentTab = this[newMode]).MoveToOffset(new Vector2(0, 10), 500, Easing.InQuint); TabSelected?.Invoke(newMode); }
public IDMigrationStepList(Editor e, IDMigrationMode mode) { InitializeActionDictionary(); editor = e; IDMigrationMode = mode; Anchor = Anchor.Centre; Origin = Anchor.Centre; Child = new FillFlowContainer { AlwaysPresent = true, RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { searchQuery = new TextBox { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Height = 30, RelativeSizeAxes = Axes.X }, new Container { RelativeSizeAxes = Axes.Both, Margin = new MarginPadding { Top = 10 }, Padding = new MarginPadding { Bottom = 40 }, Children = new Drawable[] { new GDEScrollContainer { RelativeSizeAxes = Axes.Both, Child = stepList = new FadeSearchContainer { LayoutDuration = 100, LayoutEasing = Easing.Out, Spacing = new Vector2(0, 2), RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y } }, noSteps = new FillFlowContainer { Direction = FillDirection.Vertical, Anchor = Anchor.Centre, Origin = Anchor.Centre, Spacing = new Vector2(0, 30), Children = new Drawable[] { new SpriteIcon { Anchor = Anchor.Centre, Origin = Anchor.Centre, Icon = FontAwesome.Solid.Times, Size = new Vector2(64), Colour = GDEColors.FromHex("666666") }, new SpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "No migration steps are registered", Font = new FontUsage("OpenSans", 24), Colour = GDEColors.FromHex("666666") }, addNewStep = new GDEButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, Width = 200, Text = "Add a new step", BackgroundColour = GDEColors.FromHex("242424") } }, Alpha = 0 } } } } }; UpdateCurrentTabRanges(); }
public void SelectIDMigrationMode(IDMigrationMode newMode) { this[newMode].Selected = true; }
public IDMigrationTabItem this[IDMigrationMode mode] => tabItems[(int)mode];