diff options
author | Miika Hamalainen <blender@miikah.org> | 2012-07-04 21:15:05 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2012-07-04 21:15:05 +0400 |
commit | 9324503b84a06f76af072131da947547c84698ed (patch) | |
tree | b9336118dcf8df9e9ca4888d9ee3ac9fec2c2798 /source/blender/editors/interface | |
parent | 234c338655fc49efef0b7ffe0ef6736e8630411a (diff) | |
parent | 958cf139f6587df631944f6ec0fcb4111c7e58fa (diff) |
Merge with trunk r48602
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 9 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 50 |
6 files changed, 62 insertions, 13 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index d26c8cefdf0..49d56d427ba 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -498,7 +498,7 @@ static int ui_but_float_precision(uiBut *but, double value) return prec; } -static void ui_draw_linkline(uiLinkLine *line, int hilightActiveLines) +static void ui_draw_linkline(uiLinkLine *line, int highlightActiveLines) { rcti rect; @@ -511,7 +511,7 @@ static void ui_draw_linkline(uiLinkLine *line, int hilightActiveLines) if (line->flag & UI_SELECT) glColor3ub(100, 100, 100); - else if (hilightActiveLines && ((line->from->flag & UI_ACTIVE) || (line->to->flag & UI_ACTIVE))) + else if (highlightActiveLines && ((line->from->flag & UI_ACTIVE) || (line->to->flag & UI_ACTIVE))) UI_ThemeColor(TH_TEXT_HI); else glColor3ub(0, 0, 0); @@ -919,7 +919,7 @@ void uiEndBlock(const bContext *C, uiBlock *block) if (ui_but_update_from_old_block(C, block, &but)) ui_check_but(but); - /* temp? Proper check for greying out */ + /* temp? Proper check for graying out */ if (but->optype) { wmOperatorType *ot = but->optype; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index b82e7c3a1e2..30c5f2fbe40 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3362,7 +3362,7 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND ui_get_but_vectorf(but, rgb); rgb_to_hsv_compat_v(rgb, hsv); - /* Convert current colour on hue/sat disc to circular coordinates phi, r */ + /* Convert current color on hue/sat disc to circular coordinates phi, r */ phi = fmodf(hsv[0] + 0.25f, 1.0f) * -2.0f * (float)M_PI; r = hsv[1]; /* sqr= r>0.f?sqrtf(r):1; */ /* UNUSED */ @@ -5009,7 +5009,7 @@ static uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y) ui_window_to_block(ar, block, &mx, &my); for (but = block->buttons.first; but; but = but->next) { - /* note, LABEL is included for hilights, this allows drags */ + /* note, LABEL is included for highlights, this allows drags */ if (but->type == LABEL && but->dragpoin == NULL) continue; if (ELEM3(but->type, ROUNDBOX, SEPR, LISTBOX)) diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index d87ca0f7bb6..e6a4c260d0f 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -782,7 +782,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex)) { /* -- convert to rna ? */ but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X - 2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, - TIP_("Apply modifier to editing cage during Editmode")); + TIP_("Apply modifier to editing cage during Edit mode")); if (index < cageIndex) uiButSetFlag(but, UI_BUT_DISABLED); uiButSetFunc(but, modifiers_setOnCage, ob, md); @@ -1051,7 +1051,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) * as that poses problems when restoring them, so disable the "up" button where * it may cause this situation. * - * Up/Down buttons should only be shown (or not greyed - todo) if they serve some purpose. + * Up/Down buttons should only be shown (or not grayed - todo) if they serve some purpose. */ if (proxylocked_constraints_owner(ob, pchan)) { if (con->prev) { @@ -2679,7 +2679,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) but->col[3] = 255; but = uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X + 10, 0, UI_UNIT_X + width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); - but->col[0] = but->col[1] = but->col[2] = FTOCHAR(rti->greyscale); + but->col[0] = but->col[1] = but->col[2] = FTOCHAR(rti->grayscale); but->col[3] = 255; uiBlockEndAlign(block); @@ -2699,7 +2699,8 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) uiBlockSetEmboss(block, UI_EMBOSSN); if (reports->list.first != reports->list.last) - uiDefIconButO(block, BUT, "UI_OT_reports_to_textblock", WM_OP_INVOKE_REGION_WIN, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, TIP_("Click to see rest of reports in textblock: 'Recent Reports'")); + uiDefIconButO(block, BUT, "UI_OT_reports_to_textblock", WM_OP_INVOKE_REGION_WIN, icon, 2, 0, + UI_UNIT_X, UI_UNIT_Y, TIP_("Click to see the remaining reports in text block: 'Recent Reports'")); else uiDefIconBut(block, LABEL, 0, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 07b1217b1bd..5ee89bb418f 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1434,7 +1434,7 @@ static struct uiWidgetColors wcol_menu_back = { 25, -20 }; -/* tooltip colour */ +/* tooltip color */ static struct uiWidgetColors wcol_tooltip = { {0, 0, 0, 255}, {25, 25, 25, 230}, diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index fe46a5dc9c5..407b2308af8 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1888,8 +1888,8 @@ void init_userdef_do_versions(void) rgba_char_args_set(btheme->tact.anim_active, 204, 112, 26, 102); /* NLA Colors */ - rgba_char_args_set(btheme->tnla.anim_active, 204, 112, 26, 102); /* same as dopesheet above */ - rgba_char_args_set(btheme->tnla.anim_non_active,153, 135, 97, 77); + rgba_char_args_set(btheme->tnla.anim_active, 204, 112, 26, 102); /* same as dopesheet above */ + rgba_char_args_set(btheme->tnla.anim_non_active, 153, 135, 97, 77); rgba_char_args_set(btheme->tnla.nla_tweaking, 77, 243, 26, 77); rgba_char_args_set(btheme->tnla.nla_tweakdupli, 217, 0, 0, 255); diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 51e1b30f0bf..392aae1632d 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -431,7 +431,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* curRatio = height / width; */ /* UNUSED */ winRatio = winy / winx; - /* both sizes change (area/region maximised) */ + /* 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 */ @@ -1328,6 +1328,54 @@ void UI_view2d_constant_grid_draw(View2D *v2d) glEnd(); } +/* Draw a multi-level grid in given 2d-region */ +void UI_view2d_multi_grid_draw(View2D *v2d, float step, int level_size, int totlevels) +{ + int offset = -10; + float lstep = step; + int level; + + for (level = 0; level < totlevels; ++level) { + int i; + float start; + + UI_ThemeColorShade(TH_BACK, offset); + + i = (v2d->cur.xmin >= 0.0f ? -(int)(-v2d->cur.xmin / lstep) : (int)(v2d->cur.xmin / lstep)); + start = i * lstep; + + glBegin(GL_LINES); + for (; start < v2d->cur.xmax; start += lstep, ++i) { + if (i == 0 || (level < totlevels - 1 && i % level_size == 0)) + continue; + glVertex2f(start, v2d->cur.ymin); + glVertex2f(start, v2d->cur.ymax); + } + + i = (v2d->cur.ymin >= 0.0f ? -(int)(-v2d->cur.ymin / lstep) : (int)(v2d->cur.ymin / lstep)); + start = i * lstep; + + for (; start < v2d->cur.ymax; start += lstep, ++i) { + if (i == 0 || (level < totlevels - 1 && i % level_size == 0)) + continue; + glVertex2f(v2d->cur.xmin, start); + glVertex2f(v2d->cur.xmax, start); + } + + /* X and Y axis */ + UI_ThemeColorShade(TH_BACK, offset - 8); + glVertex2f(0.0f, v2d->cur.ymin); + glVertex2f(0.0f, v2d->cur.ymax); + glVertex2f(v2d->cur.xmin, 0.0f); + glVertex2f(v2d->cur.xmax, 0.0f); + + glEnd(); + + lstep *= level_size; + offset -= 6; + } +} + /* the price we pay for not exposting structs :( */ void UI_view2d_grid_size(View2DGrid *grid, float *r_dx, float *r_dy) { |