diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-02-28 11:41:52 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-02-28 11:41:52 +0100 |
commit | cd32693151dbce3e70288a8c7ecc84e0c00f20aa (patch) | |
tree | 739a0e44efe339f93c8523dea20fefc21078de98 /src/xfaces.c | |
parent | 15a76160bba87da9cef11c017d90c4e94f37d817 (diff) | |
download | emacs-cd32693151dbce3e70288a8c7ecc84e0c00f20aa.tar.gz emacs-cd32693151dbce3e70288a8c7ecc84e0c00f20aa.tar.bz2 emacs-cd32693151dbce3e70288a8c7ecc84e0c00f20aa.zip |
Fix :color specification in flat-button boxes
* src/xfaces.c (realize_gui_face): Allow reliably specifying
:color in flat-button boxes (bug#54196).
Diffstat (limited to 'src/xfaces.c')
-rw-r--r-- | src/xfaces.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; } } } |