diff --git a/xi/xi.c b/xi/xi.c index 067d07953..4cd306a2b 100755 --- a/xi/xi.c +++ b/xi/xi.c @@ -1162,6 +1162,9 @@ xi_draw_field_button( XI_OBJ * xi_obj ) XI_FIELD_DATA *fd; unsigned long attrib; STX_DATA *stxd; + const XinColor color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT); + const XinColor color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL); + const XinColor color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK); #if XIWS != XIWS_WM int x, @@ -1185,27 +1188,14 @@ xi_draw_field_button( XI_OBJ * xi_obj ) r.top++; r.left++; r.bottom--; - r.right--; + r.right--; if ( ( BOOLEAN ) xi_get_pref( XI_PREF_3D_LOOK ) ) - xi_draw_3d_rect( win, &r, fd->down, 2, stxd->hilight_color, - stxd->attrib & XI_ATR_ENABLED ? stxd->back_color : stxd->disabled_back_color, - stxd->shadow_color ); + xi_draw_3d_rect(win, &r, fd->down, 2, color_light, color_ctrl, color_dark); else { - if ((BOOLEAN)xi_get_pref(XI_PREF_3D_LOOK)) - { - const XinColor color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT); - const XinColor color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL); - const XinColor color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK); - - xi_draw_3d_rect(win, &r, fd->down, 2, color_light, color_ctrl, color_dark); - } - else - { - XinWindowBrushSet( win, &white_cbrush ); - XinWindowPenSet( win, &hollow_cpen ); - xi_draw_rect( win, &r ); - } + XinWindowBrushSet( win, &white_cbrush ); + XinWindowPenSet( win, &hollow_cpen ); + xi_draw_rect( win, &r ); } x = r.left + 3; y = r.top + 2; @@ -1220,16 +1210,15 @@ xi_draw_field_button( XI_OBJ * xi_obj ) else { int icon_rid; + XinColor color = ( BOOLEAN ) xi_get_pref( XI_PREF_3D_LOOK ) ? color_ctrl : xi_get_pref( XI_PREF_COLOR_CTRL ); icon_rid = fd->icon_rid; if ( icon_rid == 0 ) icon_rid = ( int ) xi_get_pref( XI_PREF_COMBO_ICON ); if ( fd->down ) - xi_draw_icon( win, x, y + 1, icon_rid, XI_COLOR_BLACK, - xi_get_pref( XI_PREF_COLOR_CTRL ) ); + xi_draw_icon( win, x, y + 1, icon_rid, XI_COLOR_BLACK, color ); else - xi_draw_icon( win, x, y, icon_rid, XI_COLOR_BLACK, - xi_get_pref( XI_PREF_COLOR_CTRL ) ); + xi_draw_icon( win, x, y, icon_rid, XI_COLOR_BLACK, color ); } xi_set_clip( win, NULL ); XinWindowPenSet( win, &black_cpen ); @@ -3475,10 +3464,8 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct, fontp = xi_obj->itf->v.itf->font; if ( fontp == NULL ) fontp = xi_get_system_font( ); - // color = ( XinColor ) xi_get_pref( XI_PREF_COLOR_CTRL ); - // XinWindowColorTextBackSet( win, color ); XinWindowColorTextBackSet( win, color_ctrl ); - XinWindowTextOpaqueSet( win, TRUE ); + XinWindowTextOpaqueSet( win, FALSE ); XinWindowFontMap( win, fontp ); XinFontMetricsGet( fontp, &leading, &ascent, &descent ); xi_draw_clipped_text( win, fontp, bd->text, &text_rect, &text_rect, attrib, FALSE, 0, -1, @@ -3521,7 +3508,7 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct, rct2 = r; xi_inflate_rect( &rct2, -3 ); - middle = ( rct2.top + rct2.bottom ) / 2; +/* middle = ( rct2.top + rct2.bottom ) / 2; font_height = ascent + descent + leading; font_top = middle - font_height / 2; rct2.top = middle - font_height / 2 - 3; @@ -3529,7 +3516,7 @@ xi_draw_button( XI_OBJ * xi_obj, XinRect * rct, if ( bline != -1 ) rct2.bottom = bline + descent + 2; rct2.top = max( rct2.top, r.top + 3 ); - rct2.bottom = min( rct2.bottom, r.bottom ); + rct2.bottom = min( rct2.bottom, r.bottom ); */ pen.width = 1; pen.fore_color = XI_COLOR_BLACK; pen.pattern = XinPenSolid; diff --git a/xi/xilm3.c b/xi/xilm3.c index 9f7cac032..cbc8266f0 100755 --- a/xi/xilm3.c +++ b/xi/xilm3.c @@ -1608,9 +1608,15 @@ TO OPTIMIZE BACKGROUND DRAWING, USE NEXT TWO LINES rct = column_data->prct; rct.top = ri->prct.top; rct.bottom = ri->prct.bottom; - if ( column_data->column_well || column_data->column_platform ) + if ( column_data->column_well || column_data->column_platform ) + { + const XinColor color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT); + const XinColor color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL); + const XinColor color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK); + xi_draw_3d_rect( win, &rct, ( BOOLEAN ) ( CELL_IS_SELECTED( lmp, row, col ) ? !column_data->column_well : - column_data->column_well ), 2, 0L, 0L, 0L ); + column_data->column_well ), 2, color_light, color_ctrl, color_dark ); + } } } #else