[Bf-blender-cvs] [b51ebc67853] lanpr-under-gp: Cleanup: spelling
Campbell Barton
noreply at git.blender.org
Sat Aug 29 06:26:30 CEST 2020
Commit: b51ebc678537d5470a140d8a47de8eb058e9488e
Author: Campbell Barton
Date: Fri Aug 28 14:25:19 2020 +1000
Branches: lanpr-under-gp
https://developer.blender.org/rBb51ebc678537d5470a140d8a47de8eb058e9488e
Cleanup: spelling
===================================================================
M source/blender/editors/interface/interface_panel.c
===================================================================
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index c49b61c53b7..6107912c26e 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -248,7 +248,7 @@ static Panel *UI_panel_add_instanced_ex(ARegion *region,
/**
* Called in situations where panels need to be added dynamically rather than having only one panel
- * corresponding to each PanelType.
+ * corresponding to each #PanelType.
*/
Panel *UI_panel_add_instanced(
ARegion *region, ListBase *panels, char *panel_idname, int list_index, PointerRNA *custom_data)
@@ -267,8 +267,8 @@ Panel *UI_panel_add_instanced(
}
/**
- * Find a unique key to append to the idname for the lookup to the panel's #uiBlock. Needed for
- * instanced panels, where there can be multiple with the same type and idname.
+ * Find a unique key to append to the #PanelTyype.idname for the lookup to the panel's #uiBlock.
+ * Needed for instanced panels, where there can be multiple with the same type and identifier.
*/
void UI_list_panel_unique_str(Panel *panel, char *r_name)
{
@@ -355,7 +355,7 @@ void UI_panels_free_instanced(const bContext *C, ARegion *region)
* don't match in any way.
*
* \param data: The list of data to check against the instanced panels.
- * \param panel_idname_func: Function to find the panel type idname for each item in the data list.
+ * \param panel_idname_func: Function to find the #PanelType.idname for each item in the data list.
* For a readability and generality, this lookup happens separately for each type of panel list.
*/
bool UI_panel_list_matches_data(ARegion *region,
@@ -534,11 +534,11 @@ static void get_panel_expand_flag(Panel *panel, short *flag, short *flag_index)
}
/**
- * Call the callback to store the panel and subpanel expansion settings in the list item that
+ * Call the callback to store the panel and sub-panel expansion settings in the list item that
* corresponds to this panel.
*
* \note This needs to iterate through all of the regions panels because the panel with changed
- * expansion could have been the subpanel of a instanced panel, meaning it might not know
+ * expansion could have been the sub-panel of a instanced panel, meaning it might not know
* which list item it corresponds to.
*/
static void set_panels_list_data_expand_flag(const bContext *C, const ARegion *region)
@@ -863,7 +863,9 @@ static void ui_draw_aligned_panel_header(const uiStyle *style,
});
}
-/* panel integrated in buttonswindow, tool/property lists etc */
+/**
+ * Panel integrated in buttons-window, tool/property lists etc
+ */
void ui_draw_aligned_panel(const uiStyle *style,
const uiBlock *block,
const rcti *rect,
@@ -900,7 +902,7 @@ void ui_draw_aligned_panel(const uiStyle *style,
return;
}
- /* Calculate header rect with + 0.001f to prevent flicker due to float inaccuracy */
+ /* Calculate header rectangle with + 0.001f to prevent flicker due to float inaccuracy. */
rcti headrect = {
rect->xmin, rect->xmax, rect->ymax, rect->ymax + floor(PNL_HEADER / block->aspect + 0.001f)};
@@ -913,7 +915,7 @@ void ui_draw_aligned_panel(const uiStyle *style,
headrect.ymax + U.pixelsize};
ui_draw_box_opaque(&box_rect, UI_CNR_ALL);
- /* Mimick the border between aligned box widgets for the bottom of the header. */
+ /* Mimic the border between aligned box widgets for the bottom of the header. */
if (!(panel->flag & PNL_CLOSED)) {
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
GPU_blend(GPU_BLEND_ALPHA);
@@ -985,7 +987,7 @@ void ui_draw_aligned_panel(const uiStyle *style,
ui_draw_aligned_panel_header(style, block, &titlerect, show_background);
if (show_drag) {
- /* itemrect smaller */
+ /* Make `itemrect` smaller. */
const float scale = 0.7;
rctf itemrect;
itemrect.xmax = headrect.xmax - (0.2f * UI_UNIT_X);
@@ -1117,7 +1119,7 @@ static void ui_panel_category_draw_tab(bool filled,
{
float vec[4][2] = {{0.195, 0.02}, {0.55, 0.169}, {0.831, 0.45}, {0.98, 0.805}};
- /* mult */
+ /* Multiply `vec` by radius. */
for (int a = 0; a < 4; a++) {
mul_v2_fl(vec[a], rad);
}
@@ -1251,7 +1253,7 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
#endif
float scaletabs = 1.0f;
/* same for all tabs */
- /* intentionally dont scale by 'px' */
+ /* intentionally don't scale by 'px' */
const int rct_xmin = is_left ? v2d->mask.xmin + 3 : (v2d->mask.xmax - category_tabs_width);
const int rct_xmax = is_left ? v2d->mask.xmin + category_tabs_width : (v2d->mask.xmax - 3);
const int text_v_ofs = (rct_xmax - rct_xmin) * 0.3f;
@@ -1306,7 +1308,7 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
BLI_assert(UI_panel_category_is_visible(region));
}
- /* calculate tab rect's and check if we need to scale down */
+ /* Calculate tab rectangle and check if we need to scale down. */
LISTBASE_FOREACH (PanelCategoryDyn *, pc_dyn, ®ion->panels_category) {
rcti *rct = &pc_dyn->rect;
@@ -1377,7 +1379,9 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
const char *category_id_draw = IFACE_(category_id);
const int category_width = BLI_rcti_size_y(rct) - (tab_v_pad_text * 2);
size_t category_draw_len = BLF_DRAW_STR_DUMMY_MAX;
- // int category_width = BLF_width(fontid, category_id_draw, BLF_DRAW_STR_DUMMY_MAX);
+#if 0
+ int category_width = BLF_width(fontid, category_id_draw, BLF_DRAW_STR_DUMMY_MAX);
+#endif
const bool is_active = STREQ(category_id, category_id_active);
@@ -1401,7 +1405,7 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
NULL,
is_active ? theme_col_tab_active : theme_col_tab_inactive);
- /* tab outline */
+ /* Tab outline */
ui_panel_category_draw_tab(false,
rct->xmin - px_x_sign,
rct->ymin - px,
@@ -1415,7 +1419,7 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
NULL,
theme_col_tab_outline);
- /* tab highlight (3d look) */
+ /* Tab highlight (3d look) */
ui_panel_category_draw_tab(false,
rct->xmin,
rct->ymin,
@@ -1431,7 +1435,7 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
theme_col_tab_highlight_inactive);
}
- /* tab blackline */
+ /* Tab black-line. */
if (!is_active) {
pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
@@ -1449,17 +1453,17 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
BLF_position(fontid, rct->xmax - text_v_ofs, rct->ymin + tab_v_pad_text, 0.0f);
- /* tab titles */
+ /* Tab titles. */
- /* draw white shadow to give text more depth */
+ /* Draw white shadow to give text more depth. */
BLF_color3ubv(fontid, theme_col_text);
- /* main tab title */
+ /* Main tab title. */
BLF_draw(fontid, category_id_draw, category_draw_len);
GPU_blend(GPU_BLEND_NONE);
- /* tab blackline remaining (last tab) */
+ /* Tab black-line remaining (last tab). */
pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -1473,7 +1477,7 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
}
#ifdef USE_FLAT_INACTIVE
- /* draw line between inactive tabs */
+ /* Draw line between inactive tabs. */
if (is_active == false && is_active_prev == false && pc_dyn->prev) {
immUniformColor3ubv(theme_col_tab_divider);
immRecti(pos,
@@ -1534,8 +1538,10 @@ int UI_panel_size_y(const Panel *panel)
return get_panel_real_size_y(panel);
}
-/* this function is needed because uiBlock and Panel itself don't
- * change sizey or location when closed */
+/**
+ * This function is needed because #uiBlock and Panel itself don't
+ * change #Panel.sizey or location when closed.
+ */
static int get_panel_real_ofsy(Panel *panel)
{
if (panel->flag & PNL_CLOSED) {
@@ -1556,7 +1562,7 @@ bool UI_panel_is_dragging(const struct Panel *panel)
/**
* \note about sorting;
- * the sortorder has a lower value for new panels being added.
+ * the #Panel.sortorder has a lower value for new panels being added.
* however, that only works to insert a single panel, when more new panels get
* added the coordinates of existing panels and the previously stored to-be-inserted
* panels do not match for sorting
@@ -1569,7 +1575,7 @@ static int find_highest_panel(const void *a1, const void *a2)
/* stick uppermost header-less panels to the top of the region -
* prevent them from being sorted (multiple header-less panels have to be sorted though) */
if (ps1->panel->type->flag & PNL_NO_HEADER && ps2->panel->type->flag & PNL_NO_HEADER) {
- /* skip and check for ofs and sortorder below */
+ /* Skip and check for `ofsy` and #Panel.sortorder below. */
}
if (ps1->panel->type->flag & PNL_NO_HEADER) {
return -1;
@@ -1657,7 +1663,7 @@ static bool uiAlignPanelStep(ARegion *region, const float fac, const bool drag)
}
if (drag) {
- /* while we are dragging, we sort on location and update sortorder */
+ /* While we are dragging, we sort on location and update #Panel.sortorder. */
qsort(panelsort, tot, sizeof(PanelSort), find_highest_panel);
for (ps = panelsort, i = 0; i < tot; i++, ps++) {
@@ -1665,11 +1671,11 @@ static bool uiAlignPanelStep(ARegion *region, const float fac, const bool drag)
}
}
else {
- /* otherwise use sortorder */
+ /* Otherwise use #Panel.sortorder. */
qs
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list