Merged changes in the trunk up to revision 54594.
This commit is contained in:
@@ -1800,9 +1800,9 @@ int ui_set_but_string_eval_num(bContext *C, uiBut *but, const char *str, double
|
||||
#ifdef WITH_PYTHON
|
||||
|
||||
if (str[0] != '\0') {
|
||||
int is_unit_but = ui_is_but_unit(but);
|
||||
bool is_unit_but = (ui_is_but_float(but) && ui_is_but_unit(but));
|
||||
/* only enable verbose if we won't run again with units */
|
||||
if (BPY_button_exec(C, str, value, is_unit_but == FALSE) != -1) {
|
||||
if (BPY_button_exec(C, str, value, is_unit_but == false) != -1) {
|
||||
/* if the value parsed ok without unit conversion this button may still need a unit multiplier */
|
||||
if (is_unit_but) {
|
||||
char str_new[128];
|
||||
@@ -2781,21 +2781,21 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
|
||||
return but;
|
||||
}
|
||||
|
||||
/* ui_def_but_rna_propname and ui_def_but_rna
|
||||
static void ui_def_but_rna__disable(uiBut *but)
|
||||
{
|
||||
but->flag |= UI_BUT_DISABLED;
|
||||
but->lock = true;
|
||||
but->lockstr = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* ui_def_but_rna_propname and ui_def_but_rna
|
||||
* both take the same args except for propname vs prop, this is done so we can
|
||||
* avoid an extra lookup on 'prop' when its already available.
|
||||
*
|
||||
* When this kind of change won't disrupt branches, best look into making more
|
||||
* of our UI functions take prop rather then propname.
|
||||
*/
|
||||
|
||||
#define UI_DEF_BUT_RNA_DISABLE(but) { \
|
||||
but->flag |= UI_BUT_DISABLED; \
|
||||
but->lock = TRUE; \
|
||||
but->lockstr = ""; \
|
||||
} (void)0
|
||||
|
||||
|
||||
static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str,
|
||||
int x, int y, short width, short height,
|
||||
PointerRNA *ptr, PropertyRNA *prop, int index,
|
||||
@@ -2932,7 +2932,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
|
||||
}
|
||||
|
||||
if (!RNA_property_editable(&but->rnapoin, prop)) {
|
||||
UI_DEF_BUT_RNA_DISABLE(but);
|
||||
ui_def_but_rna__disable(but);
|
||||
}
|
||||
|
||||
if (but->flag & UI_BUT_UNDO && (ui_but_is_rna_undo(but) == FALSE)) {
|
||||
@@ -2962,7 +2962,7 @@ static uiBut *ui_def_but_rna_propname(uiBlock *block, int type, int retval, cons
|
||||
else {
|
||||
but = ui_def_but(block, type, retval, propname, x, y, width, height, NULL, min, max, a1, a2, tip);
|
||||
|
||||
UI_DEF_BUT_RNA_DISABLE(but);
|
||||
ui_def_but_rna__disable(but);
|
||||
}
|
||||
|
||||
return but;
|
||||
|
||||
@@ -1610,7 +1610,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, strCursorJump
|
||||
}
|
||||
else {
|
||||
int pos_i = but->pos;
|
||||
BLI_str_cursor_step_utf8(str, len, &pos_i, direction, jump);
|
||||
BLI_str_cursor_step_utf8(str, len, &pos_i, direction, jump, true);
|
||||
but->pos = pos_i;
|
||||
|
||||
if (select) {
|
||||
@@ -1679,7 +1679,7 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
|
||||
else if (but->pos >= 0 && but->pos < len) {
|
||||
int pos = but->pos;
|
||||
int step;
|
||||
BLI_str_cursor_step_utf8(str, len, &pos, direction, jump);
|
||||
BLI_str_cursor_step_utf8(str, len, &pos, direction, jump, true);
|
||||
step = pos - but->pos;
|
||||
memmove(&str[but->pos], &str[but->pos + step], (len + 1) - but->pos);
|
||||
changed = 1;
|
||||
@@ -1694,7 +1694,7 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
|
||||
int pos = but->pos;
|
||||
int step;
|
||||
|
||||
BLI_str_cursor_step_utf8(str, len, &pos, direction, jump);
|
||||
BLI_str_cursor_step_utf8(str, len, &pos, direction, jump, true);
|
||||
step = but->pos - pos;
|
||||
memmove(&str[but->pos - step], &str[but->pos], (len + 1) - but->pos);
|
||||
but->pos -= step;
|
||||
|
||||
@@ -447,8 +447,8 @@ static void ui_draw_panel_dragwidget(const rctf *rect)
|
||||
ymin = rect->ymin;
|
||||
ymax = rect->ymax;
|
||||
|
||||
dx = 0.333f * (xmax - xmin);
|
||||
dy = 0.333f * (ymax - ymin);
|
||||
dx = (xmax - xmin) / 3.0f;
|
||||
dy = (ymax - ymin) / 3.0f;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glColor4ub(255, 255, 255, 50);
|
||||
|
||||
@@ -518,7 +518,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
|
||||
BLF_I18NCONTEXT_ID_CAMERA,
|
||||
BLF_I18NCONTEXT_ID_WORLD,
|
||||
BLF_I18NCONTEXT_ID_SCREEN,
|
||||
BLF_I18NCONTEXT_ID_TEXT);
|
||||
BLF_I18NCONTEXT_ID_TEXT,
|
||||
);
|
||||
BLF_I18N_MSGID_MULTI_CTXT("New", BLF_I18NCONTEXT_ID_SPEAKER,
|
||||
BLF_I18NCONTEXT_ID_SOUND,
|
||||
BLF_I18NCONTEXT_ID_ARMATURE,
|
||||
@@ -1856,7 +1857,7 @@ static uiBlock *curvemap_clipping_func(bContext *C, ARegion *ar, void *cumap_v)
|
||||
/* use this for a fake extra empy space around the buttons */
|
||||
uiDefBut(block, LABEL, 0, "", -4, 16, width + 8, 6 * UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
|
||||
|
||||
bt = uiDefButBitI(block, TOG, CUMA_DO_CLIP, 1, "Use Clipping",
|
||||
bt = uiDefButBitI(block, TOG, CUMA_DO_CLIP, 1, IFACE_("Use Clipping"),
|
||||
0, 5 * UI_UNIT_Y, width, UI_UNIT_Y, &cumap->flag, 0.0, 0.0, 10, 0, "");
|
||||
uiButSetFunc(bt, curvemap_buttons_setclip, cumap, NULL);
|
||||
|
||||
|
||||
@@ -646,8 +646,8 @@ static void widget_verts_to_quad_strip_open(uiWidgetBase *wtb, const int totvert
|
||||
for (a = 0; a < totvert; a++) {
|
||||
quad_strip[a * 2][0] = wtb->outer_v[a][0];
|
||||
quad_strip[a * 2][1] = wtb->outer_v[a][1];
|
||||
quad_strip[a * 2 + 1][0] = wtb->inner_v[a][0];
|
||||
quad_strip[a * 2 + 1][1] = wtb->inner_v[a][1];
|
||||
quad_strip[a * 2 + 1][0] = wtb->outer_v[a][0];
|
||||
quad_strip[a * 2 + 1][1] = wtb->outer_v[a][1] - 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1900,12 +1900,12 @@ static void ui_hsv_cursor(float x, float y)
|
||||
glTranslatef(x, y, 0.0f);
|
||||
|
||||
glColor3f(1.0f, 1.0f, 1.0f);
|
||||
glutil_draw_filled_arc(0.0f, M_PI * 2.0, 3.0f, 8);
|
||||
glutil_draw_filled_arc(0.0f, M_PI * 2.0, 3.0f * U.pixelsize, 8);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
glutil_draw_lined_arc(0.0f, M_PI * 2.0, 3.0f, 12);
|
||||
glutil_draw_lined_arc(0.0f, M_PI * 2.0, 3.0f * U.pixelsize, 12);
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
|
||||
@@ -1929,7 +1929,7 @@ void ui_hsvcircle_vals_from_pos(float *val_rad, float *val_dist, const rcti *rec
|
||||
|
||||
static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti *rect)
|
||||
{
|
||||
const int tot = 32;
|
||||
const int tot = 64;
|
||||
const float radstep = 2.0f * (float)M_PI / (float)tot;
|
||||
|
||||
const float centx = BLI_rcti_cent_x_fl(rect);
|
||||
|
||||
@@ -696,6 +696,7 @@ void ui_theme_init_default(void)
|
||||
ui_widget_color_init(&btheme->tui);
|
||||
|
||||
btheme->tui.iconfile[0] = 0;
|
||||
btheme->tui.panel.show_back = FALSE;
|
||||
btheme->tui.panel.show_header = FALSE;
|
||||
rgba_char_args_set(btheme->tui.panel.header, 0, 0, 0, 25);
|
||||
|
||||
@@ -713,6 +714,8 @@ void ui_theme_init_default(void)
|
||||
ui_theme_init_new(btheme);
|
||||
|
||||
/* space view3d */
|
||||
btheme->tv3d.panelcolors.show_back = FALSE;
|
||||
btheme->tv3d.panelcolors.show_header = FALSE;
|
||||
rgba_char_args_set_fl(btheme->tv3d.back, 0.225, 0.225, 0.225, 1.0);
|
||||
rgba_char_args_set(btheme->tv3d.text, 0, 0, 0, 255);
|
||||
rgba_char_args_set(btheme->tv3d.text_hi, 255, 255, 255, 255);
|
||||
@@ -1332,7 +1335,6 @@ void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3]
|
||||
void init_userdef_do_versions(void)
|
||||
{
|
||||
Main *bmain = G.main;
|
||||
// countall();
|
||||
|
||||
/* the UserDef struct is not corrected with do_versions() .... ugh! */
|
||||
if (U.wheellinescroll == 0) U.wheellinescroll = 3;
|
||||
@@ -2121,7 +2123,8 @@ void init_userdef_do_versions(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 266) {
|
||||
/* NOTE!! from now on use U.versionfile and U.subversionfile */
|
||||
if (U.versionfile < 266) {
|
||||
bTheme *btheme;
|
||||
|
||||
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
|
||||
@@ -2133,7 +2136,7 @@ void init_userdef_do_versions(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 265, 4)) {
|
||||
if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 4)) {
|
||||
bTheme *btheme;
|
||||
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
|
||||
rgba_char_args_set(btheme->text.syntaxd, 50, 0, 140, 255); /* Decorator/Preprocessor Dir. Blue-purple */
|
||||
@@ -2142,14 +2145,14 @@ void init_userdef_do_versions(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 265, 6)) {
|
||||
if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 6)) {
|
||||
bTheme *btheme;
|
||||
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
|
||||
copy_v4_v4_char(btheme->tv3d.gradients.high_gradient, btheme->tv3d.back);
|
||||
}
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 265, 9)) {
|
||||
if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 9)) {
|
||||
bTheme *btheme;
|
||||
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
|
||||
rgba_char_args_test_set(btheme->tnode.syntaxs, 151, 116, 116, 255); /* matte nodes */
|
||||
@@ -2157,6 +2160,9 @@ void init_userdef_do_versions(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* NOTE!! from now on use U.versionfile and U.subversionfile */
|
||||
|
||||
|
||||
if (U.pixelsize == 0.0f)
|
||||
U.pixelsize = 1.0f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user