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

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

[elpa] externals/modus-vivendi-theme 8336e5a 061/110: Refine 3D modeline


From: Stefan Monnier
Subject: [elpa] externals/modus-vivendi-theme 8336e5a 061/110: Refine 3D modeline conditionality and tweak looks
Date: Wed, 29 Apr 2020 21:40:07 -0400 (EDT)

branch: externals/modus-vivendi-theme
commit 8336e5a7762be14fb820fd10269c908b159c2f22
Author: Protesilaos Stavrou <address@hidden>
Commit: Protesilaos Stavrou <address@hidden>

    Refine 3D modeline conditionality and tweak looks
---
 modus-operandi-theme.el | 32 +++++++++++++++++++++++++-------
 modus-vivendi-theme.el  | 32 +++++++++++++++++++++++++-------
 2 files changed, 50 insertions(+), 14 deletions(-)

diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index e76a7ef..c2b15df 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -408,11 +408,24 @@ between foreground and background is >= 7:1)."
 
 ;; Helper functions that are meant to ease the implementation of the
 ;; above customisation options.
-(defun modus-operandi-theme-modeline (col3d col)
-  "Control the box colour of the mode line, either COL3D or COL."
+(defun modus-operandi-theme-modeline-box (col3d col &optional btn)
+  "Control the box properties of the mode line.
+COL3D is the border that is intended for the three-dimensional modeline.
+COL applies to the two-dimensional modeline.
+Optional BTN provides the 3d button style."
+  (let ((style (if btn 'released-button nil)))
+    (if modus-operandi-theme-3d-modeline
+        (list :line-width 1 :color col3d :style style)
+      (list :line-width 1 :color col :style nil))))
+
+(defun modus-operandi-theme-modeline-props (bg3d fg3d &optional bg fg)
+  "Control the background and foreground of the mode line.
+BG is the modeline's background.
+FG is the modeline's foreground.
+BG3D and FG3D apply to the three-dimensional modeline style."
   (if modus-operandi-theme-3d-modeline
-      (list :line-width 1 :color col3d :style 'released-button)
-    (list :line-width 1 :color col :style nil)))
+      (list :background bg3d :foreground fg3d)
+    (list :background bg :foreground fg)))
 
 (defun modus-operandi-theme-diffs (subtle-bg subtle-fg intense-bg intense-fg)
   "Colour combinations for `modus-operandi-theme-subtle-diffs'.
@@ -2180,12 +2193,17 @@ AMOUNT is a customisation option."
    `(message-mml ((,class (:foreground ,green-alt))))
    `(message-separator ((,class (:background ,bg-alt :foreground 
,fg-special-warm))))
    ;;;; modeline
-   `(mode-line ((,class (:box ,(modus-operandi-theme-modeline bg-inactive 
fg-inactive)
-                                 :background ,bg-active :foreground 
,fg-active))))
+   `(mode-line ((,class (:box ,(modus-operandi-theme-modeline-box bg-inactive 
fg-inactive t)
+                              ,@(modus-operandi-theme-modeline-props
+                                 bg-active fg-main
+                                 bg-active fg-active)))))
    `(mode-line-buffer-id ((,class (:weight bold))))
    `(mode-line-emphasis ((,class (:foreground ,blue-active :weight bold))))
    `(mode-line-highlight ((,class (:inherit modus-theme-active-blue :box 
(:line-width -1 :style pressed-button)))))
-   `(mode-line-inactive ((,class (:box (:color ,bg-active) :background 
,bg-inactive :foreground ,fg-inactive))))
+   `(mode-line-inactive ((,class (:box ,(modus-operandi-theme-modeline-box 
bg-active bg-active)
+                                       ,@(modus-operandi-theme-modeline-props
+                                          bg-dim fg-inactive
+                                          bg-inactive fg-inactive)))))
    ;;;; mood-line
    `(mood-line-modified ((,class (:foreground ,magenta-active))))
    `(mood-line-status-error ((,class (:foreground ,red-active :weight bold))))
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index 0a5031f..9c33aae 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -408,11 +408,24 @@ between foreground and background is >= 7:1)."
 
 ;; Helper functions that are meant to ease the implementation of the
 ;; above customisation options.
-(defun modus-vivendi-theme-modeline (col3d col)
-  "Control the box colour of the mode line, either COL3D or COL."
+(defun modus-vivendi-theme-modeline-box (col3d col &optional btn)
+  "Control the box properties of the mode line.
+COL3D is the border that is intended for the three-dimensional modeline.
+COL applies to the two-dimensional modeline.
+Optional BTN provides the 3d button style."
+  (let ((style (if btn 'released-button nil)))
+    (if modus-vivendi-theme-3d-modeline
+        (list :line-width 1 :color col3d :style style)
+      (list :line-width 1 :color col :style nil))))
+
+(defun modus-vivendi-theme-modeline-props (bg3d fg3d &optional bg fg)
+  "Control the background and foreground of the mode line.
+BG is the modeline's background.
+FG is the modeline's foreground.
+BG3D and FG3D apply to the three-dimensional modeline style."
   (if modus-vivendi-theme-3d-modeline
-      (list :line-width 1 :color col3d :style 'released-button)
-    (list :line-width 1 :color col :style nil)))
+      (list :background bg3d :foreground fg3d)
+    (list :background bg :foreground fg)))
 
 (defun modus-vivendi-theme-diffs (subtle-bg subtle-fg intense-bg intense-fg)
   "Colour combinations for `modus-vivendi-theme-subtle-diffs'.
@@ -2180,12 +2193,17 @@ AMOUNT is a customisation option."
    `(message-mml ((,class (:foreground ,green-alt))))
    `(message-separator ((,class (:background ,bg-alt :foreground 
,fg-special-warm))))
    ;;;; modeline
-   `(mode-line ((,class (:box ,(modus-vivendi-theme-modeline bg-inactive 
fg-inactive)
-                                 :background ,bg-active :foreground 
,fg-active))))
+   `(mode-line ((,class (:box ,(modus-vivendi-theme-modeline-box bg-inactive 
fg-inactive t)
+                              ,@(modus-vivendi-theme-modeline-props
+                                 bg-active fg-main
+                                 bg-active fg-active)))))
    `(mode-line-buffer-id ((,class (:weight bold))))
    `(mode-line-emphasis ((,class (:foreground ,blue-active :weight bold))))
    `(mode-line-highlight ((,class (:inherit modus-theme-active-blue :box 
(:line-width -1 :style pressed-button)))))
-   `(mode-line-inactive ((,class (:box (:color ,bg-active) :background 
,bg-inactive :foreground ,fg-inactive))))
+   `(mode-line-inactive ((,class (:box ,(modus-vivendi-theme-modeline-box 
bg-active bg-active)
+                                       ,@(modus-vivendi-theme-modeline-props
+                                          bg-dim fg-inactive
+                                          bg-inactive fg-inactive)))))
    ;;;; mood-line
    `(mood-line-modified ((,class (:foreground ,magenta-active))))
    `(mood-line-status-error ((,class (:foreground ,red-active :weight bold))))



reply via email to

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