imtk

changeset 15:6893b4dca5a3

added gradients on the selection
author John Tsiombikas <nuclear@siggraph.org>
date Tue, 19 Apr 2011 05:10:09 +0300
parents df2bc9406561
children 1cf212375db3
files src/draw.c src/imtk.h src/progress.c
diffstat 3 files changed, 9 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/src/draw.c	Tue Apr 19 03:01:46 2011 +0300
     1.2 +++ b/src/draw.c	Tue Apr 19 05:10:09 2011 +0300
     1.3 @@ -13,11 +13,11 @@
     1.4  	{0.9, 0.9, 0.9, 1.0},		/* lit bevel */
     1.5  	{0.3, 0.3, 0.3, 1.0},		/* shadowed bevel */
     1.6  	{0.8, 0.25, 0.18, 1.0},		/* cursor color */
     1.7 -	{0.4, 0.5, 0.9, 1.0},		/* selection color */
     1.8 +	{0.68, 0.85, 1.3, 1.0},		/* selection color */
     1.9  	{0.75, 0.1, 0.095, 1.0}		/* check color */
    1.10  };
    1.11  
    1.12 -static float focus_factor = 1.1;
    1.13 +static float focus_factor = 1.15;
    1.14  static float press_factor = 0.8;
    1.15  static float alpha = 1.0;
    1.16  static float bevel = 1.0;
    1.17 @@ -49,6 +49,11 @@
    1.18  		ret[1] *= press_factor;
    1.19  		ret[2] *= press_factor;
    1.20  	}
    1.21 +	if(col & IMTK_SEL_BIT) {
    1.22 +		ret[0] *= colors[IMTK_SELECTION_COLOR][0];
    1.23 +		ret[1] *= colors[IMTK_SELECTION_COLOR][1];
    1.24 +		ret[2] *= colors[IMTK_SELECTION_COLOR][2];
    1.25 +	}
    1.26  	ret[3] *= alpha;
    1.27  	return ret;
    1.28  }
     2.1 --- a/src/imtk.h	Tue Apr 19 03:01:46 2011 +0300
     2.2 +++ b/src/imtk.h	Tue Apr 19 05:10:09 2011 +0300
     2.3 @@ -33,9 +33,7 @@
     2.4  
     2.5  #define IMTK_FOCUS_BIT		0x100
     2.6  #define IMTK_PRESS_BIT		0x200
     2.7 -
     2.8 -#define IMTK_BASE_COLOR		IMTK_BOTTOM_COLOR
     2.9 -#define IMTK_FOCUS_COLOR	(IMTK_TOP_COLOR | IMTK_FOCUS_BIT)
    2.10 +#define IMTK_SEL_BIT		0x400
    2.11  
    2.12  
    2.13  #ifdef __cplusplus
     3.1 --- a/src/progress.c	Tue Apr 19 03:01:46 2011 +0300
     3.2 +++ b/src/progress.c	Tue Apr 19 05:10:09 2011 +0300
     3.3 @@ -24,7 +24,7 @@
     3.4  	memcpy(tcol, imtk_get_color(IMTK_BOTTOM_COLOR), sizeof tcol);
     3.5  	memcpy(bcol, imtk_get_color(IMTK_TOP_COLOR), sizeof bcol);
     3.6  
     3.7 -	/* through */
     3.8 +	/* trough */
     3.9  	imtk_draw_rect(x - b, y - b, PROGR_SIZE + b * 2, PROGR_HEIGHT + b * 2, tcol, bcol);
    3.10  	imtk_draw_frame(x - b, y - b, PROGR_SIZE + b * 2, PROGR_HEIGHT + b * 2, FRAME_INSET);
    3.11