summaryrefslogtreecommitdiff
path: root/tools/editor/scenes_dock.h
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2014-06-11 01:11:45 -0300
committerreduz <reduzio@gmail.com>2014-06-11 01:11:45 -0300
commitb0b6f143ffbf7fad0e2f2b2e50adb8474bfabfe3 (patch)
tree05a3c75a849d20b0708e965d600324781a3ec4a7 /tools/editor/scenes_dock.h
parent3a7cbfcea64040b5afbd466d0370445194aa11c6 (diff)
parent2c3d279c759cf6fa096f762c96920137e84d1f77 (diff)
Merge pull request #496 from marynate/PR-scene-dock-search
Adding search box to scene dock(file system tab)
Diffstat (limited to 'tools/editor/scenes_dock.h')
-rw-r--r--tools/editor/scenes_dock.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/tools/editor/scenes_dock.h b/tools/editor/scenes_dock.h
index eab31a5a4d..cf48e2885f 100644
--- a/tools/editor/scenes_dock.h
+++ b/tools/editor/scenes_dock.h
@@ -34,6 +34,8 @@
#include "scene/gui/tree.h"
#include "scene/gui/label.h"
#include "scene/gui/button.h"
+#include "scene/gui/option_button.h"
+#include "scene/gui/box_container.h"
#include "os/dir_access.h"
#include "os/thread.h"
@@ -42,8 +44,9 @@
class EditorNode;
-class ScenesDock : public Control {
- OBJ_TYPE( ScenesDock, Control );
+class ScenesDockFilter;
+class ScenesDock : public VBoxContainer {
+ OBJ_TYPE( ScenesDock, VBoxContainer );
EditorNode *editor;
Set<String> favorites;
@@ -54,6 +57,8 @@ class ScenesDock : public Control {
Button *button_open;
Timer *timer;
+ ScenesDockFilter *tree_filter;
+
bool updating_tree;
Tree * tree;
bool _create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir);
@@ -77,4 +82,34 @@ public:
~ScenesDock();
};
+class ScenesDockFilter : public HBoxContainer {
+
+ OBJ_TYPE( ScenesDockFilter, HBoxContainer );
+
+ enum Command {
+ CMD_CLEAR_FILTER,
+ };
+
+ Tree *tree;
+ OptionButton *file_filter;
+ LineEdit *search_box;
+ Button *clear_search_button;
+
+ String _current_filter;
+ Vector<String> filters;
+
+ void _command(int p_command);
+ void _search_text_changed(const String& p_newtext);
+ void _setup_filters();
+ void _file_filter_selected(int p_idx);
+
+protected:
+ static void _bind_methods();
+
+public:
+ String get_search_term();
+ String get_file_filter();
+ ScenesDockFilter(Tree *p_tree);
+};
+
#endif // SCENES_DOCK_H