Commit 902f673b authored by Claes Sjofors's avatar Claes Sjofors

Ge, different ways to show hot object added: linewith, light color, dark color

parent 6f71aeb8
......@@ -153,3 +153,4 @@
091102 cs ge Menu items for connections changed to radio items.
091103 cs xtt Translation and utf8 conversion of search condition in EventLog window fixed.
091104 cs glow Fixcolor added to arc properties.
091106 cs ge Different ways to show hot object added: linewith, light color, dark color.
\ No newline at end of file
......@@ -832,6 +832,14 @@ static attrnav_sEnumElement elem_font[] = {
{ (int) glow_eFont_Times, "Times"},
{ (int) glow_eFont_NewCenturySchoolbook, "New Century Schoolbook"},
{ (int) glow_eFont_Courier, "Courier"},
{ (int) glow_eFont_LucidaSans, "LucidaSans"},
{ 0, ""}};
static attrnav_sEnumElement elem_hot_indication[] = {
{ (int) glow_eHotIndication_No, "No"},
{ (int) glow_eHotIndication_LineWidth, "LineWidth"},
{ (int) glow_eHotIndication_DarkColor, "DarkColor"},
{ (int) glow_eHotIndication_LightColor, "LightColor"},
{ 0, ""}};
static attrnav_sEnumElement elem_access[] = {
......@@ -956,6 +964,7 @@ static attrnav_sEnum enum_types[] = {
{ (int) glow_eType_Font, (attrnav_sEnumElement *) &elem_font},
{ (int) ge_eAttrType_CurveDataType, (attrnav_sEnumElement *) &elem_curve_datatype},
{ (int) glow_eType_Gradient, (attrnav_sEnumElement *) &elem_gradient},
{ (int) glow_eType_HotIndication, (attrnav_sEnumElement *) &elem_hot_indication},
{ 0, NULL}};
static attrnav_sEnum mask_types[] = {
......@@ -1019,6 +1028,7 @@ int attrnav_attr_string_to_value( int type_id, char *value_str,
case glow_eType_Relief:
case glow_eType_TextSize:
case glow_eType_Gradient:
case glow_eType_HotIndication:
case ge_eAttrType_DynType:
case ge_eAttrType_DynTypeTone:
case ge_eAttrType_ActionType:
......@@ -1102,6 +1112,7 @@ void attrnav_attrvalue_to_string( int type_id, void *value_ptr,
case glow_eType_Relief:
case glow_eType_TextSize:
case glow_eType_Gradient:
case glow_eType_HotIndication:
case ge_eAttrType_AnimSequence:
case ge_eAttrType_LimitType:
case ge_eAttrType_ScaleType:
......@@ -2157,6 +2168,7 @@ ItemLocal::ItemLocal( AttrNav *attrnav, const char *item_name, const char *attr,
case glow_eType_Relief:
case glow_eType_TextSize:
case glow_eType_Gradient:
case glow_eType_HotIndication:
case ge_eAttrType_DynType:
case ge_eAttrType_DynTypeTone:
case ge_eAttrType_ActionType:
......
......@@ -80,7 +80,8 @@ typedef enum {
glow_eType_TextSize, //!< Type is a text size, glow_eTextSize
glow_eType_Adjustment, //!< Type is glow_eAdjustment
glow_eType_Font, //!< Type is glow_eFont
glow_eType_Gradient //!< Type is glow_eGradient
glow_eType_Gradient, //!< Type is glow_eGradient
glow_eType_HotIndication //!< Type is glow_eHotIndication
} glow_eType;
//! Type of Ctx class
......@@ -372,6 +373,14 @@ typedef enum {
} glow_eGradient;
//! Type of shadow drawn for an object
typedef enum {
glow_eHotIndication_No, //!< No hot object indication
glow_eHotIndication_LineWidth, //!< Increased linewidth for hot objects
glow_eHotIndication_DarkColor, //!< Darker color for hot objects
glow_eHotIndication_LightColor //!< Lighter color for hot objects
} glow_eHotIndication;
//! Color index for a color
/*! The drawtype is index in an array that contains the gc for colors in the color palette.
The 300 first are the colors in the color palette, the seven last are used for erase, and texts. */
......@@ -1079,6 +1088,7 @@ typedef enum {
glow_eSave_Ctx_zoom_factor_y = 135,
glow_eSave_Ctx_nav_zoom_factor_y = 136,
glow_eSave_Ctx_version = 137,
glow_eSave_Ctx_hot_indication = 138,
glow_eSave_Ctx_comment = 199,
glow_eSave_Array_a = 200,
glow_eSave_NodeClass_nc_name = 300,
......
......@@ -78,7 +78,8 @@ GlowCtx::GlowCtx( const char *ctx_name, double zoom_fact, int offs_x, int offs_y
hot_mode(glow_eHotMode_Default),
default_hot_mode(glow_eHotMode_SingleObject), hot_found(0),
userdata_save_callback(0), userdata_open_callback(0), userdata_copy_callback(0),
version(GLOW_VERSION), inputfocus_object(0), is_component(0), comment(0)
version(GLOW_VERSION), inputfocus_object(0), is_component(0), comment(0),
hot_indication(glow_eHotIndication_LightColor)
{
strcpy(name, ctx_name);
memset( (void *)event_callback, 0, sizeof(event_callback));
......@@ -188,6 +189,7 @@ int GlowCtx::save( char *filename, glow_eSaveMode mode)
fp << int(glow_eSave_Ctx_refcon_textsize) << FSPACE << refcon_textsize << endl;
fp << int(glow_eSave_Ctx_refcon_linewidth) << FSPACE << refcon_linewidth << endl;
fp << int(glow_eSave_Ctx_version) << FSPACE << version << endl;
fp << int(glow_eSave_Ctx_hot_indication) << FSPACE << hot_indication << endl;
if ( ctx_type == glow_eCtxType_Grow)
{
fp << int(glow_eSave_Ctx_grow) << endl;
......@@ -265,6 +267,7 @@ int GlowCtx::open( char *filename, glow_eSaveMode mode)
char dummy[40];
int grow_loaded = 0;
int zoom_y_found = 0;
int tmp;
if ( !check_file( filename))
return GLOW__FILEOPEN;
......@@ -324,6 +327,7 @@ int GlowCtx::open( char *filename, glow_eSaveMode mode)
case glow_eSave_Ctx_refcon_textsize: fp >> refcon_textsize; break;
case glow_eSave_Ctx_refcon_linewidth: fp >> refcon_linewidth; break;
case glow_eSave_Ctx_version: fp >> version; break;
case glow_eSave_Ctx_hot_indication: fp >> tmp; hot_indication = (glow_eHotIndication)tmp; break;
case glow_eSave_Ctx_grow:
((GrowCtx *)this)->open_grow( fp);
grow_loaded = 1;
......
......@@ -822,6 +822,7 @@ class GlowCtx {
GlowArrayElem *inputfocus_object; //!< Object that has input focus.
int is_component; //!< Ctx is a window component.
CtxComment *comment;
glow_eHotIndication hot_indication; //!< Specification of how hots object should be drawn.
//! Register scrollbar callback function
/*!
......
......@@ -2820,6 +2820,11 @@ int grow_GetGraphAttrInfo( grow_tCtx ctx, grow_sAttrInfo **info,
attrinfo[i].type = glow_eType_Boolean;
attrinfo[i++].size = sizeof( ctx->bitmap_fonts);
strcpy( attrinfo[i].name, "HotIndication");
attrinfo[i].value_p = &ctx->hot_indication;
attrinfo[i].type = glow_eType_HotIndication;
attrinfo[i++].size = sizeof( ctx->hot_indication);
attrinfo[i].info_type = grow_eInfoType_End;
*attr_cnt = i;
*info = attrinfo;
......
......@@ -661,6 +661,19 @@ void GrowArc::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
return;
hot = 0;
}
int chot = 0;
if ( hot && ctx->environment != glow_eEnv_Development) {
if ( ctx->hot_indication == glow_eHotIndication_No)
hot = 0;
else if ( ctx->hot_indication == glow_eHotIndication_DarkColor) {
chot = hot;
hot = 0;
}
else if ( ctx->hot_indication == glow_eHotIndication_LightColor) {
chot = -hot;
hot = 0;
}
}
if ( fixcolor)
colornode = 0;
......@@ -705,18 +718,23 @@ void GrowArc::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
grad = ((GrowNode *)node)->gradient;
if ( !display_shadow || shadow_width == 0 || angle2 != 360) {
if ( grad == glow_eGradient_No || fillcolor == glow_eDrawType_ColorRed)
if ( grad == glow_eGradient_No || fillcolor == glow_eDrawType_ColorRed) {
if ( chot)
drawtype = GlowColor::shift_drawtype( fillcolor, chot, 0);
else
drawtype = fillcolor;
ctx->gdraw->fill_arc( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
angle1 - rot, angle2, fillcolor, 0);
angle1 - rot, angle2, drawtype, 0);
}
else {
glow_eDrawType f1, f2;
if ( gradient_contrast >= 0) {
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6), 0);
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2 + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6) + chot, 0);
}
else {
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6), 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2, 0);
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6) + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2 + chot, 0);
}
ctx->gdraw->gradient_fill_arc( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, angle1 - rot,
angle2, fillcolor, f1, f2, grad);
......@@ -731,44 +749,49 @@ void GrowArc::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
if ( grad == glow_eGradient_No || fillcolor == glow_eDrawType_ColorRed) {
// Draw light shadow
drawtype = ctx->shift_drawtype( fillcolor, -drawtype_incr, (GrowNode *)colornode);
drawtype = ctx->shift_drawtype( fillcolor, -drawtype_incr + chot, (GrowNode *)colornode);
ctx->gdraw->fill_arc( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
35, 140, drawtype, 0);
// Draw dark shadow
drawtype = ctx->shift_drawtype( fillcolor, drawtype_incr, (GrowNode *)colornode);
drawtype = ctx->shift_drawtype( fillcolor, drawtype_incr + chot, (GrowNode *)colornode);
ctx->gdraw->fill_arc( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
215, 140, drawtype, 0);
// Draw medium shadow and body
if ( chot)
drawtype = GlowColor::shift_drawtype( fillcolor, chot, 0);
else
drawtype = fillcolor;
ctx->gdraw->fill_arc( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
-5, 40, fillcolor, 0);
-5, 40, drawtype, 0);
ctx->gdraw->fill_arc( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
175, 40, fillcolor, 0);
175, 40, drawtype, 0);
ctx->gdraw->fill_arc( w, ll_x + ish, ll_y + ish, ur_x - ll_x - 2*ish, ur_y - ll_y - 2*ish,
angle1 - rot, angle2, fillcolor, 0);
angle1 - rot, angle2, drawtype, 0);
}
else {
glow_eDrawType f1, f2;
// Draw shadow
f1 = ctx->shift_drawtype( fillcolor, -drawtype_incr, (GrowNode *)colornode);
f2 = ctx->shift_drawtype( fillcolor, drawtype_incr, (GrowNode *)colornode);
f1 = ctx->shift_drawtype( fillcolor, -drawtype_incr + chot, (GrowNode *)colornode);
f2 = ctx->shift_drawtype( fillcolor, drawtype_incr + chot, (GrowNode *)colornode);
ctx->gdraw->gradient_fill_arc( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y,
angle1 - rot, angle2, fillcolor, f2, f1, glow_eGradient_DiagonalUpperLeft);
// Draw circle
if ( gradient_contrast >= 0) {
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6), 0);
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2 + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6) + chot, 0);
}
else {
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6), 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2, 0);
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6) + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2 + chot, 0);
}
ctx->gdraw->gradient_fill_arc( w, ll_x + ish, ll_y + ish, ur_x - ll_x - 2*ish, ur_y - ll_y - 2*ish,
angle1 - rot, angle2, fillcolor, f1, f2, grad);
......@@ -793,6 +816,9 @@ void GrowArc::erase( GlowWind *w, GlowTransform *t, int hot, void *node)
return;
hot = 0;
}
if ( hot && ctx->environment != glow_eEnv_Development &&
ctx->hot_indication != glow_eHotIndication_LineWidth)
hot = 0;
if ( node && ((GrowNode *)node)->line_width)
idx = int( w->zoom_factor_y / w->base_zoom_factor *
......
......@@ -667,6 +667,10 @@ void GrowLine::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
return;
hot = 0;
}
if ( hot && ctx->environment != glow_eEnv_Development &&
ctx->hot_indication != glow_eHotIndication_LineWidth)
hot = 0;
glow_eDrawType drawtype;
int idx;
if ( node && ((GrowNode *)node)->line_width)
......@@ -723,6 +727,10 @@ void GrowLine::erase( GlowWind *w, GlowTransform *t, int hot, void *node)
return;
hot = 0;
}
if ( hot && ctx->environment != glow_eEnv_Development &&
ctx->hot_indication != glow_eHotIndication_LineWidth)
hot = 0;
int idx;
if ( node && ((GrowNode *)node)->line_width)
idx = int( w->zoom_factor_y / w->base_zoom_factor *
......
......@@ -175,7 +175,7 @@ int GrowPolyLine::shadow_direction()
}
void GrowPolyLine::calculate_shadow( glow_sShadowInfo **s, int *num, int ish, int highlight,
void *colornode, int javaexport)
void *colornode, int javaexport, int chot)
{
glow_sShadowInfo *sp;
double x;
......@@ -201,9 +201,9 @@ void GrowPolyLine::calculate_shadow( glow_sShadowInfo **s, int *num, int ish, in
dark_drawtype = (glow_eDrawType) drawtype_incr;
}
else {
light_drawtype = ctx->shift_drawtype( fillcolor, -drawtype_incr,
light_drawtype = ctx->shift_drawtype( fillcolor, -drawtype_incr + chot,
(GrowNode *)colornode);
dark_drawtype = ctx->shift_drawtype( fillcolor, drawtype_incr,
dark_drawtype = ctx->shift_drawtype( fillcolor, drawtype_incr + chot,
(GrowNode *)colornode);
}
......@@ -328,6 +328,19 @@ void GrowPolyLine::draw( GlowWind *w, GlowTransform *t, int highlight, int hot,
return;
hot = 0;
}
int chot = 0;
if ( hot && ctx->environment != glow_eEnv_Development) {
if ( ctx->hot_indication == glow_eHotIndication_No)
hot = 0;
else if ( ctx->hot_indication == glow_eHotIndication_DarkColor) {
chot = hot;
hot = 0;
}
else if ( ctx->hot_indication == glow_eHotIndication_LightColor) {
chot = -hot;
hot = 0;
}
}
int i;
glow_eDrawType drawtype;
int idx;
......@@ -377,11 +390,14 @@ void GrowPolyLine::draw( GlowWind *w, GlowTransform *t, int highlight, int hot,
drawtype = ctx->get_drawtype( fill_drawtype, glow_eDrawType_FillHighlight,
highlight, (GrowNode *)colornode, 1);
if ( fill_eq_light && node && ((GrowNode *)node)->shadow)
drawtype = ctx->shift_drawtype( drawtype, -shadow_contrast,
drawtype = ctx->shift_drawtype( drawtype, -shadow_contrast + chot,
(GrowNode *)colornode);
else if ( fill_eq_shadow && node && ((GrowNode *)node)->shadow)
drawtype = ctx->shift_drawtype( drawtype, shadow_contrast,
drawtype = ctx->shift_drawtype( drawtype, shadow_contrast + chot,
(GrowNode *)colornode);
else if ( chot)
drawtype = GlowColor::shift_drawtype( drawtype, chot, 0);
if ( grad == glow_eGradient_No || drawtype == glow_eDrawType_ColorRed)
ctx->gdraw->fill_polyline( w, points, a_points.a_size, drawtype, 0);
else {
......@@ -417,7 +433,7 @@ void GrowPolyLine::draw( GlowWind *w, GlowTransform *t, int highlight, int hot,
min((x_right - x_left)*w->zoom_factor_x, (y_high - y_low)*w->zoom_factor_y) + 0.5);
if ( ish >= 1) {
calculate_shadow( &sp, &p_num, ish, highlight, colornode, 0);
calculate_shadow( &sp, &p_num, ish, highlight, colornode, 0, chot);
glow_sPointX p[4];
for ( i = 0; i < p_num - 1; i++) {
......@@ -449,6 +465,9 @@ void GrowPolyLine::erase( GlowWind *w, GlowTransform *t, int hot, void *node)
return;
hot = 0;
}
if ( hot && ctx->environment != glow_eEnv_Development &&
ctx->hot_indication != glow_eHotIndication_LineWidth)
hot = 0;
int i;
int idx;
if ( node && ((GrowNode *)node)->line_width)
......@@ -1464,7 +1483,7 @@ void GrowPolyLine::export_javabean( GlowTransform *t, void *node,
min((x_right - x_left)*ctx->mw.zoom_factor_x, (y_high - y_low)*ctx->mw.zoom_factor_y) + 0.5);
if ( ish)
calculate_shadow( &sp, &p_num, ish, 0, 0, 1);
calculate_shadow( &sp, &p_num, ish, 0, 0, 1, 0);
else
jshadow = 0;
}
......
......@@ -332,7 +332,7 @@ class GrowPolyLine : public GlowPolyLine {
*/
void calculate_shadow( glow_sShadowInfo **s, int *num, int ish, int highlight, void *colornode,
int exportjava);
int exportjava, int chot);
double x_right; //!< Right border of object.
double x_left; //!< Left border of object.
......
......@@ -682,6 +682,19 @@ void GrowRect::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
return;
hot = 0;
}
int chot = 0;
if ( hot && ctx->environment != glow_eEnv_Development) {
if ( ctx->hot_indication == glow_eHotIndication_No)
hot = 0;
else if ( ctx->hot_indication == glow_eHotIndication_DarkColor) {
chot = hot;
hot = 0;
}
else if ( ctx->hot_indication == glow_eHotIndication_LightColor) {
chot = -hot;
hot = 0;
}
}
int idx;
glow_eDrawType drawtype;
if ( fixcolor)
......@@ -743,7 +756,7 @@ void GrowRect::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
if ( relief == glow_eRelief_Down)
drawtype_incr = -shadow_contrast;
drawtype = ctx->shift_drawtype( fillcolor, -drawtype_incr, (GrowNode *)colornode);
drawtype = ctx->shift_drawtype( fillcolor, -drawtype_incr + chot, (GrowNode *)colornode);
points[0].x = ll_x;
points[0].y = ll_y;
......@@ -762,7 +775,7 @@ void GrowRect::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
ctx->gdraw->fill_polyline( w, points, 7, drawtype, 0);
// Draw dark shadow
drawtype = ctx->shift_drawtype( fillcolor, drawtype_incr, (GrowNode *)colornode);
drawtype = ctx->shift_drawtype( fillcolor, drawtype_incr + chot, (GrowNode *)colornode);
points[0].x = ur_x;
points[0].y = ur_y;
......@@ -782,9 +795,14 @@ void GrowRect::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
}
if ( fill) {
if ( display_shadow && ish != 0) {
if ( grad == glow_eGradient_No || fillcolor == glow_eDrawType_ColorRed)
if ( grad == glow_eGradient_No || fillcolor == glow_eDrawType_ColorRed) {
if ( chot)
drawtype = GlowColor::shift_drawtype( fillcolor, chot, 0);
else
drawtype = fillcolor;
ctx->gdraw->fill_rect( w, ll_x + ish, ll_y + ish, ur_x - ll_x - 2 * ish, ur_y - ll_y - 2 * ish,
fillcolor);
drawtype);
}
else {
glow_eDrawType f1, f2;
double rotation;
......@@ -794,20 +812,25 @@ void GrowRect::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
rotation = trf.rot();
if ( gradient_contrast >= 0) {
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6), 0);
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2 + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6) + chot, 0);
}
else {
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6), 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2, 0);
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6) + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2 + chot, 0);
}
ctx->gdraw->gradient_fill_rect( w, ll_x + ish, ll_y + ish, ur_x - ll_x - 2 * ish, ur_y - ll_y - 2 * ish,
fillcolor, f1, f2, ctx->gdraw->gradient_rotate( rotation, grad));
}
}
else {
if ( grad == glow_eGradient_No || fillcolor == glow_eDrawType_ColorRed)
ctx->gdraw->fill_rect( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, fillcolor);
if ( grad == glow_eGradient_No || fillcolor == glow_eDrawType_ColorRed) {
if ( chot)
drawtype = GlowColor::shift_drawtype( fillcolor, chot, 0);
else
drawtype = fillcolor;
ctx->gdraw->fill_rect( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, drawtype);
}
else {
glow_eDrawType f1, f2;
double rotation;
......@@ -816,11 +839,11 @@ void GrowRect::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
else
rotation = trf.rot();
if ( gradient_contrast >= 0) {
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6), 0);
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2 + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6) + chot, 0);
}
else {
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6), 0);
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6) + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2, 0);
}
ctx->gdraw->gradient_fill_rect( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, fillcolor, f1, f2, ctx->gdraw->gradient_rotate( rotation, grad));
......@@ -845,6 +868,10 @@ void GrowRect::erase( GlowWind *w, GlowTransform *t, int hot, void *node)
return;
hot = 0;
}
if ( hot && ctx->environment != glow_eEnv_Development &&
ctx->hot_indication != glow_eHotIndication_LineWidth)
hot = 0;
int idx;
if ( fix_line_width) {
idx = line_width;
......
......@@ -672,6 +672,19 @@ void GrowRectRounded::draw( GlowWind *w, GlowTransform *t, int highlight, int ho
return;
hot = 0;
}
int chot = 0;
if ( hot && ctx->environment != glow_eEnv_Development) {
if ( ctx->hot_indication == glow_eHotIndication_No)
hot = 0;
else if ( ctx->hot_indication == glow_eHotIndication_DarkColor) {
chot = hot;
hot = 0;
}
else if ( ctx->hot_indication == glow_eHotIndication_LightColor) {
chot = -hot;
hot = 0;
}
}
int idx;
glow_eDrawType drawtype;
......@@ -726,17 +739,22 @@ void GrowRectRounded::draw( GlowWind *w, GlowTransform *t, int highlight, int ho
if ( !display_shadow || ish == 0) {
if ( grad == glow_eGradient_No) {
ctx->gdraw->fill_rect( w, ll_x, ll_y + amount, ur_x - ll_x, ur_y - ll_y - 2*amount, fillcolor);
ctx->gdraw->fill_rect( w, ll_x + amount, ll_y, ur_x - ll_x - 2*amount, amount, fillcolor);
ctx->gdraw->fill_rect( w, ll_x + amount, ur_y - amount, ur_x - ll_x - 2*amount, amount, fillcolor);
if ( chot)
drawtype = GlowColor::shift_drawtype( fillcolor, chot, 0);
else
drawtype = fillcolor;
ctx->gdraw->fill_rect( w, ll_x, ll_y + amount, ur_x - ll_x, ur_y - ll_y - 2*amount, drawtype);
ctx->gdraw->fill_rect( w, ll_x + amount, ll_y, ur_x - ll_x - 2*amount, amount, drawtype);
ctx->gdraw->fill_rect( w, ll_x + amount, ur_y - amount, ur_x - ll_x - 2*amount, amount, drawtype);
ctx->gdraw->fill_arc( w, ll_x, ll_y, 2*amount, 2*amount, 90, 90,
fillcolor, 0);
drawtype, 0);
ctx->gdraw->fill_arc( w, ll_x, ur_y - 2*amount, 2*amount, 2*amount, 180, 90,
fillcolor, 0);
drawtype, 0);
ctx->gdraw->fill_arc( w, ur_x - 2*amount, ur_y - 2*amount, 2*amount, 2*amount, 270, 90,
fillcolor, 0);
drawtype, 0);
ctx->gdraw->fill_arc( w, ur_x - 2*amount, ll_y, 2*amount, 2*amount, 0, 90,
fillcolor, 0);
drawtype, 0);
}
else {
glow_eDrawType f1, f2;
......@@ -747,12 +765,12 @@ void GrowRectRounded::draw( GlowWind *w, GlowTransform *t, int highlight, int ho
rotation = trf.rot();
if ( gradient_contrast >= 0) {
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6), 0);
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2 + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6) + chot, 0);
}
else {
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6), 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2, 0);
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6) + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2 + chot, 0);
}
ctx->gdraw->gradient_fill_rectrounded( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, amount,
fillcolor, f1, f2, ctx->gdraw->gradient_rotate( rotation, grad));
......@@ -765,7 +783,7 @@ void GrowRectRounded::draw( GlowWind *w, GlowTransform *t, int highlight, int ho
drawtype_incr = -shadow_contrast;
// Draw light shadow
drawtype = ctx->shift_drawtype( fillcolor, -drawtype_incr, (GrowNode *)colornode);
drawtype = ctx->shift_drawtype( fillcolor, -drawtype_incr + chot, (GrowNode *)colornode);
ctx->gdraw->fill_rect( w, ll_x + amount, ll_y, ur_x - ll_x - 2*amount, ish, drawtype);
ctx->gdraw->fill_rect( w, ll_x, ll_y + amount, ish, ur_y - ll_y - 2*amount, drawtype);
ctx->gdraw->fill_arc( w, ll_x, ll_y, 2*amount, 2*amount, 90, 90,
......@@ -775,7 +793,7 @@ void GrowRectRounded::draw( GlowWind *w, GlowTransform *t, int highlight, int ho
ctx->gdraw->fill_arc( w, ur_x - 2*amount, ll_y, 2*amount, 2*amount, 45, 45,
drawtype, 0);
// Draw dark shadow
drawtype = ctx->shift_drawtype( fillcolor, drawtype_incr, (GrowNode *)colornode);
drawtype = ctx->shift_drawtype( fillcolor, drawtype_incr + chot, (GrowNode *)colornode);
ctx->gdraw->fill_rect( w, ll_x + amount, ur_y - ish, ur_x - ll_x - 2*amount, ish, drawtype);
ctx->gdraw->fill_rect( w, ur_x - ish, ll_y + amount, ish, ur_y - ll_y - 2*amount, drawtype);
ctx->gdraw->fill_arc( w, ll_x, ur_y - 2*amount, 2*amount, 2*amount, 225, 45,
......@@ -787,21 +805,27 @@ void GrowRectRounded::draw( GlowWind *w, GlowTransform *t, int highlight, int ho
if ( grad == glow_eGradient_No) {
if ( chot)
drawtype = GlowColor::shift_drawtype( fillcolor, chot, 0);
else
drawtype = fillcolor;
if ( amount > ish) {
ctx->gdraw->fill_rect( w, ll_x+ish, ll_y + amount, ur_x - ll_x-2*ish, ur_y - ll_y - 2*amount, fillcolor);
ctx->gdraw->fill_rect( w, ll_x + amount, ll_y+ish, ur_x - ll_x - 2*amount, amount-ish, fillcolor);
ctx->gdraw->fill_rect( w, ll_x + amount, ur_y - amount, ur_x - ll_x - 2*amount, amount-ish, fillcolor);
ctx->gdraw->fill_rect( w, ll_x+ish, ll_y + amount, ur_x - ll_x-2*ish, ur_y - ll_y - 2*amount, drawtype);
ctx->gdraw->fill_rect( w, ll_x + amount, ll_y+ish, ur_x - ll_x - 2*amount, amount-ish, drawtype);
ctx->gdraw->fill_rect( w, ll_x + amount, ur_y - amount, ur_x - ll_x - 2*amount, amount-ish, drawtype);
ctx->gdraw->fill_arc( w, ll_x+ish, ll_y+ish, 2*amount-2*ish, 2*amount-2*ish, 90, 90,
fillcolor, 0);
drawtype, 0);
ctx->gdraw->fill_arc( w, ll_x+ish, ur_y - 2*amount+ish, 2*amount-2*ish, 2*amount-2*ish, 180, 90,
fillcolor, 0);
drawtype, 0);
ctx->gdraw->fill_arc( w, ur_x - 2*amount+ish, ur_y - 2*amount+ish, 2*amount-2*ish, 2*amount-2*ish, 270, 90,
fillcolor, 0);
drawtype, 0);
ctx->gdraw->fill_arc( w, ur_x - 2*amount+ish, ll_y+ish, 2*amount-2*ish, 2*amount-2*ish, 0, 90,
fillcolor, 0);
drawtype, 0);
}
else {
ctx->gdraw->fill_rect( w, ll_x+amount, ll_y + amount, ur_x - ll_x-2*amount, ur_y - ll_y - 2*amount, fillcolor);
ctx->gdraw->fill_rect( w, ll_x+amount, ll_y + amount, ur_x - ll_x-2*amount, ur_y - ll_y - 2*amount, drawtype);
}
}
else {
......@@ -813,12 +837,12 @@ void GrowRectRounded::draw( GlowWind *w, GlowTransform *t, int highlight, int ho
rotation = trf.rot();
if ( gradient_contrast >= 0) {
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6), 0);
f2 = GlowColor::shift_drawtype( fillcolor, -gradient_contrast/2 + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, int(float(gradient_contrast)/2+0.6) + chot, 0);
}
else {
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6), 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2, 0);
f2 = GlowColor::shift_drawtype( fillcolor, -int(float(gradient_contrast)/2-0.6) + chot, 0);
f1 = GlowColor::shift_drawtype( fillcolor, gradient_contrast/2 + chot, 0);
}
ctx->gdraw->gradient_fill_rectrounded( w, ll_x + ish, ll_y + ish, ur_x - ll_x - 2 * ish, ur_y - ll_y - 2 * ish,
amount - ish, fillcolor, f1, f2, ctx->gdraw->gradient_rotate( rotation, grad));
......@@ -854,6 +878,10 @@ void GrowRectRounded::erase( GlowWind *w, GlowTransform *t, int hot, void *node)
return;
hot = 0;
}
if ( hot && ctx->environment != glow_eEnv_Development &&
ctx->hot_indication != glow_eHotIndication_LineWidth)
hot = 0;
int idx;
if ( fix_line_width) {
idx = line_width;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment