Beispiel #1
0
 public AddressBar(Func <string, bool> openPath, FilesystemModel filesystemModel)
 {
     this.openPath        = openPath;
     this.filesystemModel = filesystemModel;
     Layout = new StackLayout();
     state  = AddressBarState.PathBar;
     CreatePathBar();
     CreateEditor();
     Updating += (float delta) => {
         if (
             editor.IsFocused() &&
             state != AddressBarState.Editor
             )
         {
             state       = AddressBarState.Editor;
             editor.Text = filesystemModel.CurrentPath;
             RemovePathBar();
         }
         if (
             state == AddressBarState.Editor &&
             !editor.IsFocused()
             )
         {
             FlipState();
         }
     };
 }
Beispiel #2
0
        public PathBar(Func <string, bool> openPath, FilesystemModel filesystemModel)
        {
            this.filesystemModel = filesystemModel;
            this.openPath        = openPath;
            Layout     = new HBoxLayout();
            LayoutCell = new LayoutCell(Alignment.LeftCenter);
            Padding    = new Thickness(1);

            this.AddChangeWatcher(() => filesystemModel.CurrentPath, (p) => {
                UpdatePathBar();
            });
        }
Beispiel #3
0
 public FilesystemToolbar(FilesystemView view, FilesystemModel filesystemModel)
 {
     this.view = view;
     Nodes.AddRange(
         new Widget {
         Presenter = new SyncDelegatePresenter <Widget>((w) => {
             w.PrepareRendererState();
             Renderer.DrawLine(0.0f, w.Size.Y, w.Size.X, w.Size.Y, Theme.Colors.SeparatorColor);
         }),
         Layout = new VBoxLayout(),
         Nodes  =
         {
             new Widget         {
                 Layout = new HBoxLayout()
                 {
                     Spacing = 2
                 },
                 Nodes =
                 {
                     CreateGotoCurrentProjectDirectoryButton(),
                     CreateUpButton(),
                     CreateGoBackwardButton(),
                     CreateGoForwardButton(),
                     CreateToggleCookingRulesButton(),
                     CreateTogglePreviewButton(),
                     CreateSplitHButton(),
                     CreateSplitVButton(),
                     CreateSortByText(),
                     CreateSortDropDownList(),
                     CreateSortOrderDropDownList(),
                     new Widget {
                         LayoutCell = new LayoutCell{
                             Stretch = new Vector2(9999, 9999)
                         }
                     },
                     CreateCloseButton()
                 }
             },
             (AddressBar = new AddressBar(view.Open, filesystemModel)),
         }
     }
         );
 }