emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ef-themes 3e3c54b3e4 1/4: Add ef-themes-variable-pitch-


From: ELPA Syncer
Subject: [elpa] externals/ef-themes 3e3c54b3e4 1/4: Add ef-themes-variable-pitch-ui user option
Date: Mon, 22 Aug 2022 01:57:33 -0400 (EDT)

branch: externals/ef-themes
commit 3e3c54b3e4d6f45e6babde8ff976dd27520a59df
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add ef-themes-variable-pitch-ui user option
    
    This is the same idea as with commit 9272473, though here it is even
    more clear that it falls within the remit of the theme to control those
    elements.
---
 README.org   | 26 ++++++++++++++++++++++++++
 ef-themes.el | 34 +++++++++++++++++++++++++++++-----
 2 files changed, 55 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 9111a9ca4f..1b80670a72 100644
--- a/README.org
+++ b/README.org
@@ -238,6 +238,32 @@ To get consistent typography, the user may need to edit 
the font family
 of the ~fixed-pitch~ face.  The =fontaine= package on GNU ELPA (by
 Protesilaos) can be helpful in that regard.
 
+** UI typeface
+:PROPERTIES:
+:CUSTOM_ID: h:7c3d1057-c4a7-43b3-b91b-9887264d4072
+:END:
+
+[ Part of {{{development-version}}} ]
+
+#+vindex: ef-themes-variable-pitch-ui
+The user option ~ef-themes-variable-pitch-ui~ controls whether the
+elements of the User Interface (UI) use a proportionately spaced font.
+By default (a nil value), all UI elements use the default font family.
+When this user option is set to a non-nil value, all UI elements will
+inherit the face ~variable-pitch~ instead thus rendering them in a
+proportionately spaced font.
+
+In this context, the UI elements are:
+
+- ~header-line~
+- ~mode-line~ (active and inactive)
+- ~tab-bar-mode~
+- ~tab-line-mode~
+
+To get consistent typography, the user may need to edit the font family
+of the ~variable-pitch~ face.  The =fontaine= package on GNU ELPA (by
+Protesilaos) can be helpful in that regard.
+
 ** Option for headings
 :PROPERTIES:
 :CUSTOM_ID: h:a7a02817-e324-43e9-a7d8-fde024530af6
diff --git a/ef-themes.el b/ef-themes.el
index edfb91e1a9..cffe20dc73 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -226,6 +226,19 @@ Protesilaos))."
   :type 'boolean
   :link '(info-link "(ef-themes) Enable mixed fonts"))
 
+(defcustom ef-themes-variable-pitch-ui nil
+  "Use proportional fonts (`variable-pitch') in UI elements.
+This includes the mode line, header line, tab bar, and tab line.
+
+Users may need to explicitly configure the font family of
+`variable-pitch' in order to get a consistent experience with
+their typography (also check the `fontaine' package on GNU
+ELPA (by Protesilaos))."
+  :group 'ef-themes
+  :package-version '(ef-themes . "0.4.0")
+  :type 'boolean
+  :link '(info-link "(ef-themes) UI typeface"))
+
 ;;; Helpers for user options
 
 (defun ef-themes--fixed-pitch ()
@@ -233,6 +246,11 @@ Protesilaos))."
   (when ef-themes-mixed-fonts
     (list :inherit 'fixed-pitch)))
 
+(defun ef-themes--variable-pitch-ui ()
+  "Conditional application of `variable-pitch' in the UI."
+  (when ef-themes-variable-pitch-ui
+    (list :inherit 'variable-pitch)))
+
 (defun ef-themes--key-cdr (key alist)
   "Get cdr of KEY in ALIST."
   (cdr (assoc key alist)))
@@ -482,6 +500,11 @@ Helper function for `ef-themes-preview-colors'."
   :package-version '(ef-themes . "0.4.0")
   :group 'ef-themes-faces)
 
+(defface ef-themes-ui-variable-pitch nil
+  "Face for `variable-pitch' if `ef-themes-variable-pitch-ui' is non-nil."
+  :package-version '(ef-themes . "0.4.0")
+  :group 'ef-themes-faces)
+
 (defconst ef-themes-faces
   '(
 ;;;; internal faces
@@ -496,6 +519,7 @@ Helper function for `ef-themes-preview-colors'."
     `(ef-themes-heading-7 ((,c ,@(ef-themes--heading 7) :foreground 
,rainbow-7)))
     `(ef-themes-heading-8 ((,c ,@(ef-themes--heading 8) :foreground 
,rainbow-8)))
     `(ef-themes-key-binding ((,c :inherit (bold ef-themes-fixed-pitch) 
:foreground ,keybind)))
+    `(ef-themes-ui-variable-pitch ((,c ,@(ef-themes--variable-pitch-ui))))
 ;;;; all basic faces
     `(default ((,c :background ,bg-main :foreground ,fg-main)))
     `(cursor ((,c :background ,cursor)))
@@ -509,7 +533,7 @@ Helper function for `ef-themes-preview-colors'."
     `(success ((,c :inherit bold :foreground ,info)))
     `(warning ((,c :inherit bold :foreground ,warning)))
     `(fringe ((,c :background unspecified)))
-    `(header-line ((,c :background ,bg-dim)))
+    `(header-line ((,c :inherit ef-themes-ui-variable-pitch :background 
,bg-dim)))
     `(header-line-highlight ((,c :inherit highlight)))
     `(help-argument-name ((,c :foreground ,accent-0)))
     `(help-key-binding ((,c :inherit bold :foreground ,keybind)))
@@ -1030,12 +1054,12 @@ Helper function for `ef-themes-preview-colors'."
     `(message-mml ((,c :foreground ,info)))
     `(message-separator ((,c :background ,bg-alt)))
 ;;;; mode-line
-    `(mode-line ((,c :background ,bg-mode-line :foreground ,fg-mode-line)))
+    `(mode-line ((,c :inherit ef-themes-ui-variable-pitch :background 
,bg-mode-line :foreground ,fg-mode-line)))
     `(mode-line-active ((,c :inherit mode-line)))
     `(mode-line-buffer-id ((,c :inherit bold)))
     `(mode-line-emphasis ((,c :inherit bold-italic)))
     `(mode-line-highlight ((,c :inherit highlight)))
-    `(mode-line-inactive ((,c :background ,bg-alt :foreground ,fg-dim)))
+    `(mode-line-inactive ((,c :inherit ef-themes-ui-variable-pitch :background 
,bg-alt :foreground ,fg-dim)))
 ;;;; mu4e
     `(mu4e-attach-number-face ((,c :inherit bold :foreground ,fg-dim)))
     `(mu4e-cited-1-face ((,c :inherit message-cited-text-1)))
@@ -1305,13 +1329,13 @@ Helper function for `ef-themes-preview-colors'."
     `(smerge-refined-removed ((,c :inherit diff-refine-removed)))
     `(smerge-upper ((,c :inherit diff-removed)))
 ;;;; tab-bar-mode
-    `(tab-bar ((,c :background ,bg-alt)))
+    `(tab-bar ((,c :inherit ef-themes-ui-variable-pitch :background ,bg-alt)))
     `(tab-bar-tab-group-current ((,c :inherit bold :background ,bg-main :box 
(:line-width (2 . -2) :style flat-button) :foreground ,fg-alt)))
     `(tab-bar-tab-group-inactive ((,c :background ,bg-alt :box (:line-width (2 
. -2) :style flat-button) :foreground ,fg-alt)))
     `(tab-bar-tab ((,c :inherit bold :box (:line-width (2 . -2) :style 
flat-button) :background ,bg-main :foreground ,fg-main)))
     `(tab-bar-tab-inactive ((,c :box (:line-width (2 . -2) :style flat-button) 
:background ,bg-dim :foreground ,fg-dim)))
 ;;;; tab-line-mode
-    `(tab-line ((,c :background ,bg-alt :height 0.95)))
+    `(tab-line ((,c :inherit ef-themes-ui-variable-pitch :background ,bg-alt 
:height 0.95)))
     `(tab-line-close-highlight ((,c :foreground ,red)))
     `(tab-line-highlight ((,c :inherit highlight)))
     `(tab-line-tab (( )))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]