[Bf-committers] [Bf-blender-cvs] [a66236c] master: Fix T38661: make number button increment/decrement areas smaller.

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Feb 19 16:24:51 CET 2014


There's is a proposal about that here: https://developer.blender.org/T38070

I think that would be good to add, but even with that it would still
be strange that you would have to click next to the number text to
edit it, so we can do that later.

On Wed, Feb 19, 2014 at 8:50 AM, Keith Boshoff <wahooney at gmail.com> wrote:
> Something that I always thought would help is some sort of visual cue of
> where the areas are, restricting the click areas to the arrows is an
> obvious way (which, as you say, results in a smaller hit area) Another is
> to add feint lines to show those thirds you were talking about, which, in
> my experience, isn't always clear even though I know it's split in thirds.
>
>
> On 18 February 2014 10:57, Brecht Van Lommel <noreply at git.blender.org>wrote:
>
>> Commit: a66236c8f93a56c77351a21fc2e1a4b57bc67486
>> Author: Brecht Van Lommel
>> Date:   Tue Feb 18 19:54:42 2014 +0100
>> https://developer.blender.org/rBa66236c8f93a56c77351a21fc2e1a4b57bc67486
>>
>> Fix T38661: make number button increment/decrement areas smaller.
>>
>> Previously 1/3 of the button was used to decrement, 1/3 to edit and 1/3 to
>> increment. However with the number text now right aligned this meant that
>> the increment area would overlap the number text, which is confusing. So it
>> was made to smaller to only cover the arrows.
>>
>> It's not as easy to click but I don't know of a better solution with right
>> aligned number text.
>>
>> ===================================================================
>>
>> M       source/blender/editors/interface/interface_handlers.c
>>
>> ===================================================================
>>
>> diff --git a/source/blender/editors/interface/interface_handlers.c
>> b/source/blender/editors/interface/interface_handlers.c
>> index 9df6b7b..7aa2e98 100644
>> --- a/source/blender/editors/interface/interface_handlers.c
>> +++ b/source/blender/editors/interface/interface_handlers.c
>> @@ -3517,13 +3517,16 @@ static int ui_do_but_NUM(bContext *C, uiBlock
>> *block, uiBut *but, uiHandleButton
>>                 /* we can click on the side arrows to increment/decrement,
>>                  * or click inside to edit the value directly */
>>                 float tempf, softmin, softmax;
>> +               float handlewidth;
>>                 int temp;
>>
>>                 softmin = but->softmin;
>>                 softmax = but->softmax;
>>
>> +               handlewidth = min_ff(BLI_rctf_size_x(&but->rect)/3,
>> BLI_rctf_size_y(&but->rect));
>> +
>>                 if (!ui_is_but_float(but)) {
>> -                       if (mx < (but->rect.xmin +
>> BLI_rctf_size_x(&but->rect) / 3 - 3)) {
>> +                       if (mx < (but->rect.xmin + handlewidth)) {
>>                                 button_activate_state(C, but,
>> BUTTON_STATE_NUM_EDITING);
>>
>>                                 temp = (int)data->value - 1;
>> @@ -3534,7 +3537,7 @@ static int ui_do_but_NUM(bContext *C, uiBlock
>> *block, uiBut *but, uiHandleButton
>>
>>                                 button_activate_state(C, but,
>> BUTTON_STATE_EXIT);
>>                         }
>> -                       else if (mx > (but->rect.xmin + (2 *
>> BLI_rctf_size_x(&but->rect) / 3) + 3)) {
>> +                       else if (mx > (but->rect.xmax - handlewidth)) {
>>                                 button_activate_state(C, but,
>> BUTTON_STATE_NUM_EDITING);
>>
>>                                 temp = (int)data->value + 1;
>> @@ -3550,7 +3553,7 @@ static int ui_do_but_NUM(bContext *C, uiBlock
>> *block, uiBut *but, uiHandleButton
>>                         }
>>                 }
>>                 else {
>> -                       if (mx < (but->rect.xmin +
>> BLI_rctf_size_x(&but->rect) / 3 - 3)) {
>> +                       if (mx < (but->rect.xmin + handlewidth)) {
>>                                 button_activate_state(C, but,
>> BUTTON_STATE_NUM_EDITING);
>>
>>                                 tempf = (float)data->value - 0.01f *
>> but->a1;
>> @@ -3559,7 +3562,7 @@ static int ui_do_but_NUM(bContext *C, uiBlock
>> *block, uiBut *but, uiHandleButton
>>
>>                                 button_activate_state(C, but,
>> BUTTON_STATE_EXIT);
>>                         }
>> -                       else if (mx > but->rect.xmin + (2 *
>> (BLI_rctf_size_x(&but->rect) / 3) + 3)) {
>> +                       else if (mx > but->rect.xmax - handlewidth) {
>>                                 button_activate_state(C, but,
>> BUTTON_STATE_NUM_EDITING);
>>
>>                                 tempf = (float)data->value + 0.01f *
>> but->a1;
>>
>> _______________________________________________
>> Bf-blender-cvs mailing list
>> Bf-blender-cvs at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers


More information about the Bf-committers mailing list