diff options
Diffstat (limited to 'source/blender/editors/interface')
12 files changed, 42 insertions, 43 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index f5528638bec..90639878958 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1198,7 +1198,7 @@ static bool ui_but_event_operator_string_from_menu(const bContext *C, /* annoying, create a property */ const IDPropertyTemplate val = {0}; - IDProperty *prop_menu = IDP_New(IDP_GROUP, &val, __func__); /* dummy, name is unimportant */ + IDProperty *prop_menu = IDP_New(IDP_GROUP, &val, __func__); /* Dummy, name is unimportant. */ IDP_AddToGroup(prop_menu, IDP_NewString(mt->idname, "name", sizeof(mt->idname))); if (WM_key_event_operator_string( @@ -1223,7 +1223,7 @@ static bool ui_but_event_operator_string_from_panel(const bContext *C, /* annoying, create a property */ const IDPropertyTemplate val = {0}; - IDProperty *prop_panel = IDP_New(IDP_GROUP, &val, __func__); /* dummy, name is unimportant */ + IDProperty *prop_panel = IDP_New(IDP_GROUP, &val, __func__); /* Dummy, name is unimportant. */ IDP_AddToGroup(prop_panel, IDP_NewString(pt->idname, "name", sizeof(pt->idname))); IDP_AddToGroup(prop_panel, IDP_New(IDP_INT, @@ -1804,7 +1804,7 @@ void UI_block_update_from_old(const bContext *C, uiBlock *block) static void ui_but_validate(const uiBut *but) { /* Number buttons must have a click-step, - * assert instead of correcting the value to ensure the caller knows what they're doing. */ + * assert instead of correcting the value to ensure the caller knows what they're doing. */ if (but->type == UI_BTYPE_NUM) { uiButNumber *number_but = (uiButNumber *)but; @@ -3578,7 +3578,7 @@ static void ui_but_build_drawstr_float(uiBut *but, double value) subtype = RNA_property_subtype(but->rnaprop); } - /* Change negative zero to regular zero, without altering anything else. */ + /* Change negative zero to regular zero, without altering anything else. */ value += +0.0f; if (value == (double)FLT_MAX) { @@ -4146,7 +4146,7 @@ static uiBut *ui_def_but(uiBlock *block, } #ifdef WITH_PYTHON - /* if the 'UI_OT_editsource' is running, extract the source info from the button */ + /* If the 'UI_OT_editsource' is running, extract the source info from the button. */ if (UI_editsource_enable_check()) { UI_editsource_active_but_test(but); } @@ -4184,7 +4184,7 @@ static void ui_def_but_rna__menu(bContext *UNUSED(C), uiLayout *layout, void *bu uiPopupBlockHandle *handle = block->handle; uiBut *but = (uiBut *)but_p; - /* see comment in ui_item_enum_expand, re: uiname */ + /* see comment in ui_item_enum_expand, re: `uiname`. */ const EnumPropertyItem *item_array; UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 40cfcaea883..05b6fcdded1 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -69,8 +69,7 @@ static int roundboxtype = UI_CNR_ALL; void UI_draw_roundbox_corner_set(int type) { /* Not sure the roundbox function is the best place to change this - * if this is undone, it's not that big a deal, only makes curves edges - * square for the */ + * if this is undone, it's not that big a deal, only makes curves edges square. */ roundboxtype = type; } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 1c55ce0f348..34465502c71 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3068,7 +3068,7 @@ static bool ui_textedit_insert_buf(uiBut *but, if ((len + step >= data->maxlen) && (data->maxlen - (len + 1) > 0)) { if (UI_but_is_utf8(but)) { - /* shorten 'step' to a utf8 aligned size that fits */ + /* Shorten 'step' to a utf8 aligned size that fits. */ BLI_strnlen_utf8_ex(buf, data->maxlen - (len + 1), &step); } else { diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 23856c41ceb..19ab36cef42 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -137,19 +137,19 @@ extern const short ui_radial_dir_to_angle[8]; /** #PieMenuData.flags */ enum { - /** pie menu item collision is detected at 90 degrees */ + /** Pie menu item collision is detected at 90 degrees. */ UI_PIE_DEGREES_RANGE_LARGE = (1 << 0), - /** use initial center of pie menu to calculate direction */ + /** Use initial center of pie menu to calculate direction. */ UI_PIE_INITIAL_DIRECTION = (1 << 1), - /** pie menu is drag style */ + /** Pie menu is drag style. */ UI_PIE_DRAG_STYLE = (1 << 2), - /** mouse not far enough from center position */ + /** Mouse not far enough from center position. */ UI_PIE_INVALID_DIR = (1 << 3), - /** pie menu changed to click style, click to confirm */ + /** Pie menu changed to click style, click to confirm. */ UI_PIE_CLICK_STYLE = (1 << 4), - /** pie animation finished, do not calculate any more motion */ + /** Pie animation finished, do not calculate any more motion. */ UI_PIE_ANIMATION_FINISHED = (1 << 5), - /** pie gesture selection has been done, now wait for mouse motion to end */ + /** Pie gesture selection has been done, now wait for mouse motion to end. */ UI_PIE_GESTURE_END_WAIT = (1 << 6), }; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index c04432a2912..1ab6d050b4d 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2346,7 +2346,7 @@ void uiItemFullR(uiLayout *layout, * In this case we want the ability not to have an icon. * * We could pass an argument not to set the icon to begin with however this is the one case - * the functionality is needed. */ + * the functionality is needed. */ if (but && no_icon) { if ((icon == ICON_NONE) && (but->icon != ICON_NONE)) { ui_def_but_icon_clear(but); @@ -2860,7 +2860,7 @@ static uiBut *ui_item_menu(uiLayout *layout, int w = ui_text_icon_width(layout, name, icon, 1); const int h = UI_UNIT_Y; - if (layout->root->type == UI_LAYOUT_HEADER) { /* ugly .. */ + if (layout->root->type == UI_LAYOUT_HEADER) { /* Ugly! */ if (icon == ICON_NONE && force_menu) { /* pass */ } @@ -2893,7 +2893,7 @@ static uiBut *ui_item_menu(uiLayout *layout, } if (argN) { - /* ugly .. */ + /* ugly! */ if (arg != argN) { but->poin = (char *)but; } diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c index accfb78ab94..bf3425dd3eb 100644 --- a/source/blender/editors/interface/interface_region_tooltip.c +++ b/source/blender/editors/interface/interface_region_tooltip.c @@ -188,11 +188,11 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *region /* tone_fg = rgb_to_grayscale(main_color); */ /* mix the colors */ - rgb_tint(value_color, 0.0f, 0.0f, tone_bg, 0.2f); /* light gray */ - rgb_tint(active_color, 0.6f, 0.2f, tone_bg, 0.2f); /* light blue */ - rgb_tint(normal_color, 0.0f, 0.0f, tone_bg, 0.4f); /* gray */ - rgb_tint(python_color, 0.0f, 0.0f, tone_bg, 0.5f); /* dark gray */ - rgb_tint(alert_color, 0.0f, 0.8f, tone_bg, 0.1f); /* red */ + rgb_tint(value_color, 0.0f, 0.0f, tone_bg, 0.2f); /* Light gray. */ + rgb_tint(active_color, 0.6f, 0.2f, tone_bg, 0.2f); /* Light blue. */ + rgb_tint(normal_color, 0.0f, 0.0f, tone_bg, 0.4f); /* Gray. */ + rgb_tint(python_color, 0.0f, 0.0f, tone_bg, 0.5f); /* Dark gray. */ + rgb_tint(alert_color, 0.0f, 0.8f, tone_bg, 0.1f); /* Red. */ /* draw text */ BLF_wordwrap(data->fstyle.uifont_id, data->wrap_width); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 3990ad68c4d..fc3af525d45 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -344,7 +344,7 @@ typedef struct TemplateID { float scale; } TemplateID; -/* Search browse menu, assign */ +/* Search browse menu, assign. */ static void template_ID_set_property_exec_fn(bContext *C, void *arg_template, void *item) { TemplateID *template_ui = (TemplateID *)arg_template; @@ -5883,7 +5883,7 @@ static void uilist_prepare(uiList *ui_list, } /* If list length changes or list is tagged to check this, - * and active is out of view, scroll to it .*/ + * and active is out of view, scroll to it. */ if (ui_list->list_last_len != len || ui_list->flag & UILST_SCROLL_TO_ACTIVE_ITEM) { if (activei_row < ui_list->list_scroll) { ui_list->list_scroll = activei_row; diff --git a/source/blender/editors/interface/interface_undo.c b/source/blender/editors/interface/interface_undo.c index 304d2254a81..40f196d9b45 100644 --- a/source/blender/editors/interface/interface_undo.c +++ b/source/blender/editors/interface/interface_undo.c @@ -107,7 +107,7 @@ void ui_textedit_undo_push(uiUndoStack_Text *stack, const char *text, int cursor } } - /* Create the new state */ + /* Create the new state. */ const int text_size = strlen(text) + 1; stack->current = MEM_mallocN(sizeof(uiUndoStack_Text_State) + text_size, __func__); stack->current->cursor_index = cursor_index; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index ce1109ad9df..9212a0a7d9d 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1531,14 +1531,14 @@ static void ui_text_clip_right_ex(const uiFontStyle *fstyle, int l_end = BLF_width_to_strlen(fstyle->uifont_id, str, max_len, okwidth - sep_strwidth, NULL); if (l_end > 0) { - /* At least one character, so clip and add the ellipsis. */ + /* At least one character, so clip and add the ellipsis. */ memcpy(str + l_end, sep, sep_len + 1); /* +1 for trailing '\0'. */ if (r_final_len) { *r_final_len = (size_t)(l_end) + sep_len; } } else { - /* Otherwise fit as much as we can without adding an ellipsis. */ + /* Otherwise fit as much as we can without adding an ellipsis. */ l_end = BLF_width_to_strlen(fstyle->uifont_id, str, max_len, okwidth, NULL); str[l_end] = '\0'; if (r_final_len) { diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 224993555bf..5eb20ae601b 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -535,7 +535,7 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize) curRatio = height / width; winRatio = winy / winx; - /* both sizes change (area/region maximized) */ + /* Both sizes change (area/region maximized). */ if (do_x == do_y) { if (do_x && do_y) { /* here is 1,1 case, so all others must be 0,0 */ @@ -1738,15 +1738,15 @@ bool UI_view2d_view_to_region_clip( void UI_view2d_view_to_region( const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) { - /* step 1: express given coordinates as proportional values */ + /* Step 1: express given coordinates as proportional values. */ x = (x - v2d->cur.xmin) / BLI_rctf_size_x(&v2d->cur); y = (y - v2d->cur.ymin) / BLI_rctf_size_y(&v2d->cur); - /* step 2: convert proportional distances to screen coordinates */ + /* Step 2: convert proportional distances to screen coordinates. */ x = v2d->mask.xmin + (x * BLI_rcti_size_x(&v2d->mask)); y = v2d->mask.ymin + (y * BLI_rcti_size_y(&v2d->mask)); - /* although we don't clamp to lie within region bounds, we must avoid exceeding size of ints */ + /* Although we don't clamp to lie within region bounds, we must avoid exceeding size of ints. */ *r_region_x = clamp_float_to_int(x); *r_region_y = clamp_float_to_int(y); } @@ -1769,13 +1769,13 @@ void UI_view2d_view_to_region_rcti(const View2D *v2d, const rctf *rect_src, rcti const float mask_size[2] = {BLI_rcti_size_x(&v2d->mask), BLI_rcti_size_y(&v2d->mask)}; rctf rect_tmp; - /* step 1: express given coordinates as proportional values */ + /* Step 1: express given coordinates as proportional values. */ rect_tmp.xmin = (rect_src->xmin - v2d->cur.xmin) / cur_size[0]; rect_tmp.xmax = (rect_src->xmax - v2d->cur.xmin) / cur_size[0]; rect_tmp.ymin = (rect_src->ymin - v2d->cur.ymin) / cur_size[1]; rect_tmp.ymax = (rect_src->ymax - v2d->cur.ymin) / cur_size[1]; - /* step 2: convert proportional distances to screen coordinates */ + /* Step 2: convert proportional distances to screen coordinates. */ rect_tmp.xmin = v2d->mask.xmin + (rect_tmp.xmin * mask_size[0]); rect_tmp.xmax = v2d->mask.xmin + (rect_tmp.xmax * mask_size[0]); rect_tmp.ymin = v2d->mask.ymin + (rect_tmp.ymin * mask_size[1]); @@ -1800,7 +1800,7 @@ bool UI_view2d_view_to_region_rcti_clip(const View2D *v2d, const rctf *rect_src, BLI_assert(rect_src->xmin <= rect_src->xmax && rect_src->ymin <= rect_src->ymax); - /* step 1: express given coordinates as proportional values */ + /* Step 1: express given coordinates as proportional values. */ rect_tmp.xmin = (rect_src->xmin - v2d->cur.xmin) / cur_size[0]; rect_tmp.xmax = (rect_src->xmax - v2d->cur.xmin) / cur_size[0]; rect_tmp.ymin = (rect_src->ymin - v2d->cur.ymin) / cur_size[1]; @@ -1808,7 +1808,7 @@ bool UI_view2d_view_to_region_rcti_clip(const View2D *v2d, const rctf *rect_src, if (((rect_tmp.xmax < 0.0f) || (rect_tmp.xmin > 1.0f) || (rect_tmp.ymax < 0.0f) || (rect_tmp.ymin > 1.0f)) == 0) { - /* step 2: convert proportional distances to screen coordinates */ + /* Step 2: convert proportional distances to screen coordinates. */ rect_tmp.xmin = v2d->mask.xmin + (rect_tmp.xmin * mask_size[0]); rect_tmp.xmax = v2d->mask.ymin + (rect_tmp.xmax * mask_size[0]); rect_tmp.ymin = v2d->mask.ymin + (rect_tmp.ymin * mask_size[1]); diff --git a/source/blender/editors/interface/view2d_gizmo_navigate.c b/source/blender/editors/interface/view2d_gizmo_navigate.c index 8d3f1beb947..30b4a7c097a 100644 --- a/source/blender/editors/interface/view2d_gizmo_navigate.c +++ b/source/blender/editors/interface/view2d_gizmo_navigate.c @@ -113,7 +113,7 @@ static struct NavigateGizmoInfo *navigate_params_from_space_type(short space_typ case SPACE_CLIP: return g_navigate_params_for_space_clip; default: - /* Used for sequencer. */ + /* Used for sequencer. */ return g_navigate_params_for_view2d; } } diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 7ad28cd6069..69acfc657dc 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -187,7 +187,7 @@ static void view_pan_apply(bContext *C, wmOperator *op) view_pan_apply_ex(C, vpd, RNA_int_get(op->ptr, "deltax"), RNA_int_get(op->ptr, "deltay")); } -/* cleanup temp customdata */ +/* Cleanup temp custom-data. */ static void view_pan_exit(wmOperator *op) { MEM_SAFE_FREE(op->customdata); @@ -805,7 +805,7 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op) /** \name View Zoom Operator (single step) * \{ */ -/* cleanup temp customdata */ +/* Cleanup temp custom-data. */ static void view_zoomstep_exit(wmOperator *op) { UI_view2d_zoom_cache_reset(); @@ -1034,7 +1034,7 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op) UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); } -/* cleanup temp customdata */ +/* Cleanup temp custom-data. */ static void view_zoomdrag_exit(bContext *C, wmOperator *op) { UI_view2d_zoom_cache_reset(); @@ -1914,7 +1914,7 @@ static void scroller_activate_init(bContext *C, ED_region_tag_redraw_no_rebuild(region); } -/* cleanup temp customdata */ +/* Cleanup temp custom-data. */ static void scroller_activate_exit(bContext *C, wmOperator *op) { if (op->customdata) { @@ -2056,7 +2056,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, const wmEvent *e return OPERATOR_FINISHED; } - /* otherwise, end the drag action */ + /* Otherwise, end the drag action. */ if (vsm->lastx || vsm->lasty) { scroller_activate_exit(C, op); return OPERATOR_FINISHED; |