split_container.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. /**************************************************************************/
  2. /* split_container.cpp */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #include "split_container.h"
  31. #include "scene/gui/label.h"
  32. #include "scene/gui/margin_container.h"
  33. #include "scene/main/window.h"
  34. #include "scene/theme/theme_db.h"
  35. void SplitContainerDragger::gui_input(const Ref<InputEvent> &p_event) {
  36. ERR_FAIL_COND(p_event.is_null());
  37. SplitContainer *sc = Object::cast_to<SplitContainer>(get_parent());
  38. if (sc->collapsed || !sc->_get_sortable_child(0) || !sc->_get_sortable_child(1) || !sc->dragging_enabled) {
  39. return;
  40. }
  41. Ref<InputEventMouseButton> mb = p_event;
  42. if (mb.is_valid()) {
  43. if (mb->get_button_index() == MouseButton::LEFT) {
  44. if (mb->is_pressed()) {
  45. sc->_compute_split_offset(true);
  46. dragging = true;
  47. sc->emit_signal(SNAME("drag_started"));
  48. drag_ofs = sc->split_offset;
  49. if (sc->vertical) {
  50. drag_from = get_transform().xform(mb->get_position()).y;
  51. } else {
  52. drag_from = get_transform().xform(mb->get_position()).x;
  53. }
  54. } else {
  55. dragging = false;
  56. queue_redraw();
  57. sc->emit_signal(SNAME("drag_ended"));
  58. }
  59. }
  60. }
  61. Ref<InputEventMouseMotion> mm = p_event;
  62. if (mm.is_valid()) {
  63. if (!dragging) {
  64. return;
  65. }
  66. Vector2i in_parent_pos = get_transform().xform(mm->get_position());
  67. if (!sc->vertical && is_layout_rtl()) {
  68. sc->split_offset = drag_ofs - (in_parent_pos.x - drag_from);
  69. } else {
  70. sc->split_offset = drag_ofs + ((sc->vertical ? in_parent_pos.y : in_parent_pos.x) - drag_from);
  71. }
  72. sc->_compute_split_offset(true);
  73. sc->queue_sort();
  74. sc->emit_signal(SNAME("dragged"), sc->get_split_offset());
  75. }
  76. }
  77. Control::CursorShape SplitContainerDragger::get_cursor_shape(const Point2 &p_pos) const {
  78. SplitContainer *sc = Object::cast_to<SplitContainer>(get_parent());
  79. if (!sc->collapsed && sc->dragging_enabled) {
  80. return (sc->vertical ? CURSOR_VSPLIT : CURSOR_HSPLIT);
  81. }
  82. return Control::get_cursor_shape(p_pos);
  83. }
  84. void SplitContainerDragger::_notification(int p_what) {
  85. switch (p_what) {
  86. case NOTIFICATION_MOUSE_ENTER: {
  87. mouse_inside = true;
  88. SplitContainer *sc = Object::cast_to<SplitContainer>(get_parent());
  89. if (sc->theme_cache.autohide) {
  90. queue_redraw();
  91. }
  92. } break;
  93. case NOTIFICATION_MOUSE_EXIT: {
  94. mouse_inside = false;
  95. SplitContainer *sc = Object::cast_to<SplitContainer>(get_parent());
  96. if (sc->theme_cache.autohide) {
  97. queue_redraw();
  98. }
  99. } break;
  100. case NOTIFICATION_DRAW: {
  101. SplitContainer *sc = Object::cast_to<SplitContainer>(get_parent());
  102. draw_style_box(sc->theme_cache.split_bar_background, split_bar_rect);
  103. if (sc->dragger_visibility == sc->DRAGGER_VISIBLE && (dragging || mouse_inside || !sc->theme_cache.autohide)) {
  104. Ref<Texture2D> tex = sc->_get_grabber_icon();
  105. float available_size = sc->vertical ? (sc->get_size().x - tex->get_size().x) : (sc->get_size().y - tex->get_size().y);
  106. if (available_size - sc->drag_area_margin_begin - sc->drag_area_margin_end > 0) { // Draw the grabber only if it fits.
  107. draw_texture(tex, (split_bar_rect.get_position() + (split_bar_rect.get_size() - tex->get_size()) * 0.5));
  108. }
  109. }
  110. if (sc->show_drag_area && Engine::get_singleton()->is_editor_hint()) {
  111. draw_rect(Rect2(Vector2(0, 0), get_size()), sc->dragging_enabled ? Color(1, 1, 0, 0.3) : Color(1, 0, 0, 0.3));
  112. }
  113. } break;
  114. }
  115. }
  116. Control *SplitContainer::_get_sortable_child(int p_idx, SortableVisbilityMode p_visibility_mode) const {
  117. int idx = 0;
  118. for (int i = 0; i < get_child_count(false); i++) {
  119. Control *c = as_sortable_control(get_child(i, false), p_visibility_mode);
  120. if (!c) {
  121. continue;
  122. }
  123. if (idx == p_idx) {
  124. return c;
  125. }
  126. idx++;
  127. }
  128. return nullptr;
  129. }
  130. Ref<Texture2D> SplitContainer::_get_grabber_icon() const {
  131. if (is_fixed) {
  132. return theme_cache.grabber_icon;
  133. } else {
  134. if (vertical) {
  135. return theme_cache.grabber_icon_v;
  136. } else {
  137. return theme_cache.grabber_icon_h;
  138. }
  139. }
  140. }
  141. int SplitContainer::_get_separation() const {
  142. if (dragger_visibility == DRAGGER_HIDDEN_COLLAPSED) {
  143. return 0;
  144. }
  145. // DRAGGER_VISIBLE or DRAGGER_HIDDEN.
  146. Ref<Texture2D> g = _get_grabber_icon();
  147. return MAX(theme_cache.separation, vertical ? g->get_height() : g->get_width());
  148. }
  149. void SplitContainer::_compute_split_offset(bool p_clamp) {
  150. Control *first = _get_sortable_child(0);
  151. Control *second = _get_sortable_child(1);
  152. int axis_index = vertical ? 1 : 0;
  153. int size = get_size()[axis_index];
  154. int sep = _get_separation();
  155. // Compute the wished size.
  156. int wished_size = 0;
  157. int split_offset_with_collapse = 0;
  158. if (!collapsed) {
  159. split_offset_with_collapse = split_offset;
  160. }
  161. bool first_is_expanded = (vertical ? first->get_v_size_flags() : first->get_h_size_flags()) & SIZE_EXPAND;
  162. bool second_is_expanded = (vertical ? second->get_v_size_flags() : second->get_h_size_flags()) & SIZE_EXPAND;
  163. if (first_is_expanded && second_is_expanded) {
  164. float ratio = first->get_stretch_ratio() / (first->get_stretch_ratio() + second->get_stretch_ratio());
  165. wished_size = size * ratio - sep * 0.5 + split_offset_with_collapse;
  166. } else if (first_is_expanded) {
  167. wished_size = size - sep + split_offset_with_collapse;
  168. } else {
  169. wished_size = split_offset_with_collapse;
  170. }
  171. // Clamp the split offset to acceptable values.
  172. int first_min_size = first->get_combined_minimum_size()[axis_index];
  173. int second_min_size = second->get_combined_minimum_size()[axis_index];
  174. computed_split_offset = CLAMP(wished_size, first_min_size, size - sep - second_min_size);
  175. // Clamp the split_offset if requested.
  176. if (p_clamp) {
  177. split_offset -= wished_size - computed_split_offset;
  178. }
  179. }
  180. void SplitContainer::_resort() {
  181. Control *first = _get_sortable_child(0);
  182. Control *second = _get_sortable_child(1);
  183. if (!first || !second) { // Only one child.
  184. if (first) {
  185. fit_child_in_rect(first, Rect2(Point2(), get_size()));
  186. } else if (second) {
  187. fit_child_in_rect(second, Rect2(Point2(), get_size()));
  188. }
  189. dragging_area_control->hide();
  190. return;
  191. }
  192. dragging_area_control->set_visible(!collapsed);
  193. _compute_split_offset(false); // This recalculates and sets computed_split_offset.
  194. int sep = _get_separation();
  195. bool is_rtl = is_layout_rtl();
  196. // Move the children.
  197. if (vertical) {
  198. fit_child_in_rect(first, Rect2(Point2(0, 0), Size2(get_size().width, computed_split_offset)));
  199. int sofs = computed_split_offset + sep;
  200. fit_child_in_rect(second, Rect2(Point2(0, sofs), Size2(get_size().width, get_size().height - sofs)));
  201. } else {
  202. if (is_rtl) {
  203. computed_split_offset = get_size().width - computed_split_offset - sep;
  204. fit_child_in_rect(second, Rect2(Point2(0, 0), Size2(computed_split_offset, get_size().height)));
  205. int sofs = computed_split_offset + sep;
  206. fit_child_in_rect(first, Rect2(Point2(sofs, 0), Size2(get_size().width - sofs, get_size().height)));
  207. } else {
  208. fit_child_in_rect(first, Rect2(Point2(0, 0), Size2(computed_split_offset, get_size().height)));
  209. int sofs = computed_split_offset + sep;
  210. fit_child_in_rect(second, Rect2(Point2(sofs, 0), Size2(get_size().width - sofs, get_size().height)));
  211. }
  212. }
  213. dragging_area_control->set_mouse_filter(dragging_enabled ? MOUSE_FILTER_STOP : MOUSE_FILTER_IGNORE);
  214. const int dragger_ctrl_size = MAX(sep, theme_cache.minimum_grab_thickness);
  215. float split_bar_offset = (dragger_ctrl_size - sep) * 0.5;
  216. if (vertical) {
  217. Rect2 split_bar_rect = Rect2(is_rtl ? drag_area_margin_end : drag_area_margin_begin, computed_split_offset, get_size().width - drag_area_margin_begin - drag_area_margin_end, sep);
  218. dragging_area_control->set_rect(Rect2(split_bar_rect.position.x, split_bar_rect.position.y - split_bar_offset + drag_area_offset, split_bar_rect.size.x, dragger_ctrl_size));
  219. dragging_area_control->split_bar_rect = Rect2(Vector2(0.0, int(split_bar_offset) - drag_area_offset), split_bar_rect.size);
  220. } else {
  221. Rect2 split_bar_rect = Rect2(computed_split_offset, drag_area_margin_begin, sep, get_size().height - drag_area_margin_begin - drag_area_margin_end);
  222. dragging_area_control->set_rect(Rect2(split_bar_rect.position.x - split_bar_offset + drag_area_offset * (is_rtl ? -1 : 1), split_bar_rect.position.y, dragger_ctrl_size, split_bar_rect.size.y));
  223. dragging_area_control->split_bar_rect = Rect2(Vector2(int(split_bar_offset) - drag_area_offset * (is_rtl ? -1 : 1), 0.0), split_bar_rect.size);
  224. }
  225. queue_redraw();
  226. dragging_area_control->queue_redraw();
  227. }
  228. Size2 SplitContainer::get_minimum_size() const {
  229. Size2i minimum;
  230. int sep = _get_separation();
  231. for (int i = 0; i < 2; i++) {
  232. Control *child = _get_sortable_child(i, SortableVisbilityMode::VISIBLE);
  233. if (!child) {
  234. break;
  235. }
  236. if (i == 1) {
  237. if (vertical) {
  238. minimum.height += sep;
  239. } else {
  240. minimum.width += sep;
  241. }
  242. }
  243. Size2 ms = child->get_combined_minimum_size();
  244. if (vertical) {
  245. minimum.height += ms.height;
  246. minimum.width = MAX(minimum.width, ms.width);
  247. } else {
  248. minimum.width += ms.width;
  249. minimum.height = MAX(minimum.height, ms.height);
  250. }
  251. }
  252. return minimum;
  253. }
  254. void SplitContainer::_validate_property(PropertyInfo &p_property) const {
  255. if (is_fixed && p_property.name == "vertical") {
  256. p_property.usage = PROPERTY_USAGE_NONE;
  257. }
  258. }
  259. void SplitContainer::_notification(int p_what) {
  260. switch (p_what) {
  261. case NOTIFICATION_TRANSLATION_CHANGED:
  262. case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: {
  263. queue_sort();
  264. } break;
  265. case NOTIFICATION_SORT_CHILDREN: {
  266. _resort();
  267. } break;
  268. case NOTIFICATION_THEME_CHANGED: {
  269. update_minimum_size();
  270. } break;
  271. }
  272. }
  273. void SplitContainer::set_split_offset(int p_offset) {
  274. if (split_offset == p_offset) {
  275. return;
  276. }
  277. split_offset = p_offset;
  278. queue_sort();
  279. }
  280. int SplitContainer::get_split_offset() const {
  281. return split_offset;
  282. }
  283. void SplitContainer::clamp_split_offset() {
  284. if (!_get_sortable_child(0) || !_get_sortable_child(1)) {
  285. return;
  286. }
  287. _compute_split_offset(true);
  288. queue_sort();
  289. }
  290. void SplitContainer::set_collapsed(bool p_collapsed) {
  291. if (collapsed == p_collapsed) {
  292. return;
  293. }
  294. collapsed = p_collapsed;
  295. queue_sort();
  296. }
  297. void SplitContainer::set_dragger_visibility(DraggerVisibility p_visibility) {
  298. if (dragger_visibility == p_visibility) {
  299. return;
  300. }
  301. dragger_visibility = p_visibility;
  302. queue_sort();
  303. }
  304. SplitContainer::DraggerVisibility SplitContainer::get_dragger_visibility() const {
  305. return dragger_visibility;
  306. }
  307. bool SplitContainer::is_collapsed() const {
  308. return collapsed;
  309. }
  310. void SplitContainer::set_vertical(bool p_vertical) {
  311. ERR_FAIL_COND_MSG(is_fixed, "Can't change orientation of " + get_class() + ".");
  312. vertical = p_vertical;
  313. update_minimum_size();
  314. _resort();
  315. }
  316. bool SplitContainer::is_vertical() const {
  317. return vertical;
  318. }
  319. void SplitContainer::set_dragging_enabled(bool p_enabled) {
  320. if (dragging_enabled == p_enabled) {
  321. return;
  322. }
  323. dragging_enabled = p_enabled;
  324. if (!dragging_enabled && dragging_area_control->dragging) {
  325. dragging_area_control->dragging = false;
  326. // queue_redraw() is called by _resort().
  327. emit_signal(SNAME("drag_ended"));
  328. }
  329. if (get_viewport()) {
  330. get_viewport()->update_mouse_cursor_state();
  331. }
  332. _resort();
  333. }
  334. bool SplitContainer::is_dragging_enabled() const {
  335. return dragging_enabled;
  336. }
  337. Vector<int> SplitContainer::get_allowed_size_flags_horizontal() const {
  338. Vector<int> flags;
  339. flags.append(SIZE_FILL);
  340. if (!vertical) {
  341. flags.append(SIZE_EXPAND);
  342. }
  343. flags.append(SIZE_SHRINK_BEGIN);
  344. flags.append(SIZE_SHRINK_CENTER);
  345. flags.append(SIZE_SHRINK_END);
  346. return flags;
  347. }
  348. Vector<int> SplitContainer::get_allowed_size_flags_vertical() const {
  349. Vector<int> flags;
  350. flags.append(SIZE_FILL);
  351. if (vertical) {
  352. flags.append(SIZE_EXPAND);
  353. }
  354. flags.append(SIZE_SHRINK_BEGIN);
  355. flags.append(SIZE_SHRINK_CENTER);
  356. flags.append(SIZE_SHRINK_END);
  357. return flags;
  358. }
  359. void SplitContainer::set_drag_area_margin_begin(int p_margin) {
  360. if (drag_area_margin_begin == p_margin) {
  361. return;
  362. }
  363. drag_area_margin_begin = p_margin;
  364. queue_sort();
  365. }
  366. int SplitContainer::get_drag_area_margin_begin() const {
  367. return drag_area_margin_begin;
  368. }
  369. void SplitContainer::set_drag_area_margin_end(int p_margin) {
  370. if (drag_area_margin_end == p_margin) {
  371. return;
  372. }
  373. drag_area_margin_end = p_margin;
  374. queue_sort();
  375. }
  376. int SplitContainer::get_drag_area_margin_end() const {
  377. return drag_area_margin_end;
  378. }
  379. void SplitContainer::set_drag_area_offset(int p_offset) {
  380. if (drag_area_offset == p_offset) {
  381. return;
  382. }
  383. drag_area_offset = p_offset;
  384. queue_sort();
  385. }
  386. int SplitContainer::get_drag_area_offset() const {
  387. return drag_area_offset;
  388. }
  389. void SplitContainer::set_show_drag_area_enabled(bool p_enabled) {
  390. show_drag_area = p_enabled;
  391. dragging_area_control->queue_redraw();
  392. }
  393. bool SplitContainer::is_show_drag_area_enabled() const {
  394. return show_drag_area;
  395. }
  396. void SplitContainer::_bind_methods() {
  397. ClassDB::bind_method(D_METHOD("set_split_offset", "offset"), &SplitContainer::set_split_offset);
  398. ClassDB::bind_method(D_METHOD("get_split_offset"), &SplitContainer::get_split_offset);
  399. ClassDB::bind_method(D_METHOD("clamp_split_offset"), &SplitContainer::clamp_split_offset);
  400. ClassDB::bind_method(D_METHOD("set_collapsed", "collapsed"), &SplitContainer::set_collapsed);
  401. ClassDB::bind_method(D_METHOD("is_collapsed"), &SplitContainer::is_collapsed);
  402. ClassDB::bind_method(D_METHOD("set_dragger_visibility", "mode"), &SplitContainer::set_dragger_visibility);
  403. ClassDB::bind_method(D_METHOD("get_dragger_visibility"), &SplitContainer::get_dragger_visibility);
  404. ClassDB::bind_method(D_METHOD("set_vertical", "vertical"), &SplitContainer::set_vertical);
  405. ClassDB::bind_method(D_METHOD("is_vertical"), &SplitContainer::is_vertical);
  406. ClassDB::bind_method(D_METHOD("set_dragging_enabled", "dragging_enabled"), &SplitContainer::set_dragging_enabled);
  407. ClassDB::bind_method(D_METHOD("is_dragging_enabled"), &SplitContainer::is_dragging_enabled);
  408. ClassDB::bind_method(D_METHOD("set_drag_area_margin_begin", "margin"), &SplitContainer::set_drag_area_margin_begin);
  409. ClassDB::bind_method(D_METHOD("get_drag_area_margin_begin"), &SplitContainer::get_drag_area_margin_begin);
  410. ClassDB::bind_method(D_METHOD("set_drag_area_margin_end", "margin"), &SplitContainer::set_drag_area_margin_end);
  411. ClassDB::bind_method(D_METHOD("get_drag_area_margin_end"), &SplitContainer::get_drag_area_margin_end);
  412. ClassDB::bind_method(D_METHOD("set_drag_area_offset", "offset"), &SplitContainer::set_drag_area_offset);
  413. ClassDB::bind_method(D_METHOD("get_drag_area_offset"), &SplitContainer::get_drag_area_offset);
  414. ClassDB::bind_method(D_METHOD("set_drag_area_highlight_in_editor", "drag_area_highlight_in_editor"), &SplitContainer::set_show_drag_area_enabled);
  415. ClassDB::bind_method(D_METHOD("is_drag_area_highlight_in_editor_enabled"), &SplitContainer::is_show_drag_area_enabled);
  416. ClassDB::bind_method(D_METHOD("get_drag_area_control"), &SplitContainer::get_drag_area_control);
  417. ADD_SIGNAL(MethodInfo("dragged", PropertyInfo(Variant::INT, "offset")));
  418. ADD_SIGNAL(MethodInfo("drag_started"));
  419. ADD_SIGNAL(MethodInfo("drag_ended"));
  420. ADD_PROPERTY(PropertyInfo(Variant::INT, "split_offset", PROPERTY_HINT_NONE, "suffix:px"), "set_split_offset", "get_split_offset");
  421. ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collapsed"), "set_collapsed", "is_collapsed");
  422. ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dragging_enabled"), "set_dragging_enabled", "is_dragging_enabled");
  423. ADD_PROPERTY(PropertyInfo(Variant::INT, "dragger_visibility", PROPERTY_HINT_ENUM, "Visible,Hidden,Hidden and Collapsed"), "set_dragger_visibility", "get_dragger_visibility");
  424. ADD_PROPERTY(PropertyInfo(Variant::BOOL, "vertical"), "set_vertical", "is_vertical");
  425. ADD_GROUP("Drag Area", "drag_area_");
  426. ADD_PROPERTY(PropertyInfo(Variant::INT, "drag_area_margin_begin", PROPERTY_HINT_NONE, "suffix:px"), "set_drag_area_margin_begin", "get_drag_area_margin_begin");
  427. ADD_PROPERTY(PropertyInfo(Variant::INT, "drag_area_margin_end", PROPERTY_HINT_NONE, "suffix:px"), "set_drag_area_margin_end", "get_drag_area_margin_end");
  428. ADD_PROPERTY(PropertyInfo(Variant::INT, "drag_area_offset", PROPERTY_HINT_NONE, "suffix:px"), "set_drag_area_offset", "get_drag_area_offset");
  429. ADD_PROPERTY(PropertyInfo(Variant::BOOL, "drag_area_highlight_in_editor"), "set_drag_area_highlight_in_editor", "is_drag_area_highlight_in_editor_enabled");
  430. BIND_ENUM_CONSTANT(DRAGGER_VISIBLE);
  431. BIND_ENUM_CONSTANT(DRAGGER_HIDDEN);
  432. BIND_ENUM_CONSTANT(DRAGGER_HIDDEN_COLLAPSED);
  433. BIND_THEME_ITEM(Theme::DATA_TYPE_CONSTANT, SplitContainer, separation);
  434. BIND_THEME_ITEM(Theme::DATA_TYPE_CONSTANT, SplitContainer, minimum_grab_thickness);
  435. BIND_THEME_ITEM(Theme::DATA_TYPE_CONSTANT, SplitContainer, autohide);
  436. BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, SplitContainer, grabber_icon, "grabber");
  437. BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, SplitContainer, grabber_icon_h, "h_grabber");
  438. BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, SplitContainer, grabber_icon_v, "v_grabber");
  439. BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_STYLEBOX, SplitContainer, split_bar_background, "split_bar_background");
  440. }
  441. SplitContainer::SplitContainer(bool p_vertical) {
  442. vertical = p_vertical;
  443. dragging_area_control = memnew(SplitContainerDragger);
  444. add_child(dragging_area_control, false, Node::INTERNAL_MODE_BACK);
  445. }