diff options
author | Matt Ebb <matt@mke3.net> | 2009-01-04 05:09:41 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-01-04 05:09:41 +0300 |
commit | 475a64fc9196c645973c5c5aac7c5231ab6460fa (patch) | |
tree | 81211acfd49936ae0788ba55ebe4b92361173468 /source/blender/editors/interface/interface.c | |
parent | 610a56843efd162831128689a00e671647719a99 (diff) |
* Added support for displaying disabled RNA buttons
The functionality already existed via the RNA system, this
commit makes disabled buttons draw greyed out, and not respond to clicks
(previously, they would drag/edit/etc but then reset to the previous value)
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index bfe39c41a0a..941528169c3 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2118,6 +2118,12 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, but->rnapoin= *ptr; but->rnaprop= prop; but->rnaindex= index; + + if (!RNA_property_editable(&but->rnapoin, prop)) { + but->flag |= UI_BUT_DISABLED; + but->lock = 1; + but->lockstr = ""; + } if(freestr) MEM_freeN(str); |