Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-05-21 07:39:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-21 08:06:44 +0300
commit6640bcca742210fa3dc9c8a0675ebf71a9e9e7f6 (patch)
tree0798bbbc04b0f175a5b0284d5537246ed44ceaf7 /source/blender/editors/interface/interface_intern.h
parent87fda5bc608322dbddbe57303ad3ae5d737216e0 (diff)
UI: support drawing booleans with icons as check-boxes
Previously, if a boolean happened to use an icon there was no way to make it display as a check-box from Python scripts. The previous logic meant we ended up having to edit the RNA. Since booleans with icons don't work well with the split-property layout (now used for most of the interface). Icons were being removed from RNA then added back using awkward Python ternary expressions in the interface scripts. The toggle argument now has an unset state (-1). - toggle=True: no checkbox (emboss). - toggle=False: always use a checkbox (no icon). - toggle=(unset/-1): depends on the icon status, default as before. Since toggle=False was default, this isn't used in existing UI logic.
Diffstat (limited to 'source/blender/editors/interface/interface_intern.h')
-rw-r--r--source/blender/editors/interface/interface_intern.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 33288df15ba..8a2b28ee2d4 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -500,6 +500,7 @@ extern int ui_but_string_get_max_length(uiBut *but);
extern uiBut *ui_but_drag_multi_edit_get(uiBut *but);
void ui_def_but_icon(uiBut *but, const int icon, const int flag);
+void ui_def_but_icon_clear(uiBut *but);
extern uiButExtraIconType ui_but_icon_extra_get(uiBut *but);
extern void ui_but_default_set(struct bContext *C, const bool all, const bool use_afterfunc);