From 329c03bdf4bff8164743955201eebf0b02d051f4 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Tue, 13 Jan 2015 15:20:13 +0300 Subject: [PATCH] add resources; add workspace panel --- res/mdpi/project-development.png | Bin 0 -> 323 bytes res/mdpi/project-open.png | Bin 0 -> 638 bytes src/dlangide/ui/wspanel.d | 37 +++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 res/mdpi/project-development.png create mode 100644 res/mdpi/project-open.png create mode 100644 src/dlangide/ui/wspanel.d diff --git a/res/mdpi/project-development.png b/res/mdpi/project-development.png new file mode 100644 index 0000000000000000000000000000000000000000..6abc0f55a8795809d3dd5c1426c2d3fb29c851bd GIT binary patch literal 323 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}X@F0NE0E^q=H}qw05aep>AXbJ z1&Q=Cf|+Lo^YU_wFYwl1;p)7>KIIPcf`<%?7A;!8e*MMMcQ2j+qI;Ll-o1S0?&Y(0 zub#bg^U{-BmmlA~_T=uhr}ysNfBN*gTe~ HDWM4f75R}0 literal 0 HcmV?d00001 diff --git a/res/mdpi/project-open.png b/res/mdpi/project-open.png new file mode 100644 index 0000000000000000000000000000000000000000..0efc743ccbf7dd8aaa7a69b42f2aaf82d1c87026 GIT binary patch literal 638 zcmV-^0)hRBP)mL+IJ>P-r{&f16W18izBYDRSDzvmoJSf1#@7k)g?!~1`J7Y|db)f&dw-t{2w zvV5%biMx_u@$(l%qA^6H@qa^qiNpeGYB(g5Utyt|N_}4y!~*m1PemY1#qfdfy^CRb z4Zg`Z!oGPaGb1Dr4=$_GLI!iT*lg<&8G!El9QSuw> zF!Z+3%J!_YK{;##jnkyz_iIV{g**ZQ&lluaqvnq@$N@ey*X+L2r7MrOqwX!SN|%dF55 zTKx)pPVmqkwI~H?x+BmWGGj-f5!(tb!r0n}7r`YA`oG~hF(@+>`hl8Tok~G5*N&m^ zPdxK4VL(X1Gdc&pI{;_*M>u4}{)Tr374{^usRq_LZ43VVt?#w#?SPv(2yOn!K}cJPE-`*m^=z z&l3(2n(f5(-Utj09)U4k(cgycS%oYkubMEj^c*wG$mLjiwuNbOh-{8#Gxa7Zqsc4$ Y1>j$74D~Fn{{R3007*qoM6N<$f`B|H2LJ#7 literal 0 HcmV?d00001 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); + } +}