Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_handlers.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 1,115 Lines • ▼ Show 20 Lines | static void ui_apply_but_NUM(bContext *C, uiBut *but, uiHandleButtonData *data) | ||||
| if (data->str) { | if (data->str) { | ||||
| if (ui_but_string_set(C, but, data->str)) { | if (ui_but_string_set(C, but, data->str)) { | ||||
| data->value = ui_but_value_get(but); | data->value = ui_but_value_get(but); | ||||
| } | } | ||||
| else { | else { | ||||
| data->cancel = true; | data->cancel = true; | ||||
| return; | return; | ||||
| } | } | ||||
| } | |||||
| else { | |||||
| ui_but_value_set(but, data->value); | |||||
| } | |||||
| /* If the value entered is the exact same, do not trigger an update. */ | /* If the value entered is the exact same, do not trigger an update. */ | ||||
| if (data->value == data->startvalue) { | if (data->value == data->startvalue) { | ||||
| data->cancel = true; | data->cancel = true; | ||||
| return; | return; | ||||
| } | } | ||||
| } | |||||
| else { | |||||
| ui_but_value_set(but, data->value); | |||||
| } | |||||
| ui_but_update_edited(but); | ui_but_update_edited(but); | ||||
| ui_apply_but_func(C, but); | ui_apply_but_func(C, but); | ||||
| data->retval = but->retval; | data->retval = but->retval; | ||||
| data->applied = true; | data->applied = true; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 10,012 Lines • Show Last 20 Lines | |||||