diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-20 03:59:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-20 03:59:31 +0300 |
commit | 91240f15c54632409da3f09d1c3eb40e6f66e52d (patch) | |
tree | 85d94415556b12728864a024dd64f871ef9b57d8 /source/blender/editors | |
parent | 756be8f4d8ff2ba3915b67c36c2e40f1652397da (diff) |
UI: add UILayout.direction
Read only attribute, needed for introspection.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 80ac5e72868..31956877d1b 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1003,6 +1003,7 @@ void uiLayoutSetUnitsY(uiLayout *layout, float unit); void uiLayoutSetEmboss(uiLayout *layout, char emboss); void uiLayoutSetPropSep(uiLayout *layout, bool is_sep); void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep); +int uiLayoutGetLocalDir(const uiLayout *layout); int uiLayoutGetOperatorContext(uiLayout *layout); bool uiLayoutGetActive(uiLayout *layout); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index afcbcbbdf52..9b145fdba92 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -380,7 +380,7 @@ static void ui_item_move(uiItem *item, int delta_xmin, int delta_xmax) /******************** Special RNA Items *********************/ -static int ui_layout_local_dir(uiLayout *layout) +int uiLayoutGetLocalDir(const uiLayout *layout) { switch (layout->item.type) { case ITEM_LAYOUT_ROW: @@ -402,7 +402,7 @@ static uiLayout *ui_item_local_sublayout(uiLayout *test, uiLayout *layout, bool { uiLayout *sub; - if (ui_layout_local_dir(test) == UI_LAYOUT_HORIZONTAL) + if (uiLayoutGetLocalDir(test) == UI_LAYOUT_HORIZONTAL) sub = uiLayoutRow(layout, align); else sub = uiLayoutColumn(layout, align); @@ -731,7 +731,7 @@ static void ui_item_enum_expand_exec( UI_but_func_set(but, ui_item_enum_expand_handle, but, POINTER_FROM_INT(value)); } - if (ui_layout_local_dir(layout) != UI_LAYOUT_HORIZONTAL) + if (uiLayoutGetLocalDir(layout) != UI_LAYOUT_HORIZONTAL) but->drawflag |= UI_BUT_TEXT_LEFT; /* Allow quick, inaccurate swipe motions to switch tabs (no need to keep cursor over them). */ @@ -1749,7 +1749,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index /* Expanded enums each have their own name. */ /* Often expanded enum's are better arranged into a row, so check the existing layout. */ - if (ui_layout_local_dir(layout) == UI_LAYOUT_HORIZONTAL) { + if (uiLayoutGetLocalDir(layout) == UI_LAYOUT_HORIZONTAL) { layout = uiLayoutRow(layout_split, true); } else { |