diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-07-05 17:54:25 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-07-05 17:54:25 +0400 |
commit | 3f3c6f5f1fb336f8f0015d7857a1ae153fa2a80f (patch) | |
tree | 27e2ae66dd589013c24592fe0803b440a7e014be /source/blender/editors/interface | |
parent | 887fd19894047832fbb7a7300e5fc11438b1f3b2 (diff) | |
parent | ccd31900ab9659b6fdc035fd91bff9f508334e22 (diff) |
Merging from trunk up to r38119.
Diffstat (limited to 'source/blender/editors/interface')
5 files changed, 19 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 17a08917a16..40d86ec1147 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -74,8 +74,8 @@ #define MENU_ITEM_HEIGHT 20 #define MENU_SEP_HEIGHT 6 -#define PRECISION_FLOAT_MAX 7 -#define PRECISION_FLOAT_MAX_POW 10000000 /* pow(10, PRECISION_FLOAT_MAX) */ +#define PRECISION_FLOAT_MAX 6 +#define PRECISION_FLOAT_MAX_POW 1000000 /* pow(10, PRECISION_FLOAT_MAX) */ /* avoid unneeded calls to ui_get_but_val */ #define UI_BUT_VALUE_UNSET DBL_MAX diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index c7f11116834..97299a6a766 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -142,13 +142,13 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r static void round_box_shade_col(float *col1, float *col2, float fac) { - float col[3]; + float col[4]; col[0]= (fac*col1[0] + (1.0f-fac)*col2[0]); col[1]= (fac*col1[1] + (1.0f-fac)*col2[1]); col[2]= (fac*col1[2] + (1.0f-fac)*col2[2]); - - glColor3fv(col); + col[3]= (fac*col1[3] + (1.0f-fac)*col2[3]); + glColor4fv(col); } @@ -159,7 +159,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; float div= maxy-miny; - float coltop[3], coldown[3], color[4]; + float coltop[4], coldown[4], color[4]; int a; /* mult */ @@ -173,9 +173,11 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f; coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f; coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f; + coltop[3]= color[3]; coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f; coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f; coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f; + coldown[3]= color[3]; glShadeModel(GL_SMOOTH); glBegin(mode); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c318b9ae6a9..10a6d3ceeef 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1895,7 +1895,15 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } if(event->ascii && (retval == WM_UI_HANDLER_CONTINUE)) { - changed= ui_textedit_type_ascii(but, data, event->ascii); + char ascii = event->ascii; + + /* exception that's useful for number buttons, some keyboard + numpads have a comma instead of a period */ + if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) + if(event->type == PADPERIOD && ascii == ',') + ascii = '.'; + + changed= ui_textedit_type_ascii(but, data, ascii); retval= WM_UI_HANDLER_BREAK; } diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 1352648b271..02067ec4666 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -83,7 +83,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) BLI_addtail(styles, style); BLI_strncpy(style->name, name, MAX_STYLE_NAME); - style->panelzoom= 1.0; + style->panelzoom= 1.0; /* unused */ style->paneltitle.uifont_id= UIFONT_DEFAULT; style->paneltitle.points= 12; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index b6e255b6758..25a64994f5c 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -180,7 +180,7 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y glEnable(GL_BLEND); glGetFloatv(GL_CURRENT_COLOR, color); - color[3]= 0.125; + color[3]*= 0.125; glColor4fv(color); /* for each AA step */ |