Page MenuHome

UI: fix buttons ranges not properly updated when tabbing to next/previous button
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Jul 10 2020, 2:29 PM.

Details

Summary

This was reported for the FCurve modifier restrict ranges, but might fail
elsewhere, too. Reason is that the post_but has its range (hardmin/
hardmax etc) set before the updates to the active button take place, so
changes here dont end up on the post_but (even though the RNA range
function is properly called for a new defined button - new one is not the
same as the post_but though).

Took quite a while to figure that out, and it might not even be the best
solution, but now update the ranges on the post_but when that gets
active.

Fixes T78763

Diff Detail

Repository
rB Blender
Branch
T78763 (branched from master)
Build Status
Buildable 8953
Build 8953: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Jul 10 2020, 2:29 PM
Hans Goudey (HooglyBoogly) requested changes to this revision.Jul 13 2020, 3:51 PM

Looks like a good solution to me.

source/blender/editors/include/UI_interface.h
1342–1343

I think these should be in interface_intern.h with lowercase ui_ rather than public.

source/blender/editors/interface/interface.c
3088–3089

I see this clamping comes from the soft range setting below, but I'm not sure it makes sense for the hard range.

This revision now requires changes to proceed.Jul 13 2020, 3:51 PM

move functions to interface_intern.h, slight renaming

source/blender/editors/interface/interface.c
3088–3089

Also not sure when -inf/inf from RNA properties can happen (but in that case seems to make sense, no?)

Hans Goudey (HooglyBoogly) added inline comments.
source/blender/editors/interface/interface.c
3088–3089

Hmm, to me it looked like this would reset the hard max to 10 000 if it was set to INT_MAX. But I tested with the taa_samples property then tabbing to taa_render_samples, and that didn't happen, so I guess I'm missing something.

This revision is now accepted and ready to land.Jul 30 2020, 5:47 PM