Пример #1
0
            public GDEBreadcrumb(T value)
                : base(value)
            {
                AutoSizeAxes = Axes.X;

                AddRangeInternal(new Drawable[]
                {
                    new Container
                    {
                        Masking          = true,
                        CornerRadius     = 5,
                        AutoSizeAxes     = Axes.X,
                        RelativeSizeAxes = Axes.Y,
                        Children         = new Drawable[]
                        {
                            background = new Box
                            {
                                RelativeSizeAxes = Axes.Both,
                                Colour           = TCCColours.FromHex("1a1a1a")
                            },
                            text = new SpriteText
                            {
                                Origin  = Anchor.CentreLeft,
                                Anchor  = Anchor.CentreLeft,
                                Margin  = new MarginPadding(3),
                                Padding = new MarginPadding(5),
                                Text    = value.ToString(),
                            }
                        }
                    }
                });
            }
Пример #2
0
        public DirectoryItemContainer()
        {
            Children = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    CornerRadius     = 5,
                    Masking          = true,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = TCCColours.FromHex("121212")
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Padding          = new MarginPadding(10),
                            Child            = scrollContainer = new TCCScrollContainer
                            {
                                RelativeSizeAxes = Axes.Both,
                                Children         = new Drawable[]
                                {
                                    fileContainer = new FadeSearchContainer
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Child            = fileFillFlowContainer = new FillFlowContainer
                                        {
                                            Direction        = FillDirection.Vertical,
                                            Spacing          = new Vector2(0, ItemSpacing),
                                            RelativeSizeAxes = Axes.X,
                                            AutoSizeAxes     = Axes.Y
                                        }
                                    }
                                },
                                ScrollOnKeyDown = false
                            }
                        }
                    }
                }
            };

            CurrentSelection.ValueChanged         += HandleSelectionChanged;
            CurrentDirectoryBindable.ValueChanged += HandleDirectoryChanged;
            SelectedItemBindable.ValueChanged     += HandleItemChanged;
        }
Пример #3
0
 public TCCBreadcrumbNavigation()
 {
     AddRangeInternal(new Drawable[]
     {
         new Container
         {
             Masking          = true,
             CornerRadius     = DefaultCornerRadius,
             Depth            = 1,
             Height           = 30,
             RelativeSizeAxes = Axes.X,
             Children         = new Drawable[]
             {
                 new Box
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = TCCColours.FromHex("121212")
                 }
             }
         }
     });
 }
Пример #4
0
 private void load()
 {
     Colour          = defaultColour = TCCColours.FromHex("888");
     hoverColour     = TCCColours.FromHex("fff");
     highlightColour = TCCColours.FromHex("88b300");
 }
Пример #5
0
        public FileDialog(string defaultDirectory = null)
        {
            CornerRadius = 10;
            Masking      = true;

            LockDrag = true;

            AddRangeInternal(new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = TCCColours.FromHex("1a1a1a")
                },
                new DrawSizePreservingFillContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding(10),
                    Strategy         = DrawSizePreservationStrategy.Minimum,
                    Children         = new Drawable[]
                    {
                        new SpriteText
                        {
                            Text = $"{FileDialogActionName} File"
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Y      = 35,
                            Height = 30,
                            Child  = filePathBreadcrumbs = new TCCBreadcrumbNavigationTextBox
                            {
                                Origin           = Anchor.CentreLeft,
                                Anchor           = Anchor.CentreLeft,
                                RelativeSizeAxes = Axes.X,
                                Height           = 30
                            }
                        },
                        new FileDialogActionContainer
                        {
                            RelativeSizeAxes = Axes.Both,
                            Padding          = new MarginPadding
                            {
                                Top    = 70,
                                Bottom = 40
                            },
                            Child = itemContainer = new DirectoryItemContainer
                            {
                                RelativeSizeAxes = Axes.Both
                            }
                        },
                        new Container
                        {
                            Anchor           = Anchor.BottomRight,
                            Origin           = Anchor.BottomRight,
                            RelativeSizeAxes = Axes.X,
                            Height           = 30,
                            Children         = new Drawable[]
                            {
                                new Container
                                {
                                    Anchor           = Anchor.CentreLeft,
                                    Origin           = Anchor.CentreLeft,
                                    RelativeSizeAxes = Axes.Both,
                                    Padding          = new MarginPadding {
                                        Right = 110
                                    },
                                    Children = new Drawable[]
                                    {
                                        search = new BasicTextBox
                                        {
                                            Anchor           = Anchor.CentreLeft,
                                            Origin           = Anchor.CentreLeft,
                                            RelativeSizeAxes = Axes.Both,
                                            PlaceholderText  = "Selected Path",
                                            OnCommit         = (sender, newText) => SelectedItem = sender.Text
                                        },
                                        new SpriteIcon
                                        {
                                            Anchor = Anchor.CentreRight,
                                            Origin = Anchor.CentreRight,
                                            Size   = new Vector2(15),
                                            Margin = new MarginPadding {
                                                Right = 10
                                            },
                                            Icon = FontAwesome.Solid.Search
                                        }
                                    }
                                },
                                ActionButton = new FadeButton
                                {
                                    Anchor       = Anchor.CentreRight,
                                    Origin       = Anchor.CentreRight,
                                    Width        = 100,
                                    EnabledColor = TCCColours.FromHex("303030"),
                                    Action       = ActionButtonAction,
                                    Text         = FileDialogActionName
                                }
                            }
                        }
                    }
                }
            });

            ActionButton.Enabled.Value = false;

            CurrentSelection.BindTo(itemContainer.CurrentSelection);
            CurrentDirectoryBindable.BindTo(itemContainer.CurrentDirectoryBindable);
            SelectedItemBindable.BindTo(itemContainer.SelectedItemBindable);

            CurrentSelection.ValueChanged         += HandleCurrentSelectionChanged;
            CurrentDirectoryBindable.ValueChanged += HandleDirectoryChanged;
            SelectedItemBindable.ValueChanged     += HandleItemChanged;

            itemContainer.PerformActionRequested += HandlePerformActionRequested;

            filePathBreadcrumbs.OnTextChanged += HandleBreadcrumbsUpdated;
            filePathBreadcrumbs.BreadcrumbNavigation.BreadcrumbClicked += HandleBreadcrumbsUpdated;

            CurrentDirectory = defaultDirectory
                               ?? GetFolderPath(MyDocuments);
        }