[Bf-blender-cvs] [861b0ec4170] blender2.8: UI: Right align check-box for extra text space
Campbell Barton
noreply at git.blender.org
Mon Jun 25 12:07:17 CEST 2018
Commit: 861b0ec4170958814955eadf49c36109eacf9972
Author: Campbell Barton
Date: Mon Jun 25 12:06:31 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB861b0ec4170958814955eadf49c36109eacf9972
UI: Right align check-box for extra text space
See: T54951
===================================================================
M source/blender/editors/interface/interface_layout.c
===================================================================
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 3784ab635be..53a09136392 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -67,6 +67,9 @@
/* Show an icon button after each RNA button to use to quickly set keyframes,
* this is a way to display animation/driven/override status, see T54951. */
#define UI_PROP_DECORATE
+/* Alternate draw mode where some buttons can use single icon width,
+ * giving more room for the text at the expense of nicely aligned text. */
+#define UI_PROP_SEP_ICON_WIDTH_EXCEPTION
/************************ Structs and Defines *************************/
@@ -1595,9 +1598,19 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
}
else {
const PropertySubType subtype = RNA_property_subtype(prop);
- uiLayout *layout_split = uiLayoutSplit(
- layout_row ? layout_row : layout,
- UI_ITEM_PROP_SEP_DIVIDE, true);
+ uiLayout *layout_split;
+#ifdef UI_PROP_SEP_ICON_WIDTH_EXCEPTION
+ if (type == PROP_BOOLEAN && (icon == ICON_NONE) && !icon_only) {
+ w = UI_UNIT_X;
+ layout_split = uiLayoutRow(layout_row ? layout_row : layout, true);
+ }
+ else
+#endif /* UI_PROP_SEP_ICON_WIDTH_EXCEPTION */
+ {
+ layout_split = uiLayoutSplit(
+ layout_row ? layout_row : layout,
+ UI_ITEM_PROP_SEP_DIVIDE, true);
+ }
layout_split->space = 0;
uiLayout *layout_sub = uiLayoutColumn(layout_split, true);
layout_sub->space = 0;
More information about the Bf-blender-cvs
mailing list