From cd32693151dbce3e70288a8c7ecc84e0c00f20aa Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 28 Feb 2022 11:41:52 +0100 Subject: [PATCH] Fix :color specification in flat-button boxes * src/xfaces.c (realize_gui_face): Allow reliably specifying :color in flat-button boxes (bug#54196). --- src/xfaces.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xfaces.c b/src/xfaces.c index 55a9bed8f22..8100bdb1570 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5978,6 +5978,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] } else if (CONSP (box)) { + bool set_color = false; + /* `(:width WIDTH :color COLOR :shadow SHADOW)'. SHADOW being one of `raised' or `sunken'. */ face->box = FACE_SIMPLE_BOX; @@ -6015,6 +6017,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->box_color = load_color (f, face, value, LFACE_BOX_INDEX); face->use_box_color_for_shadows_p = true; + set_color = true; } } else if (EQ (keyword, QCstyle)) @@ -6026,7 +6029,9 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] else if (EQ (value, Qflat_button)) { face->box = FACE_SIMPLE_BOX; - face->box_color = face->background; + /* Don't override colors set in this box. */ + if (!set_color) + face->box_color = face->background; } } } -- 2.39.5