muffinmad / emacs-mini-frame

Show minibuffer in child frame on read-from-minibuffer
GNU General Public License v3.0
314 stars 20 forks source link

[PATCH] Make border-color work for both child and standalone frames #47

Closed abcdw closed 3 years ago

abcdw commented 3 years ago
From 49942487593ed9aa7cf7a1f206bd2aa31db32963 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@trop.in>
Date: Sat, 26 Jun 2021 12:58:12 +0300
Subject: [PATCH] Make border-color work for both child and standalone frames

---
Be aware, it is a breaking change, but I think it's reasonable to
rename the variable.  Also, it seems ok to set both faces
unconditionally because it affects only mini-frame's frame.

 mini-frame.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mini-frame.el b/mini-frame.el
index f608b8e..67dc119 100644
--- a/mini-frame.el
+++ b/mini-frame.el
@@ -102,7 +102,7 @@ to determine background color of mini frame."
 Called if `mini-frame-show-parameters' doesn't specify background color."
   :type 'function)

-(defcustom mini-frame-internal-border-color nil
+(defcustom mini-frame-border-color nil
   "When set, set the internal border color of mini-frames to this color."
   :type '(choice (const :tag "Not set" nil)
                  (color :tag "Color")
@@ -273,8 +273,9 @@ This function used as value for `resize-mini-frames' variable."
                                      (drag-internal-border . t)
                                      (z-group . above))))))
     (set-face-background 'fringe nil frame)
-    (when mini-frame-internal-border-color
-      (set-face-background 'internal-border mini-frame-internal-border-color frame))
+    (when mini-frame-border-color
+      (set-face-background 'child-frame-border mini-frame-border-color frame)
+      (set-face-background 'internal-border mini-frame-border-color frame))
     frame))

 (defun mini-frame--move-frame-to-frame (frame to-frame)
-- 
2.32.0
muffinmad commented 3 years ago

Thanks for the patch!

I'll keep the variable name for now.

abcdw commented 3 years ago

Thanks for the patch!

You are welcome)