diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-04 07:07:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-04 07:09:37 +0300 |
commit | 578879253dcf04c293a6ef0e0b4c96b4558d4140 (patch) | |
tree | 613af629dc8638965acc864034acc9b1cf439c8a /source/blender/editors/interface | |
parent | 1d04d7721b2dd2de3127bf1604d10f005ab685e5 (diff) |
UI: use horizontal alignment for expanded enums
With the property separate option, the direction of expanded enums
now follows the current layout.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 86f1e5e158a..91756f9ae27 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1692,15 +1692,23 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index } } - /* Watch out! We can only write into the new column now. */ - layout = uiLayoutColumn(layout_split, true); - layout->space = 0; + /* Watch out! We can only write into the new layout now. */ if ((type == PROP_ENUM) && (flag & UI_ITEM_R_EXPAND)) { - /* pass (expanded enums each have their own name) */ + /* 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) { + layout = uiLayoutRow(layout_split, true); + } + else { + layout = uiLayoutColumn(layout_split, true); + } } else { name = ""; + layout = uiLayoutColumn(layout_split, true); } + layout->space = 0; #ifdef UI_PROP_SEP_ICON_WIDTH_EXCEPTION if (type == PROP_BOOLEAN && (icon == ICON_NONE) && !icon_only) { |