public DirectoryButton(string directory, DirectoryType type) { target = directory; switch (type) { case DirectoryType.Directory: icon = FontAwesome.Solid.Folder; Name = Path.GetFileName(directory); break; case DirectoryType.Drive: icon = FontAwesome.Solid.Hdd; break; case DirectoryType.ParentDirectory: icon = FontAwesome.Solid.Reply; if (directory == string.Empty) { Name = @"Este Equipo"; } else if (!directory.EndsWith('\\')) { Name = Path.GetFileName(directory); } break; } }
private void tryAddInfo(IconUsage icon, string content, string link = null) { if (string.IsNullOrEmpty(content)) { return; } // newlines could be contained in API returned user content. content = content.Replace("\n", " "); bottomLinkContainer.AddIcon(icon, text => { text.Font = text.Font.With(size: 10); text.Colour = iconColour; }); if (link != null) { bottomLinkContainer.AddLink(" " + content, link, creationParameters: embolden); } else { bottomLinkContainer.AddText(" " + content, embolden); } addSpacer(bottomLinkContainer); }
public SelectionBoxButton(IconUsage iconUsage, string tooltip) { this.iconUsage = iconUsage; TooltipText = tooltip; Anchor = Anchor.Centre; Origin = Anchor.Centre; }
public Icon(string name, IconUsage icon) { TooltipText = name; AutoSizeAxes = Axes.Both; Child = SpriteIcon = new SpriteIcon { Icon = icon, Size = new Vector2(60), }; }
public Button(IconUsage icon) { RelativeSizeAxes = Axes.Both; InternalChild = new SpriteIcon { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Scale = new Vector2(0.5f), Icon = icon, }; }
public void AddButton(LocalisableString firstLine, string secondLine, IconUsage icon, Color4 colour, Action action) { var button = new BeatmapOptionsButton { FirstLineText = firstLine, SecondLineText = secondLine, Icon = icon, ButtonColour = colour, Action = () => { Hide(); action?.Invoke(); }, }; buttonsContainer.Add(button); }
/// <param name="firstLine">Text in the first line.</param> /// <param name="secondLine">Text in the second line.</param> /// <param name="colour">Colour of the button.</param> /// <param name="icon">Icon of the button.</param> /// <param name="hotkey">Hotkey of the button.</param> /// <param name="action">Binding the button does.</param> public void AddButton(string firstLine, string secondLine, IconUsage icon, Color4 colour, Action action, Key?hotkey = null) { var button = new BeatmapOptionsButton { FirstLineText = firstLine, SecondLineText = secondLine, Icon = icon, ButtonColour = colour, Action = () => { Hide(); action?.Invoke(); }, HotKey = hotkey }; buttonsContainer.Add(button); }
private void load(Storage store, TextureStore textures) { workingProject = WorkingProject.Parse(ProjectInfo, store, textures, api); editIcon = workingProject == null ? FontAwesome.Solid.ExclamationTriangle : FontAwesome.Solid.Edit; ButtonFlowContainer.AddRange(new[] { new IconButton(FontAwesome.Solid.TrashAlt, Colour4.DarkRed) { Action = showConfirmation, }, new IconButton(editIcon, workingProject == null ? FrameworkColour.YellowDark : FrameworkColour.Green) { Action = checkValidWorkingProject, }, }); BottomContainer.Add(new FillFlowContainer { Direction = FillDirection.Horizontal, Spacing = new Vector2(MARGIN_SIZE), AutoSizeAxes = Axes.Both, Children = new Drawable[] { new StatText(FontAwesome.Regular.Clone, ProjectInfo.NumberCards), new StatText(FontAwesome.Solid.Coins, ProjectInfo.NumberTokens), new StatText(FontAwesome.Solid.ChessBoard, ProjectInfo.NumberBoards), new StatText(FontAwesome.Regular.Square, ProjectInfo.NumberBoxes), new StatText(FontAwesome.Solid.Users, $"{ProjectInfo.MinNumberPlayers}{(ProjectInfo.MinNumberPlayers < ProjectInfo.MaxNumberPlayers ? $"-{ProjectInfo.MaxNumberPlayers}" : "")}"), new StatText(FontAwesome.Solid.Tags, $"{ProjectInfo.Tags.GetSetFlags().Length}"), }, }); ProjectName.Text = ProjectInfo.Name; ProjectDescription.Text = ProjectInfo.Description; ProjectImage.Texture = workingProject?.Image.Value?.Texture; var getCreator = new GetUserRequest(ProjectInfo.CreatorID); getCreator.Success += u => UsernameBox.Text = @$ "De {u.Username} (Ultima vez editado {ProjectInfo.LastEdited:dd/MM/yyyy HH:mm}) Estado: {ProjectInfo.CommunityStatus.GetDescription()}"; api.Queue(getCreator); }
public IconButton(IconUsage buttonIcon, Colour4 buttonColour = default, bool progressAction = false, Colour4 progressColour = default, Colour4 backgroundColour = default) { this.buttonIcon = buttonIcon; this.backgroundColour = backgroundColour == default ? new Colour4(100, 100, 100, 255) : backgroundColour; this.buttonColour = buttonColour == default ? new Colour4(100, 100, 100, 255) : buttonColour; this.progressColour = progressColour == default ? new Colour4(80, 80, 80, 255) : progressColour; if (!progressAction) { return; } Action += () => { Enabled.Value = false; loadingIcon.FadeIn(100); icon.FadeOut(100); fadeToWait(); }; }
public DisplayStyleToggleButton(IconUsage icon, PanelDisplayStyle style, Bindable <PanelDisplayStyle> bindable) { this.bindable = bindable; this.style = style; Size = new Vector2(25f); Children = new Drawable[] { this.icon = new SpriteIcon { Anchor = Anchor.Centre, Origin = Anchor.Centre, Icon = icon, Size = new Vector2(18), Alpha = 0.5f, }, }; bindable.ValueChanged += Bindable_ValueChanged; Bindable_ValueChanged(new ValueChangedEvent <PanelDisplayStyle>(bindable.Value, bindable.Value)); Action = () => bindable.Value = this.style; }
public StatText(IconUsage icon, string text) { Direction = FillDirection.Horizontal; Spacing = new Vector2(MARGIN_SIZE); AutoSizeAxes = Axes.Both; Children = new Drawable[] { new SpriteIcon { Size = new Vector2(SMALL_TEXT_SIZE), Icon = icon, }, new SpriteText { Font = new FontUsage(size: SMALL_TEXT_SIZE), Text = text, }, new Container { RelativeSizeAxes = Axes.Y, Width = MARGIN_SIZE, }, }; }
public ClickablePlaceholder(string actionMessage, IconUsage icon) { OsuTextFlowContainer textFlow; AddArbitraryDrawable(new OsuAnimatedButton { AutoSizeAxes = Framework.Graphics.Axes.Both, Child = textFlow = new OsuTextFlowContainer(cp => cp.Font = cp.Font.With(size: TEXT_SIZE)) { AutoSizeAxes = Framework.Graphics.Axes.Both, Margin = new Framework.Graphics.MarginPadding(5) }, Action = () => Action?.Invoke() }); textFlow.AddIcon(icon, i => { i.Padding = new Framework.Graphics.MarginPadding { Right = 10 }; }); textFlow.AddText(actionMessage); }
public InlineButton(IconUsage icon, Anchor anchor) { this.icon = icon; this.anchor = anchor; }
public void SetIcon(IconUsage icon) => SetIcon(new SpriteIcon { Size = new Vector2(20), Icon = icon });
public GrayButton(IconUsage icon) { this.icon = icon; }
public Button(string text, string sampleName, IconUsage symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown) { this.sampleName = sampleName; this.clickAction = clickAction; this.triggerKey = triggerKey; AutoSizeAxes = Axes.Both; Alpha = 0; Vector2 boxSize = new Vector2(ButtonSystem.BUTTON_WIDTH + Math.Abs(extraWidth), ButtonArea.BUTTON_AREA_HEIGHT); Children = new Drawable[] { box = new Container { // box needs to be always present to ensure the button is always sized correctly for flow AlwaysPresent = true, Masking = true, MaskingSmoothness = 2, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(0.2f), Roundness = 5, Radius = 8, }, Anchor = Anchor.Centre, Origin = Anchor.Centre, Scale = new Vector2(0, 1), Size = boxSize, Shear = new Vector2(ButtonSystem.WEDGE_WIDTH / boxSize.Y, 0), Children = new[] { new Box { EdgeSmoothness = new Vector2(1.5f, 0), RelativeSizeAxes = Axes.Both, Colour = colour, }, boxHoverLayer = new Box { EdgeSmoothness = new Vector2(1.5f, 0), RelativeSizeAxes = Axes.Both, Blending = BlendingMode.Additive, Colour = Color4.White, Alpha = 0, }, } }, iconText = new Container { AutoSizeAxes = Axes.Both, Position = new Vector2(extraWidth / 2, 0), Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { icon = new SpriteIcon { Shadow = true, Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(30), Position = new Vector2(0, 0), Icon = symbol }, new OsuSpriteText { Shadow = true, AllowMultiline = false, Anchor = Anchor.Centre, Origin = Anchor.Centre, Position = new Vector2(0, 35), Text = text } } } }; }
private void iconIs(IconUsage usage) => AddUntilStep("icon is correct", () => playButton.ChildrenOfType <SpriteIcon>().Any(icon => icon.Icon.Equals(usage)));
private static Drawable createIcon(IconUsage icon) => new SpriteIcon { Icon = icon, Scale = new Vector2(0.7f) };
public FluentMenuItem(LocalisableString text, Action action, IconUsage icon = default) : base(text, action) { Icon = icon; }
public ITextPart AddIcon(IconUsage icon, Action <SpriteText> creationParameters = null) => AddText(icon.Icon.ToString(), creationParameters);
public IEnumerable <Drawable> AddIcon(IconUsage icon, Action <SpriteText> creationParameters = null) => AddText(icon.Icon.ToString(), creationParameters);
public StatText(IconUsage icon, int count) : this(icon, count.ToString()) { }
public SimpleIconButton(IconUsage buttonIcon) { this.buttonIcon = buttonIcon; }
public ActionButton(IconUsage icon, string text) { this.icon = icon; this.text = text; }
public ResultModeButton(IResultPageInfo mode) : base(mode) { icon = mode.Icon; TooltipText = mode.Name; }
public LeaderboardScoreStatistic(IconUsage icon, string name, LocalisableString value) { Icon = icon; Name = name; Value = value; }
public TestItem(string name, IconUsage icon) { Name = name; Icon = icon; }