diff options
| author | Lars Ingebrigtsen | 2022-02-28 11:41:52 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-02-28 11:41:52 +0100 |
| commit | cd32693151dbce3e70288a8c7ecc84e0c00f20aa (patch) | |
| tree | 739a0e44efe339f93c8523dea20fefc21078de98 /src | |
| parent | 15a76160bba87da9cef11c017d90c4e94f37d817 (diff) | |
| download | emacs-cd32693151dbce3e70288a8c7ecc84e0c00f20aa.tar.gz 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')
| -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] | |||
| 5978 | } | 5978 | } |
| 5979 | else if (CONSP (box)) | 5979 | else if (CONSP (box)) |
| 5980 | { | 5980 | { |
| 5981 | bool set_color = false; | ||
| 5982 | |||
| 5981 | /* `(:width WIDTH :color COLOR :shadow SHADOW)'. SHADOW | 5983 | /* `(:width WIDTH :color COLOR :shadow SHADOW)'. SHADOW |
| 5982 | being one of `raised' or `sunken'. */ | 5984 | being one of `raised' or `sunken'. */ |
| 5983 | face->box = FACE_SIMPLE_BOX; | 5985 | face->box = FACE_SIMPLE_BOX; |
| @@ -6015,6 +6017,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] | |||
| 6015 | face->box_color = load_color (f, face, value, | 6017 | face->box_color = load_color (f, face, value, |
| 6016 | LFACE_BOX_INDEX); | 6018 | LFACE_BOX_INDEX); |
| 6017 | face->use_box_color_for_shadows_p = true; | 6019 | face->use_box_color_for_shadows_p = true; |
| 6020 | set_color = true; | ||
| 6018 | } | 6021 | } |
| 6019 | } | 6022 | } |
| 6020 | else if (EQ (keyword, QCstyle)) | 6023 | else if (EQ (keyword, QCstyle)) |
| @@ -6026,7 +6029,9 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] | |||
| 6026 | else if (EQ (value, Qflat_button)) | 6029 | else if (EQ (value, Qflat_button)) |
| 6027 | { | 6030 | { |
| 6028 | face->box = FACE_SIMPLE_BOX; | 6031 | face->box = FACE_SIMPLE_BOX; |
| 6029 | face->box_color = face->background; | 6032 | /* Don't override colors set in this box. */ |
| 6033 | if (!set_color) | ||
| 6034 | face->box_color = face->background; | ||
| 6030 | } | 6035 | } |
| 6031 | } | 6036 | } |
| 6032 | } | 6037 | } |