diff --git a/res/mdpi/project-development.png b/res/mdpi/project-development.png new file mode 100644 index 0000000..6abc0f5 Binary files /dev/null and b/res/mdpi/project-development.png differ diff --git a/res/mdpi/project-open.png b/res/mdpi/project-open.png new file mode 100644 index 0000000..0efc743 Binary files /dev/null and b/res/mdpi/project-open.png differ diff --git a/src/dlangide/ui/wspanel.d b/src/dlangide/ui/wspanel.d new file mode 100644 index 0000000..e1b3e73 --- /dev/null +++ b/src/dlangide/ui/wspanel.d @@ -0,0 +1,37 @@ +module dlangide.ui.wspanel; + +import dlangui.all; +import dlangide.workspace.workspace; + +class WorkspacePanel : VerticalLayout { + protected Workspace _workspace; + protected TreeWidget _tree; + + this(string id) { + super(id); + layoutHeight = FILL_PARENT; + _tree = new TreeWidget("wstree"); + _tree.layoutHeight = FILL_PARENT; + addChild(_tree); + workspace = null; + } + + @property Workspace workspace() { + return _workspace; + } + + @property void workspace(Workspace w) { + _workspace = w; + _tree.requestLayout(); + _tree.items.clear(); + if (w) { + TreeItem root = _tree.items.newChild(w.filename, w.name, "project-development"); + foreach(project; w.projects) { + TreeItem p = root.newChild(project.filename, project.name, "project-open"); + } + } else { + _tree.items.newChild("none", "New workspace"d, "project-development"); + } + _tree.onTreeContentChange(null); + } +}