Skip to content

Commit 4d45b72

Browse files
author
rdeioris
committed
improved SSplitter
1 parent 3553a3f commit 4d45b72

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Source/UnrealEnginePython/Private/Slate/UEPySSplitter.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ static PyObject *py_ue_ssplitter_add_slot(ue_PySSplitter *self, PyObject * args)
1616
if (!py_swidget) {
1717
return PyErr_Format(PyExc_Exception, "argument is not a SWidget");
1818
}
19-
// TODO: decrement reference when destroying parent
19+
2020
Py_INCREF(py_swidget);
21+
self->s_panel.s_widget.py_swidget_slots.Add(py_swidget);
2122

2223
SSplitter::FSlot &fslot = sw_splitter->AddSlot(index);
2324
fslot.AttachWidget(py_swidget->s_widget->AsShared());
@@ -63,7 +64,16 @@ PyTypeObject ue_PySSplitterType = {
6364
};
6465

6566
static int ue_py_ssplitter_init(ue_PySSplitter *self, PyObject *args, PyObject *kwargs) {
66-
ue_py_snew_simple(SSplitter, s_panel.s_widget);
67+
ue_py_slate_setup_farguments(SSplitter);
68+
69+
ue_py_slate_farguments_optional_float("hit_detection_splitter_handle_size", HitDetectionSplitterHandleSize);
70+
ue_py_slate_farguments_event("on_splitter_finished_resizing", OnSplitterFinishedResizing, FSimpleDelegate, SimpleExecuteAction);
71+
ue_py_slate_farguments_optional_enum("orientation", Orientation, EOrientation);
72+
ue_py_slate_farguments_optional_float("physical_splitter_handle_size", PhysicalSplitterHandleSize);
73+
ue_py_slate_farguments_optional_enum("resize_mode", ResizeMode, ESplitterResizeMode::Type);
74+
ue_py_slate_farguments_optional_struct_ptr("style", Style, FSplitterStyle);
75+
76+
ue_py_snew(SSplitter, s_panel.s_widget);
6777
return 0;
6878
}
6979

Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "Runtime/Slate/Public/Framework/Commands/UICommandInfo.h"
1111
#include "Runtime/Slate/Public/Framework/Docking/TabManager.h"
1212
#include "Runtime/Slate/Public/Widgets/Views/STableRow.h"
13+
#include "Editor/ContentBrowser/Public/ContentBrowserModule.h"
1314

1415

1516
#include "UEPySlate.h"
@@ -704,7 +705,6 @@ PyObject *py_unreal_engine_add_menu_extension(PyObject * self, PyObject * args)
704705
}
705706

706707

707-
708708
PyObject *py_unreal_engine_add_menu_bar_extension(PyObject * self, PyObject * args) {
709709

710710
char *command_name;

0 commit comments

Comments
 (0)