unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46528: 27.1.91; Backport flat-button from emacs28
@ 2021-02-15  7:16 Pedro Andres Aranda Gutierrez
  2021-02-15 15:20 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2021-02-15  7:16 UTC (permalink / raw)
  To: 46528


[-- Attachment #1.1: Type: text/plain, Size: 165 bytes --]

This patch is a backport of he flat-button style from emacs28
-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

[-- Attachment #1.2: Type: text/html, Size: 367 bytes --]

[-- Attachment #2: flat-button.diff --]
[-- Type: text/x-patch, Size: 2840 bytes --]

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index a49f08d..c7fcd10 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2469,15 +2469,16 @@ Face Attributes
 whose top and bottom parts occupy the space of the underlying text,
 thus avoiding any increase in the character height.
 
-The value @var{color} specifies the color to draw with.  The default is
-the foreground color of the face for simple boxes, and the background
-color of the face for 3D boxes.
-
 The value @var{style} specifies whether to draw a 3D box.  If it is
-@code{released-button}, the box looks like a 3D button that is not being
-pressed.  If it is @code{pressed-button}, the box looks like a 3D button
-that is being pressed.  If it is @code{nil} or omitted, a plain 2D box
-is used.
+@code{released-button}, the box looks like a 3D button that is not
+being pressed.  If it is @code{pressed-button}, the box looks like a
+3D button that is being pressed.  If it is @code{nil},
+@code{flat-button} or omitted, a plain 2D box is used.
+
+The value @var{color} specifies the color to draw with.  The default
+is the background color of the face for 3D boxes and
+@code{flat-button}, and the foreground color of the face for other
+boxes.
 @end table
 
 @item :inverse-video
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 5a1ffda..53ecd35 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 "Flat"   flat-button)
 			   (const :tag "None" nil))))
      ;; filter to make value suitable for customize
      (lambda (real-value)
diff --git a/src/xfaces.c b/src/xfaces.c
index 9d4b4ce..fb74007 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3170,7 +3170,8 @@ 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, Qflat_button))
 		    break;
 		}
 	      else
@@ -5882,6 +5883,10 @@ 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, Qflat_button)) {
+		face->box = FACE_SIMPLE_BOX;
+		face->box_color = face->background;
+	      }
 	    }
 	}
     }
@@ -6768,6 +6773,7 @@ syms_of_xfaces (void)
   DEFSYM (Qwave, "wave");
   DEFSYM (Qreleased_button, "released-button");
   DEFSYM (Qpressed_button, "pressed-button");
+  DEFSYM (Qflat_button, "flat-button");
   DEFSYM (Qnormal, "normal");
   DEFSYM (Qextra_light, "extra-light");
   DEFSYM (Qlight, "light");

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-04  9:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15  7:16 bug#46528: 27.1.91; Backport flat-button from emacs28 Pedro Andres Aranda Gutierrez
2021-02-15 15:20 ` Eli Zaretskii
     [not found]   ` <CAO48Bk-uxw6J-owp_m=3gpsPgNAgKwjD2453bQ1WjVuXq7KSTQ@mail.gmail.com>
2021-02-15 17:01     ` Eli Zaretskii
2021-04-04  0:45       ` Stefan Kangas
2021-04-04  5:06         ` Pedro Andres Aranda Gutierrez
2021-04-04  7:23         ` Eli Zaretskii
2021-04-04  9:05           ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).