diff --git a/src/dlangide/ui/dsourceedit.d b/src/dlangide/ui/dsourceedit.d index ba23955..51b7ad2 100644 --- a/src/dlangide/ui/dsourceedit.d +++ b/src/dlangide/ui/dsourceedit.d @@ -32,6 +32,8 @@ class DSourceEdit : SourceEdit { MenuItem editPopupItem = new MenuItem(null); editPopupItem.add(ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, ACTION_EDIT_UNDO, ACTION_EDIT_REDO, ACTION_EDIT_INDENT, ACTION_EDIT_UNINDENT, ACTION_EDIT_TOGGLE_LINE_COMMENT); popupMenu = editPopupItem; + showIcons = true; + showFolding = true; } this() { this("SRCEDIT"); diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index 5bf3025..93be601 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -295,6 +295,7 @@ class IDEFrame : AppFrame { // Create workspace docked panel _wsPanel = new WorkspacePanel("workspace"); _wsPanel.sourceFileSelectionListener = &onSourceFileSelected; + _wsPanel.dockAlignment = DockAlignment.Left; _dockHost.addDockedWindow(_wsPanel); _logPanel = new OutputPanel("output"); @@ -425,6 +426,15 @@ class IDEFrame : AppFrame { } } + FileDialog createFileDialog(UIString caption) { + FileDialog dlg = new FileDialog(caption, window, null); + dlg.filetypeIcons[".d"] = "text-d"; + dlg.filetypeIcons["dub.json"] = "project-d"; + dlg.filetypeIcons["package.json"] = "project-d"; + dlg.filetypeIcons[".dlangidews"] = "project-development"; + return dlg; + } + /// override to handle specific actions override bool handleAction(const Action a) { if (a) { @@ -443,7 +453,7 @@ class IDEFrame : AppFrame { case IDEActions.FileOpen: UIString caption; caption = "Open Text File"d; - FileDialog dlg = new FileDialog(caption, window, null); + FileDialog dlg = createFileDialog(caption); dlg.addFilter(FileFilterEntry(UIString("Source files"d), "*.d;*.dd;*.ddoc;*.dh;*.json;*.xml;*.ini")); dlg.onDialogResult = delegate(Dialog dlg, const Action result) { if (result.id == ACTION_OPEN.id) { @@ -486,7 +496,7 @@ class IDEFrame : AppFrame { case IDEActions.FileOpenWorkspace: UIString caption; caption = "Open Workspace or Project"d; - FileDialog dlg = new FileDialog(caption, window, null); + FileDialog dlg = createFileDialog(caption); dlg.addFilter(FileFilterEntry(UIString("Workspace and project files"d), "*.dlangidews;dub.json;package.json")); dlg.onDialogResult = delegate(Dialog dlg, const Action result) { if (result.id == ACTION_OPEN.id) { diff --git a/src/dlangide/ui/wspanel.d b/src/dlangide/ui/wspanel.d index e93f226..139db4b 100644 --- a/src/dlangide/ui/wspanel.d +++ b/src/dlangide/ui/wspanel.d @@ -65,6 +65,7 @@ class WorkspacePanel : DockWindow { _tree.layoutHeight(FILL_PARENT).layoutHeight(FILL_PARENT); _tree.selectionListener = &onTreeItemSelected; _tree.fontSize = 16; + _tree.noCollapseForSingleTopLevelItem = true; return _tree; } @@ -87,7 +88,7 @@ class WorkspacePanel : DockWindow { p.objectParam = child; addProjectItems(p, child); } else { - TreeItem p = root.newChild(child.filename, child.name, "text-plain"); + TreeItem p = root.newChild(child.filename, child.name, "text-d"); p.intParam = ProjectItemType.SourceFile; p.objectParam = child; } @@ -100,7 +101,7 @@ class WorkspacePanel : DockWindow { TreeItem root = _tree.items.newChild(_workspace.filename, _workspace.name, "project-development"); root.intParam = ProjectItemType.Workspace; foreach(project; _workspace.projects) { - TreeItem p = root.newChild(project.filename, project.name, "project-open"); + TreeItem p = root.newChild(project.filename, project.name, "project-d"); p.intParam = ProjectItemType.Project; addProjectItems(p, project.items); } diff --git a/views/res/mdpi/project-d.png b/views/res/mdpi/project-d.png new file mode 100644 index 0000000..6371453 Binary files /dev/null and b/views/res/mdpi/project-d.png differ diff --git a/views/res/mdpi/project-development.png b/views/res/mdpi/project-development.png index 6abc0f5..94e4f6c 100644 Binary files a/views/res/mdpi/project-development.png and b/views/res/mdpi/project-development.png differ diff --git a/views/res/mdpi/project-open.png b/views/res/mdpi/project-open.png index 0efc743..5d9bef0 100644 Binary files a/views/res/mdpi/project-open.png and b/views/res/mdpi/project-open.png differ diff --git a/views/res/mdpi/text-d.png b/views/res/mdpi/text-d.png new file mode 100644 index 0000000..05efc16 Binary files /dev/null and b/views/res/mdpi/text-d.png differ diff --git a/views/resources.list b/views/resources.list index 37875a2..5d7ee6b 100644 --- a/views/resources.list +++ b/views/resources.list @@ -16,9 +16,11 @@ res/mdpi/edit-paste.png res/mdpi/edit-redo.png res/mdpi/edit-undo.png res/mdpi/edit-unindent.png +res/mdpi/project-d.png res/mdpi/project-development.png res/mdpi/project-open.png res/mdpi/run-build.png res/mdpi/run-build-clean.png res/mdpi/run-build-configure.png +res/mdpi/text-d.png res/mdpi/tx_fabric.jpg