Make buttons prettier
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 17 Jun 2013 11:07:46 +0000 (13:07 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 17 Jun 2013 11:07:46 +0000 (13:07 +0200)
* eww.el (eww-button): New face.
(eww-convert-widgets): Use it to make submit buttons more button-like.

lisp/ChangeLog
lisp/eww.el

index 7789881..749e239 100644 (file)
@@ -1,5 +1,8 @@
 2013-06-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * eww.el (eww-button): New face.
+       (eww-convert-widgets): Use it to make submit buttons more button-like.
+
        * mm-decode.el (mm-convert-shr-links): Override the shr local map, so
        that Gnus commands work.
 
index fc0e413..3383b5f 100644 (file)
   :group 'eww
   :type 'string)
 
+(defface eww-button
+  '((((type x w32 ns) (class color))   ; Like default mode line
+     :box (:line-width 2 :style released-button)
+     :background "lightgrey" :foreground "black"))
+  "Face for eww buffer buttons."
+  :version "24.4"
+  :group 'eww)
+
 (defvar eww-current-url nil)
 (defvar eww-current-title ""
   "Title of current page.")
     (nconc eww-form (list widget))
     (unless (eq (car widget) 'hidden)
       (apply 'widget-create widget)
-      (put-text-property start (point) 'eww-widget widget))))
+      (put-text-property start (point) 'eww-widget widget)
+      (insert " "))))
 
 (defun eww-tag-textarea (cont)
   (let* ((start (point))
        (delete-region start end))
       (when (and widget
                 (not (eq (car widget) 'hidden)))
-       (apply 'widget-create widget)))
+       (apply 'widget-create widget)
+       (when (eq (car widget) 'push-button)
+         (add-face-text-property start (point) 'eww-button t))))
     (widget-setup)
     (eww-fix-widget-keymap)))