diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 199a76e5cc..5e30590c6f 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -175,6 +175,7 @@ custom-face-attributes (choice :tag "Style" (const :tag "Raised" released-button) (const :tag "Sunken" pressed-button) + (const :tag "Modern" modern-button) (const :tag "None" nil)))) ;; filter to make value suitable for customize (lambda (real-value) diff --git a/src/dispextern.h b/src/dispextern.h index da51772b37..d23551c0b7 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1628,7 +1628,11 @@ #define FONT_TOO_HIGH(ft) \ /* Boxes with 3D shadows. Color equals the background color of the face. Width is specified. */ FACE_RAISED_BOX, - FACE_SUNKEN_BOX + FACE_SUNKEN_BOX, + + /* 'Modern box: like simple box, + but using the *back*ground colour of the face */ + FACE_MODERN_BOX }; /* Underline type. */ @@ -1709,8 +1713,11 @@ #define FONT_TOO_HIGH(ft) \ around text in this face. A value of FACE_SIMPLE_BOX means a box of width box_line_width is drawn in color box_color. A value of FACE_RAISED_BOX or FACE_SUNKEN_BOX means a 3D box is drawn with - shadow colors derived from the background color of the face. */ - ENUM_BF (face_box_type) box : 2; + shadow colors derived from the background color of the face. + A value of FACE_MODERN_BOX will create a FACE_SIMPLE_BOX drawn + with the background colour of the face. + */ + ENUM_BF (face_box_type) box : 3; /* Style of underlining. */ ENUM_BF (face_underline_type) underline : 2; diff --git a/src/xfaces.c b/src/xfaces.c index 73a536b19c..4b5289f65f 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3293,7 +3293,7 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (k, QCstyle)) { - if (!EQ (v, Qpressed_button) && !EQ (v, Qreleased_button)) + if (!EQ (v, Qpressed_button) && !EQ (v, Qreleased_button) && !EQ(v, Qmodern_button)) break; } else @@ -6031,6 +6031,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->box = FACE_RAISED_BOX; else if (EQ (value, Qpressed_button)) face->box = FACE_SUNKEN_BOX; + else if (EQ (value, Qmodern_button)) + face->box = FACE_MODERN_BOX; } } } @@ -6919,6 +6921,7 @@ syms_of_xfaces (void) DEFSYM (Qwave, "wave"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); + DEFSYM (Qmodern_button, "modern-button"); DEFSYM (Qnormal, "normal"); DEFSYM (Qextra_light, "extra-light"); DEFSYM (Qlight, "light"); diff --git a/src/xterm.c b/src/xterm.c index 0d2452de92..10580fa003 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3005,16 +3005,26 @@ x_draw_glyph_string_box (struct glyph_string *s) get_glyph_string_clip_rect (s, &clip_rect); - if (s->face->box == FACE_SIMPLE_BOX) - x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, hwidth, - vwidth, left_p, right_p, &clip_rect); - else - { + switch(s->face->box) { + case FACE_SIMPLE_BOX: + x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, hwidth, + vwidth, left_p, right_p, &clip_rect); + break; + case FACE_MODERN_BOX: + { + unsigned long store_color = s->face->box_color; + s->face->box_color = s->face->background; + x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, hwidth, + vwidth, left_p, right_p, &clip_rect); + s->face->box_color = store_color; + } + break; + default: x_setup_relief_colors (s); x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, hwidth, vwidth, raised_p, true, true, left_p, right_p, &clip_rect); - } + } }