IControl CreateContent(CreateProject createProject, IDialog <object> dialog, string fuseVersion) { var projectList = new ProjectList(new Shell(), createProject, dialog); var openProjectFromDialog = Command.Enabled(() => Application.ShowOpenDocumentDialog(DocumentTypes.Project)); return(Popover.Host(popover => Layout.Dock() .Top( CreateDashTopBar(fuseVersion) ) .Top(Separator.Medium) .Right(Layout.StackFromTop( Layout.Dock() .Fill( Layout.SubdivideVertically( InfoItem("Learn", "New to Fuse? Explore our Handbook,\r\nTutorials and Examples.", "http://go.fusetools.com/tutorials", "Outracks.Fuse.Icons.Dashboard.Learn.png"), InfoItem("Docs", "Need some technical information?\r\nSearch the reference docs.", "https://go.fusetools.com/docs", "Outracks.Fuse.Icons.Dashboard.Docs.png"), InfoItem("Community", "Made something cool? Join a thriving\r\ncommunity of Fuse enthusiasts.", "https://go.fusetools.com/community", "Outracks.Fuse.Icons.Dashboard.Community.png")) .WithPadding( left: new Points(32), top: new Points(40)) .WithHeight(300)), Separator.Weak, CreateOpenButtons(openProjectFromDialog, projectList) ) .WithWidth(260) .WithHeight(600) .WithBackground(Theme.PanelBackground)) .Fill(projectList.Page) .WithBackground(Theme.WorkspaceBackground) .WithHeight(608) .WithWidth(970))); }
public ProjectList(IShell shell, CreateProject createProject, IDialog <object> parent) { _shell = shell; var recentProjectItems = RecentProjects.All .SelectPerElement(project => new ProjectListItem( menuItemName: "Open", title: project.Name, descriptionTitle: "Last opened:", description: ProjectLastOpenedString(project), locationTitle: "Location:", location: project.ProjectPath.NativePath, command: Command.Enabled(async() => { await Application.OpenDocument(project.ProjectPath, showWindow: true); parent.Close(); }), thumbnail: Layout.Dock() .Fill( Icons.ProjectIcon() .WithOverlay(Shapes.Rectangle( stroke: Stroke.Create(0.5, Theme.DescriptorText), cornerRadius: Observable.Return(new CornerRadius(2)) )) ), projectFile: project.ProjectPath)); var newProjectItems = TemplateLoader .LoadTemplatesFrom(UnoConfig.Current.GetTemplatesDir() / "Projects", _shell) .Select(template => new ProjectListItem( menuItemName: "Create", title: "New " + template.Name, descriptionTitle: "Description:", description: template.Description, locationTitle: String.Empty, location: String.Empty, command: Command.Enabled(async() => { if (await createProject.ShowDialog(template, parent)) { parent.Close(); } }), thumbnail: Icon(Color.Transparent, fg => MainWindowIcons.AddIcon(Stroke.Create(1, fg))))) .ToImmutableList(); _selectedItem = new BehaviorSubject <ProjectListItem>(newProjectItems.First()); _allProjectItems = recentProjectItems .Select(newProjectItems.AddRange) .Replay(1).RefCount(); }
public Dashboard(CreateProject createProject, IFuse fuse) { Application.Desktop.CreateSingletonWindow( isVisible: _isVisible, window: window => new Window { Style = WindowStyle.Fat, Title = Observable.Return("Fuse"), Size = Optional.Some(Property.Constant(Optional.Some(new Size <Points>(970, 608)))), Content = Control.Lazy(() => CreateContent(createProject, window, fuse.Version)), Foreground = Theme.DefaultText, Background = Theme.PanelBackground, Border = Separator.MediumStroke, HideTitle = true, }); }