Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Xiangquan <xiaoxiangquan@gmail.com>2011-07-14 21:29:53 +0400
committerXiao Xiangquan <xiaoxiangquan@gmail.com>2011-07-14 21:29:53 +0400
commitfa46278e347ca173e9e6d6b734a59c268f4fc9d0 (patch)
treea14148822e60cb1f8f36dba0481b830cb9675db1 /source/blender/editors/interface
parent470a5017fb80f21bac08373e4b5816c92d42990a (diff)
parent4da4943b5ce9514e9fb3d9458f3e52d6b0d310ca (diff)
merge from trunk 38379
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c4
-rw-r--r--source/blender/editors/interface/interface_draw.c10
-rw-r--r--source/blender/editors/interface/interface_handlers.c10
-rw-r--r--source/blender/editors/interface/interface_style.c2
-rw-r--r--source/blender/editors/interface/interface_templates.c8
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
6 files changed, 24 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 30c0f552b72..8aed0d58a07 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 99a31e039c8..e9ec4ccc66d 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 64280bbda03..efc26e11920 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, short fontid)
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= fontid;
style->paneltitle.points= 12;
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 7fb0200ae1e..989dee89ac5 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -33,14 +33,13 @@
#include "MEM_guardedalloc.h"
+#include "DNA_key_types.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
-#include "BLF_api.h"
-
#include "BKE_animsys.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
@@ -64,6 +63,8 @@
#include "UI_interface.h"
#include "interface_intern.h"
+#include "BLF_api.h"
+
void UI_template_fix_linking(void)
{
}
@@ -2104,6 +2105,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
}
else if(itemptr->type == &RNA_ShapeKey) {
Object *ob= (Object*)activeptr->data;
+ Key *key= (Key*)itemptr->data;
split= uiLayoutSplit(sub, 0.75f, 0);
@@ -2111,7 +2113,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
uiBlockSetEmboss(block, UI_EMBOSSN);
row= uiLayoutRow(split, 1);
- if(i == 0) uiItemL(row, "", ICON_NONE);
+ if(i == 0 || (key->type != KEY_RELATIVE)) uiItemL(row, "", ICON_NONE);
else uiItemR(row, itemptr, "value", 0, "", ICON_NONE);
if(ob->mode == OB_MODE_EDIT && !((ob->shapeflag & OB_SHAPE_EDIT_MODE) && ob->type == OB_MESH))
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 */