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:
authorThomas Dinges <blender@dingto.org>2011-04-02 20:45:17 +0400
committerThomas Dinges <blender@dingto.org>2011-04-02 20:45:17 +0400
commit2c3b4a91dcfcafb94eb964ab3f02d02f46d1a059 (patch)
tree098e9f9aa886927320db9606a61410d1c5e327b0 /source/blender/editors/interface/interface_utils.c
parent447c73d639f9de776815634e27334cecbef397dd (diff)
Committing patch [#26740] Interface improvement for toolbar by Brecht. Thanks!
This patch makes the bool properties inside the toolshelf more compact, only 1 row per item now. :)
Diffstat (limited to 'source/blender/editors/interface/interface_utils.c')
-rw-r--r--source/blender/editors/interface/interface_utils.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index b72ae1a2a77..f22c8eb4bfe 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -145,16 +145,22 @@ int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, int (*check_prop)(Proper
continue;
if(label_align != '\0') {
+ PropertyType type = RNA_property_type(prop);
+ int is_boolean = (type == PROP_BOOLEAN && !RNA_property_array_check(ptr, prop));
+
name= RNA_property_ui_name(prop);
if(label_align=='V') {
col= uiLayoutColumn(layout, 1);
- uiItemL(col, name, ICON_NONE);
+
+ if(!is_boolean)
+ uiItemL(col, name, ICON_NONE);
}
else if(label_align=='H') {
split = uiLayoutSplit(layout, 0.5f, 0);
- uiItemL(uiLayoutColumn(split, 0), name, ICON_NONE);
+ col= uiLayoutColumn(split, 0);
+ uiItemL(col, (is_boolean)? "": name, ICON_NONE);
col= uiLayoutColumn(split, 0);
}
else {
@@ -163,12 +169,9 @@ int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, int (*check_prop)(Proper
/* may meed to add more cases here.
* don't override enum flag names */
- if(flag & PROP_ENUM_FLAG) {
- name= NULL;
- }
- else {
- name= ""; /* name is shown above, empty name for button below */
- }
+
+ /* name is shown above, empty name for button below */
+ name= (flag & PROP_ENUM_FLAG || is_boolean)? NULL: "";
}
else {
col= layout;