public LayoutSelectionItem(LyricLayout layout) { this.layout = layout; AutoSizeAxes = Axes.Both; Spacing = new Vector2(5); Direction = FillDirection.Vertical; InternalChildren = new Drawable[] { cornerContainer = new Container { AutoSizeAxes = Axes.Both, Masking = true, CornerRadius = 5f, Child = drawableLayoutPreview = new DrawableLayoutPreview { Size = new Vector2(selection_size), Layout = layout, } }, new OsuSpriteText { Text = layout.Name } }; selectedLayoutIndex.BindValueChanged(e => { var selected = layout.ID == e.NewValue; cornerContainer.BorderThickness = selected ? 3 : 0; }, true); }
protected virtual void ApplyLayout(LyricLayout layout) { // Layout relative to parent Anchor = layout.Alignment; Origin = layout.Alignment; Margin = new MarginPadding { Left = layout.Alignment.HasFlag(Anchor.x0) ? layout.HorizontalMargin : 0, Right = layout.Alignment.HasFlag(Anchor.x2) ? layout.HorizontalMargin : 0, Top = layout.Alignment.HasFlag(Anchor.y0) ? layout.VerticalMargin : 0, Bottom = layout.Alignment.HasFlag(Anchor.y2) ? layout.VerticalMargin : 0 }; Padding = new MarginPadding(30); foreach (var lyricPiece in lyricPieces) { // Layout to text lyricPiece.Continuous = layout.Continuous; lyricPiece.KaraokeTextSmartHorizon = layout.SmartHorizon; lyricPiece.Spacing = new Vector2(layout.LyricsInterval, lyricPiece.Spacing.Y); // Ruby lyricPiece.RubySpacing = new Vector2(layout.RubyInterval, lyricPiece.RubySpacing.Y); lyricPiece.RubyAlignment = layout.RubyAlignment; lyricPiece.RubyMargin = layout.RubyMargin; // Romaji lyricPiece.RomajiSpacing = new Vector2(layout.RomajiInterval, lyricPiece.RomajiSpacing.Y); lyricPiece.RomajiAlignment = layout.RomajiAlignment; lyricPiece.RomajiMargin = layout.RomajiMargin; } }
public DeleteButton(LyricLayout layout) { this.layout = layout; RelativeSizeAxes = Axes.Y; Width = button_width + item_height / 2; // add corner radius to cover with fill }
public ItemContent(LyricLayout layout) { this.layout = layout; RelativeSizeAxes = Axes.X; Height = item_height; Masking = true; }
protected override void ApplyLayout(LyricLayout layout) { // use my own layout base.ApplyLayout(new LyricLayout { Name = "Skin layout", Alignment = Anchor.Centre }); }
public DeleteLayoutDialog(LyricLayout layout, Action deleteAction) { HeaderText = "Confirm deletion of"; BodyText = $"Are you sure you want to delete layout {layout.Name}?"; Icon = FontAwesome.Regular.TrashAlt; Buttons = new PopupDialogButton[] { new PopupDialogOkButton { Text = @"Yes. Go for it.", Action = deleteAction }, new PopupDialogCancelButton { Text = @"No! Abort mission!", }, }; }
protected override void ApplyLayout(LyricLayout layout) { base.ApplyLayout(layout); Padding = new MarginPadding(0); }
public bool IsLayoutModified(LyricLayout layout) { throw new NotImplementedException(); }
public void AddLayout(LyricLayout layout) { throw new NotImplementedException(); }
public void UpdateLayoutName(LyricLayout layout, string newValue) { throw new NotImplementedException(); }
public void ChangeCurrentLayout(LyricLayout layout) { LoadedLayout.Value = layout; EditLayout.Value = layout; }