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:
authorMatt Ebb <matt@mke3.net>2009-09-14 02:33:47 +0400
committerMatt Ebb <matt@mke3.net>2009-09-14 02:33:47 +0400
commit492f6589c4857d207810f7b546817c2ae35184c8 (patch)
tree90bde7c5f98e92988cf1843870ab6e623777ba0f /source/blender/makesrna/intern/rna_ui_api.c
parenta4532b202b960fcff3049fa047c8e828802e91ce (diff)
New 'icon_only' wasn't actually exposed in the ui api, causing errors in the py scripts, so I added it to ItemR. Also reverted Joshua's temporary fix, which didn't seem to help much and was making the render engine menu too small.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index ab2dfe5e33c..e3cae8ab453 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -37,17 +37,15 @@
#ifdef RNA_RUNTIME
-static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle)
+static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle, int icon_only)
{
int flag= 0;
flag |= (slider)? UI_ITEM_R_SLIDER: 0;
flag |= (expand)? UI_ITEM_R_EXPAND: 0;
flag |= (toggle)? UI_ITEM_R_TOGGLE: 0;
+ flag |= (icon_only)? UI_ITEM_R_ICON_ONLY: 0;
- // XXX: an 'icon_only' prop should be added instead, but for now, this makes ptrs look ok
- flag |= (name && name[0]==0)? UI_ITEM_R_ICON_ONLY: 0;
-
uiItemR(layout, name, icon, ptr, propname, flag);
}
@@ -148,6 +146,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values.");
RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values.");
+ RNA_def_boolean(func, "icon_only", 0, "", "Only show the property's icon, with no text");
func= RNA_def_function(srna, "items_enumR", "uiItemsEnumR");
api_ui_item_rna_common(func);