diff options
author | Matt Ebb <matt@mke3.net> | 2003-10-21 11:02:04 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2003-10-21 11:02:04 +0400 |
commit | 4405113308ee8165d2327dd58c6d0cd845678cc1 (patch) | |
tree | e1a4ab25f040fc987d97bb4fbbd2ade98037ac26 /source | |
parent | ff89daceb0fda2b0557e94a088f9a0973f2d704a (diff) |
- Lots of tweaks to interface colours, shading, etc.
- Fixed alignment/width of menus
Still needs more work.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/editscreen.c | 2 | ||||
-rw-r--r-- | source/blender/src/interface.c | 6 | ||||
-rw-r--r-- | source/blender/src/interface_draw.c | 177 | ||||
-rw-r--r-- | source/blender/src/interface_panel.c | 7 | ||||
-rw-r--r-- | source/blender/src/resources.c | 21 |
5 files changed, 141 insertions, 72 deletions
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 2d0d789917c..fe8535ad614 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -2839,7 +2839,7 @@ void draw_area_emboss(ScrArea *sa) /* top */ if(sa->headertype!=HEADERTOP) { - glColor4ub(255,255,255, 128); + glColor4ub(255,255,255, 96); sdrawline(0, sa->winy-1, sa->winx-1, sa->winy-1); } /* left */ diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index 2a744dbe383..75d67e0850e 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -785,6 +785,7 @@ static int ui_do_but_MENU(uiBut *but) } width+= 10; + if (width < (but->x2 - but->x1)) width = (but->x2 - but->x1); if (width<50) width=50; boxh= TBOXH; @@ -834,6 +835,10 @@ static int ui_do_but_MENU(uiBut *but) } } + /* fix alignment because of the shadow, etc */ + block->xofs = -2; + block->yofs = -2; + ui_positionblock(block, but); block->win= G.curscreen->mainwin; event= uiDoBlocks(&listb, 0); @@ -1691,6 +1696,7 @@ static int ui_do_but_BLOCK(uiBut *but) block= but->block_func(0); + block->xofs = -2; /* for proper alignment */ ui_positionblock(block, but); block->flag |= UI_BLOCK_LOOP; block->win= G.curscreen->mainwin; diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c index 050dcc564e5..de1bb856d5f 100644 --- a/source/blender/src/interface_draw.c +++ b/source/blender/src/interface_draw.c @@ -183,10 +183,12 @@ static void ui_draw_icon(uiBut *but, BIFIconID icon) glPixelZoom(1.0, 1.0); } -/* ************** MATT'S THEME, SHADED DECORATED BUTTONS ************* */ +/* ************** DEFAULT THEME, SHADED BUTTONS ************* */ #define M_WHITE BIF_ThemeColorShade(bc, 80) + +#define M_ACT_LIGHT BIF_ThemeColorShade(bc, 55) #define M_LIGHT BIF_ThemeColorShade(bc, 45) #define M_HILITE BIF_ThemeColorShade(bc, 25) #define M_LMEDIUM BIF_ThemeColorShade(bc, 10) @@ -195,7 +197,12 @@ static void ui_draw_icon(uiBut *but, BIFIconID icon) #define M_GREY BIF_ThemeColorShade(bc, -45) #define M_DARK BIF_ThemeColorShade(bc, -80) -#define MM_WHITE BIF_ThemeColorShade(TH_BUT_NEUTRAL, 80) +#define M_NUMTEXT BIF_ThemeColorShade(bc, 25) +#define M_NUMTEXT_ACT_LIGHT BIF_ThemeColorShade(bc, 35) + +#define MM_WHITE BIF_ThemeColorShade(TH_BUT_NEUTRAL, 120) +#define MM_WHITE_OP BIF_ThemeColorShadeAlpha(TH_BACK, 65, -100) +#define MM_WHITE_TR BIF_ThemeColorShadeAlpha(TH_BACK, 65, -255) #define MM_LIGHT BIF_ThemeColorShade(TH_BUT_NEUTRAL, 45) #define MM_MEDIUM BIF_ThemeColor(TH_BUT_NEUTRAL) #define MM_GREY BIF_ThemeColorShade(TH_BUT_NEUTRAL, -45) @@ -218,7 +225,6 @@ static void ui_default_button(int bc, float asp, float x1, float y1, float x2, f glShadeModel(GL_SMOOTH); glBegin(GL_QUADS); - if(flag & UI_SELECT) { if(flag & UI_ACTIVE) M_MEDIUM; else M_LGREY; @@ -236,7 +242,7 @@ static void ui_default_button(int bc, float asp, float x1, float y1, float x2, f else M_GREY; } else { - if(flag & UI_ACTIVE) M_WHITE; + if(flag & UI_ACTIVE) M_ACT_LIGHT; else M_LIGHT; } @@ -253,7 +259,7 @@ static void ui_default_button(int bc, float asp, float x1, float y1, float x2, f else M_GREY; } else { - if(flag & UI_ACTIVE) M_WHITE; + if(flag & UI_ACTIVE) M_ACT_LIGHT; else M_LIGHT; } @@ -268,26 +274,32 @@ static void ui_default_button(int bc, float asp, float x1, float y1, float x2, f /* OUTER SUNKEN EFFECT */ /* left */ + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x1-1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x1-1,y2); glEnd(); /* right */ glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x2+1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x2+1,y2); glEnd(); /* bottom */ - MM_WHITE; + MM_WHITE_OP; fdrawline(x1, y1-1, x2, y1-1); + + glDisable(GL_BLEND); /* END OUTER SUNKEN EFFECT */ /* INNER OUTLINE */ @@ -295,7 +307,7 @@ static void ui_default_button(int bc, float asp, float x1, float y1, float x2, f /* top */ if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_GREY; + if(flag & UI_ACTIVE) M_LGREY; else M_GREY; } else { @@ -308,7 +320,7 @@ static void ui_default_button(int bc, float asp, float x1, float y1, float x2, f /* bottom */ if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_LGREY; + if(flag & UI_ACTIVE) M_MEDIUM; else M_LGREY; } else { @@ -391,10 +403,11 @@ static void ui_default_text(int bc, float asp, float x1, float y1, float x2, flo else M_GREY; } else { - if(flag & UI_ACTIVE) M_HILITE; - else M_LMEDIUM; + if(flag & UI_ACTIVE) M_NUMTEXT_ACT_LIGHT; + else M_NUMTEXT; } + glVertex2f(x1,y1); glVertex2f(x2,y1); glVertex2f(x2,y2); @@ -405,27 +418,34 @@ static void ui_default_text(int bc, float asp, float x1, float y1, float x2, flo /* OUTER SUNKEN EFFECT */ /* left */ + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x1-1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x1-1,y2); glEnd(); /* right */ glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x2+1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x2+1,y2); glEnd(); /* bottom */ - MM_WHITE; + MM_WHITE_OP; fdrawline(x1, y1-1, x2, y1-1); + + glDisable(GL_BLEND); /* END OUTER SUNKEN EFFECT */ + /* OUTER OUTLINE */ glShadeModel(GL_FLAT); @@ -473,8 +493,8 @@ static void ui_default_num(int bc, float asp, float x1, float y1, float x2, floa else M_GREY; } else { - if(flag & UI_ACTIVE) M_HILITE; - else M_LMEDIUM; + if(flag & UI_ACTIVE) M_NUMTEXT_ACT_LIGHT; + else M_NUMTEXT; } glVertex2f(x1,y1); @@ -487,27 +507,34 @@ static void ui_default_num(int bc, float asp, float x1, float y1, float x2, floa /* OUTER SUNKEN EFFECT */ /* left */ + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x1-1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x1-1,y2); glEnd(); /* right */ glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x2+1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x2+1,y2); glEnd(); /* bottom */ - MM_WHITE; + MM_WHITE_OP; fdrawline(x1, y1-1, x2, y1-1); + + glDisable(GL_BLEND); /* END OUTER SUNKEN EFFECT */ + /* OUTER OUTLINE */ glShadeModel(GL_FLAT); @@ -606,7 +633,7 @@ static void ui_default_menu(int bc, float asp, float x1, float y1, float x2, flo else M_DARK; } else { - if(flag & UI_ACTIVE) M_WHITE; + if(flag & UI_ACTIVE) M_ACT_LIGHT; else M_LIGHT; } @@ -623,7 +650,7 @@ static void ui_default_menu(int bc, float asp, float x1, float y1, float x2, flo else M_DARK; } else { - if(flag & UI_ACTIVE) M_WHITE; + if(flag & UI_ACTIVE) M_ACT_LIGHT; else M_LIGHT; } @@ -637,28 +664,35 @@ static void ui_default_menu(int bc, float asp, float x1, float y1, float x2, flo /* OUTER SUNKEN EFFECT */ /* left */ + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x1-1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x1-1,y2); glEnd(); /* right */ glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x2+1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x2+1,y2); glEnd(); /* bottom */ - MM_WHITE; + MM_WHITE_OP; fdrawline(x1, y1-1, x2, y1-1); + + glDisable(GL_BLEND); /* END OUTER SUNKEN EFFECT */ + /* INNER OUTLINE */ glShadeModel(GL_FLAT); @@ -793,8 +827,8 @@ static void ui_default_iconrow(int bc, float asp, float x1, float y1, float x2, if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_MEDIUM; - else M_LGREY; + if(flag & UI_ACTIVE) M_LGREY; + else M_GREY; } else { if(flag & UI_ACTIVE) M_LIGHT; @@ -805,11 +839,11 @@ static void ui_default_iconrow(int bc, float asp, float x1, float y1, float x2, glVertex2f(x2,y1); if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_LGREY; - else M_GREY; + if(flag & UI_ACTIVE) M_GREY; + else M_DARK; } else { - if(flag & UI_ACTIVE) M_WHITE; + if(flag & UI_ACTIVE) M_ACT_LIGHT; else M_LIGHT; } @@ -822,11 +856,11 @@ static void ui_default_iconrow(int bc, float asp, float x1, float y1, float x2, glBegin(GL_QUADS); if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_LGREY; - else M_GREY; + if(flag & UI_ACTIVE) M_GREY; + else M_DARK; } else { - if(flag & UI_ACTIVE) M_WHITE; + if(flag & UI_ACTIVE) M_ACT_LIGHT; else M_LIGHT; } @@ -840,28 +874,35 @@ static void ui_default_iconrow(int bc, float asp, float x1, float y1, float x2, /* OUTER SUNKEN EFFECT */ /* left */ + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x1-1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x1-1,y2); glEnd(); /* right */ glShadeModel(GL_SMOOTH); glBegin(GL_LINES); - MM_WHITE; + MM_WHITE_OP; glVertex2f(x2+1,y1); - MM_LIGHT; + MM_WHITE_TR; glVertex2f(x2+1,y2); glEnd(); /* bottom */ - MM_WHITE; + MM_WHITE_OP; fdrawline(x1, y1-1, x2, y1-1); + + glDisable(GL_BLEND); /* END OUTER SUNKEN EFFECT */ + /* INNER OUTLINE */ glShadeModel(GL_FLAT); @@ -1171,37 +1212,41 @@ static void ui_draw_slider(int colorid, float fac, float aspect, float x1, float void uiDrawMenuBox(float minx, float miny, float maxx, float maxy) { - BIF_ThemeColor(TH_MENU_BACK); - - glRectf(minx, miny, maxx, maxy); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); - - glColor4ub(0, 0, 0, 100); - fdrawline(minx+4, miny, maxx+1, miny); - fdrawline(maxx+1, miny, maxx+1, maxy-4); - glColor4ub(0, 0, 0, 80); - fdrawline(minx+4, miny-1, maxx+1, miny-1); - fdrawline(maxx+1, miny-1, maxx+1, maxy-4); + glColor4ub(0, 0, 0, 20); + + /* to prevent gaps being drawn between box and shadow (rounding errors?) */ + fdrawline(minx+3, miny+0.25, maxx+0.25, miny+0.25); + fdrawline(maxx+0.25, miny+0.25, maxx+0.25, maxy-3); + + glColor4ub(0, 0, 0, 70); + fdrawline(minx+3, miny, maxx+1, miny); + fdrawline(maxx+1, miny, maxx+1, maxy-3); + + glColor4ub(0, 0, 0, 70); + fdrawline(minx+3, miny-1, maxx+1, miny-1); + fdrawline(maxx+1, miny-1, maxx+1, maxy-3); glColor4ub(0, 0, 0, 55); - fdrawline(minx+4, miny-2, maxx+2, miny-2); - fdrawline(maxx+2, miny-2, maxx+2, maxy-4); + fdrawline(minx+3, miny-2, maxx+2, miny-2); + fdrawline(maxx+2, miny-2, maxx+2, maxy-3); glColor4ub(0, 0, 0, 35); - fdrawline(minx+4, miny-3, maxx+3, miny-3); - fdrawline(maxx+3, miny-3, maxx+3, maxy-4); + fdrawline(minx+3, miny-3, maxx+3, miny-3); + fdrawline(maxx+3, miny-3, maxx+3, maxy-3); glColor4ub(0, 0, 0, 20); - fdrawline(minx+4, miny-4, maxx+4, miny-4); - fdrawline(maxx+4, miny-4, maxx+4, maxy-4); - + fdrawline(minx+3, miny-4, maxx+4, miny-4); + fdrawline(maxx+4, miny-4, maxx+4, maxy-3); + glDisable(GL_BLEND); -} - + + BIF_ThemeColor(TH_MENU_BACK); + glRectf(minx, miny, maxx, maxy); +} /* pulldown menu */ static void ui_draw_pulldown(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) diff --git a/source/blender/src/interface_panel.c b/source/blender/src/interface_panel.c index 0ae12e3ab86..bdebb2f524f 100644 --- a/source/blender/src/interface_panel.c +++ b/source/blender/src/interface_panel.c @@ -630,10 +630,10 @@ static void ui_draw_tria_icon(float x, float y, float aspect, char dir) BIF_ThemeColor(TH_TEXT_HI); if(dir=='h') { - ui_draw_anti_tria( x, y, x, y+10.0, x+6, y+5.25); + ui_draw_anti_tria( x, y+1, x, y+10.0, x+7, y+6.25); } else { - ui_draw_anti_tria( x-2, y+7, x+10-2, y+7, x+5.25-2, y+2); + ui_draw_anti_tria( x-2, y+8, x+9-2, y+8, x+4.75-2, y+1); } } @@ -834,12 +834,13 @@ void ui_draw_panel(uiBlock *block) uiSetRoundBox(3); if(panel->control & UI_PNL_SOLID) { - BIF_ThemeColorShade(TH_HEADER, -40); + BIF_ThemeColorShade(TH_HEADER, -30); uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 10); // blend now for panels in 3d window, test... glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glEnable(GL_BLEND); BIF_ThemeColor4(TH_PANEL); + BIF_ThemeColorShade(TH_PANEL, +100); glRectf(block->minx, block->miny, block->maxx, block->maxy); //if(align) { diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c index 1555dd9bc56..3795d502c83 100644 --- a/source/blender/src/resources.c +++ b/source/blender/src/resources.c @@ -436,7 +436,7 @@ void BIF_InitTheme(void) SETCOL(btheme->tui.setting2, 0xA2,0x98,0xA9, 255); SETCOL(btheme->tui.num, 0x90,0x90,0x90, 255); SETCOL(btheme->tui.textfield, 0x90,0x90,0x90, 255); - SETCOL(btheme->tui.popup, 0xB2,0xB2,0xA9, 255); + SETCOL(btheme->tui.popup, 0xA0,0xA0,0xA0, 255); SETCOL(btheme->tui.text, 0,0,0, 255); SETCOL(btheme->tui.text_hi, 255, 255, 255, 255); @@ -632,7 +632,24 @@ void BIF_ThemeColorShade(int colorid, int offset) CLAMP(g, 0, 255); b= offset + (int) cp[2]; CLAMP(b, 0, 255); - glColor3ub(r, g, b); + //glColor3ub(r, g, b); + glColor4ub(r, g, b, cp[3]); +} +void BIF_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset) +{ + int r, g, b, a; + char *cp; + + cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); + r= coloffset + (int) cp[0]; + CLAMP(r, 0, 255); + g= coloffset + (int) cp[1]; + CLAMP(g, 0, 255); + b= coloffset + (int) cp[2]; + CLAMP(b, 0, 255); + a= alphaoffset + (int) cp[3]; + CLAMP(a, 0, 255); + glColor4ub(r, g, b, a); } // blend between to theme colors, and set it |