Optionally make generic widget buttons boxy

This concerns the 'modus-themes-box-buttons' user option.  By default,
it will not affect the faces of the widget library.  Those are used, for
example, in the Notmuch "hello" buffer.

Adding the 'all-buttons' property to the aforementioned user option will
make those generic faces use the same style as the Custom UI and
related.

Thanks to Daniel Mendler, Rudolf Adamkovič, and Tony Zorman for their
feedback in issue 296:
<https://gitlab.com/protesilaos/modus-themes/-/issues/296>.
This commit is contained in:
Protesilaos Stavrou 2022-03-23 09:45:27 +02:00
parent c38465d25d
commit 2367a9c091
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA
3 changed files with 145 additions and 108 deletions

View file

@ -1054,6 +1054,7 @@ symbols:
ultrabold
• A floating point as a height multiple of the default or a cons cell
in the form of (height . FLOAT) [ tweaked as part of 2.3.0-dev ]
all-buttons [ part of 2.3.0-dev ]
The default (a nil value or an empty list) is a gray background
combined with a pseudo three-dimensional effect.
@ -1089,6 +1090,11 @@ stated. Instead of a floating point, an acceptable value can be in the
form of a cons cell like (height . FLOAT) or (height FLOAT), where
FLOAT is the given number.
The all-buttons property extends the box button effect (or the
aforementioned properties) to the faces of the generic widget library.
By default, those do not look like the buttons of the Custom UI as they
are ordinary text wrapped in square brackets.
Combinations of any of those properties are expressed as a list, like
in these examples:
@ -5681,11 +5687,12 @@ Ideas and user feedback
Rudakov, Ryan Phillips, Rytis Paškauskas, Rudolf Adamkovič, Sam
Kleinman, Samuel Culpepper, Saša Janiška, Shreyas Ragavan, Simon
Pugnet, Tassilo Horn, Thibaut Verron, Thomas Heartman, Togan
Muftuoglu, Trey Merkley, Tomasz Hołubowicz, Toon Claes, Uri Sharf,
Utkarsh Singh, Vincent Foley. As well as users: Ben,
CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, Fredrik, Moesasji,
Nick, TheBlob42, Trey, bepolymathe, bit9tream, derek-upham, doolio,
fleimgruber, gitrj95, iSeeU, jixiuf, okamsn, pRot0ta1p.
Muftuoglu, Tony Zorman, Trey Merkley, Tomasz Hołubowicz, Toon
Claes, Uri Sharf, Utkarsh Singh, Vincent Foley. As well as users:
Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, Fredrik,
Moesasji, Nick, TheBlob42, Trey, bepolymathe, bit9tream,
derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, okamsn,
pRot0ta1p.
Packaging
Basil L. Contovounesios, Eli Zaretskii, Glenn Morris, Mauro Aranda,
@ -6428,96 +6435,96 @@ Node: Syntax styles34160
Node: Mixed fonts36292
Node: Link styles37556
Node: Box buttons40030
Node: Command prompts43073
Node: Mode line44894
Node: Tab style50463
Node: Completion UIs51126
Node: Mail citations55007
Node: Fringes56153
Node: Language checkers56893
Node: Line highlighting59335
Node: Line numbers60932
Node: Mouse hover effects62013
Node: Markup62654
Node: Matching parentheses64254
Node: Active region65631
Node: Diffs67044
Node: Org mode blocks68695
Node: Org agenda71085
Node: Heading styles79938
Node: UI typeface84737
Node: Advanced customization85636
Node: More accurate colors in terminal emulators87307
Node: Range of color with terminal emulators88548
Node: Visualize the active Modus theme's palette91253
Node: Per-theme customization settings92249
Node: Case-by-case face specs using the themes' palette93605
Node: Face specs at scale using the themes' palette98153
Node: Remap face with local value102954
Node: Cycle through arbitrary colors105379
Node: Override colors111807
Node: Override color saturation117045
Node: Override colors through blending122726
Node: Font configurations for Org and others125583
Ref: Font configurations for Org and others-Footnote-1128399
Node: Configure bold and italic faces128586
Node: Custom Org todo keyword and priority faces132734
Node: Custom Org emphasis faces136407
Node: Update Org block delimiter fontification141208
Node: Measure color contrast143125
Node: Load theme depending on time of day145848
Node: Backdrop for pdf-tools146841
Node: Decrease mode line height149693
Node: Toggle themes without reloading them153815
Node: A theme-agnostic hook for theme loading155094
Node: Diffs with only the foreground157496
Node: Ediff without diff color-coding160610
Node: Near-monochrome syntax highlighting162749
Node: Face coverage171716
Node: Supported packages172168
Node: Indirectly covered packages178721
Node: Notes on individual packages179741
Node: Note on avy hints180834
Node: Note on calendarel weekday and weekend colors182002
Node: Note on underlines in compilation buffers183185
Node: Note on inline Latex in Org buffers184032
Node: Note on dimmerel184642
Node: Note on display-fill-column-indicator-mode186127
Node: Note on highlight-parenthesesel187121
Node: Note on mmm-modeel background colors193110
Node: Note for prism195425
Node: Note for god-mode198579
Node: Note on company-mode overlay pop-up200183
Ref: Note on company-mode overlay pop-up-Footnote-1200873
Ref: Note on company-mode overlay pop-up-Footnote-2200940
Node: Note on ERC escaped color sequences200995
Ref: Note on ERC escaped color sequences-Footnote-1202423
Node: Note on powerline or spaceline202533
Node: Note on SHR colors202947
Node: Note on SHR fonts203359
Node: Note on Ement colors and fonts203992
Node: Note on Helm grep205491
Node: Note on vc-annotate-background-mode206968
Node: Note on pdf-tools link hints207853
Node: Note on the Notmuch logo210318
Node: Frequently Asked Questions210816
Node: Is the contrast ratio about adjacent colors?211447
Node: What does it mean to avoid exaggerations?212954
Node: Why are colors mostly variants of blue magenta cyan?214783
Node: What is the best setup for legibility?219096
Node: Are these color schemes?221741
Node: Port the Modus themes to other platforms?225461
Node: Contributing228245
Node: Sources of the themes228642
Node: Issues you can help with229278
Node: Patches require copyright assignment to the FSF230478
Node: Acknowledgements232773
Node: Meta235919
Node: GNU Free Documentation License238398
Node: Indices263750
Node: Function index263929
Node: Variable index265452
Node: Concept index267739
Node: Command prompts43382
Node: Mode line45203
Node: Tab style50772
Node: Completion UIs51435
Node: Mail citations55316
Node: Fringes56462
Node: Language checkers57202
Node: Line highlighting59644
Node: Line numbers61241
Node: Mouse hover effects62322
Node: Markup62963
Node: Matching parentheses64563
Node: Active region65940
Node: Diffs67353
Node: Org mode blocks69004
Node: Org agenda71394
Node: Heading styles80247
Node: UI typeface85046
Node: Advanced customization85945
Node: More accurate colors in terminal emulators87616
Node: Range of color with terminal emulators88857
Node: Visualize the active Modus theme's palette91562
Node: Per-theme customization settings92558
Node: Case-by-case face specs using the themes' palette93914
Node: Face specs at scale using the themes' palette98462
Node: Remap face with local value103263
Node: Cycle through arbitrary colors105688
Node: Override colors112116
Node: Override color saturation117354
Node: Override colors through blending123035
Node: Font configurations for Org and others125892
Ref: Font configurations for Org and others-Footnote-1128708
Node: Configure bold and italic faces128895
Node: Custom Org todo keyword and priority faces133043
Node: Custom Org emphasis faces136716
Node: Update Org block delimiter fontification141517
Node: Measure color contrast143434
Node: Load theme depending on time of day146157
Node: Backdrop for pdf-tools147150
Node: Decrease mode line height150002
Node: Toggle themes without reloading them154124
Node: A theme-agnostic hook for theme loading155403
Node: Diffs with only the foreground157805
Node: Ediff without diff color-coding160919
Node: Near-monochrome syntax highlighting163058
Node: Face coverage172025
Node: Supported packages172477
Node: Indirectly covered packages179030
Node: Notes on individual packages180050
Node: Note on avy hints181143
Node: Note on calendarel weekday and weekend colors182311
Node: Note on underlines in compilation buffers183494
Node: Note on inline Latex in Org buffers184341
Node: Note on dimmerel184951
Node: Note on display-fill-column-indicator-mode186436
Node: Note on highlight-parenthesesel187430
Node: Note on mmm-modeel background colors193419
Node: Note for prism195734
Node: Note for god-mode198888
Node: Note on company-mode overlay pop-up200492
Ref: Note on company-mode overlay pop-up-Footnote-1201182
Ref: Note on company-mode overlay pop-up-Footnote-2201249
Node: Note on ERC escaped color sequences201304
Ref: Note on ERC escaped color sequences-Footnote-1202732
Node: Note on powerline or spaceline202842
Node: Note on SHR colors203256
Node: Note on SHR fonts203668
Node: Note on Ement colors and fonts204301
Node: Note on Helm grep205800
Node: Note on vc-annotate-background-mode207277
Node: Note on pdf-tools link hints208162
Node: Note on the Notmuch logo210627
Node: Frequently Asked Questions211125
Node: Is the contrast ratio about adjacent colors?211756
Node: What does it mean to avoid exaggerations?213263
Node: Why are colors mostly variants of blue magenta cyan?215092
Node: What is the best setup for legibility?219405
Node: Are these color schemes?222050
Node: Port the Modus themes to other platforms?225770
Node: Contributing228554
Node: Sources of the themes228951
Node: Issues you can help with229587
Node: Patches require copyright assignment to the FSF230787
Node: Acknowledgements233082
Node: Meta236246
Node: GNU Free Documentation License238725
Node: Indices264077
Node: Function index264256
Node: Variable index265779
Node: Concept index268066

End Tag Table

View file

@ -895,6 +895,7 @@ an empty list). The list can include any of the following symbols:
+ A floating point as a height multiple of the default or a cons cell in
the form of =(height . FLOAT)= [ tweaked as part of
{{{development-version}}} ]
+ ~all-buttons~ [ part of {{{development-version}}} ]
The default (a nil value or an empty list) is a gray background combined
with a pseudo three-dimensional effect.
@ -930,6 +931,11 @@ Instead of a floating point, an acceptable value can be in the form of a
cons cell like =(height . FLOAT)= or =(height FLOAT)=, where FLOAT is
the given number.
The ~all-buttons~ property extends the box button effect (or the
aforementioned properties) to the faces of the generic widget library.
By default, those do not look like the buttons of the Custom UI as they
are ordinary text wrapped in square brackets.
Combinations of any of those properties are expressed as a list,
like in these examples:
@ -5641,11 +5647,12 @@ The Modus themes are a collective effort. Every bit of work matters.
Pierre Téchoueyres, Robert Hepple, Roman Rudakov, Ryan Phillips, Rytis
Paškauskas, Rudolf Adamkovič, Sam Kleinman, Samuel Culpepper, Saša
Janiška, Shreyas Ragavan, Simon Pugnet, Tassilo Horn, Thibaut Verron,
Thomas Heartman, Togan Muftuoglu, Trey Merkley, Tomasz Hołubowicz,
Toon Claes, Uri Sharf, Utkarsh Singh, Vincent Foley. As well as
users: Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, Fredrik,
Moesasji, Nick, TheBlob42, Trey, bepolymathe, bit9tream, derek-upham,
doolio, fleimgruber, gitrj95, iSeeU, jixiuf, okamsn, pRot0ta1p.
Thomas Heartman, Togan Muftuoglu, Tony Zorman, Trey Merkley, Tomasz
Hołubowicz, Toon Claes, Uri Sharf, Utkarsh Singh, Vincent Foley. As
well as users: Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux,
Fredrik, Moesasji, Nick, TheBlob42, Trey, bepolymathe, bit9tream,
derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, okamsn,
pRot0ta1p.
+ Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, Glenn
Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core Emacs),

View file

@ -5,7 +5,7 @@
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; URL: https://gitlab.com/protesilaos/modus-themes
;; Version: 2.2.0
;; Last-Modified: <2022-03-23 08:40:57 +0200>
;; Last-Modified: <2022-03-23 09:42:38 +0200>
;; Package-Requires: ((emacs "27.1"))
;; Keywords: faces, theme, accessibility
@ -3072,6 +3072,11 @@ be explicitly stated. Instead of a floating point, an acceptable
value can be in the form of a cons cell like (height . FLOAT)
or (height FLOAT), where FLOAT is the given number.
The `all-buttons' property extends the box button effect (or the
aforementioned properties) to the faces of the generic widget
library. By default, those do not look like the buttons of the
Custom UI as they are ordinary text wrapped in square brackets.
Combinations of any of those properties are expressed as a list,
like in these examples:
@ -3095,6 +3100,7 @@ In user configuration files the form may look like this:
(const :tag "Reduce overall coloration" faint)
(const :tag "Proportionately spaced font (variable-pitch)" variable-pitch)
(const :tag "Underline instead of a box effect" underline)
(const :tag "Apply box button style to generic widget faces" all-buttons)
(choice :tag "Font weight (must be supported by the typeface)"
(const :tag "Thin" thin)
(const :tag "Ultra-light" ultralight)
@ -4060,7 +4066,12 @@ application of a variable-pitch font."
(defun modus-themes--button (bg bgfaint bgaccent bgaccentfaint border &optional pressed-button-p)
"Apply `modus-themes-box-buttons' styles.
Work in progress. BG BGFAINT BGACCENT BGACCENTFAINT BORDER PRESSED-BUTTON-P."
BG is the main background. BGFAINT is its subtle alternative.
BGACCENT is its accented variant and BGACCENTFAINT is the same
but less intense. BORDER is the color around the box.
When optional PRESSED-BUTTON-P is non-nil, the box uses the
pressed button style, else the released button."
(let* ((properties modus-themes-box-buttons)
(weight (modus-themes--weight properties)))
(list :inherit
@ -4615,8 +4626,12 @@ by virtue of calling either of `modus-themes-load-operandi' and
,@(modus-themes--link-color
magenta-alt-other magenta-alt-other-faint fg-alt))))
`(tooltip ((,class :background ,bg-special-cold :foreground ,fg-main)))
`(widget-button ((,class :inherit modus-themes-box-button)))
`(widget-button-pressed ((,class :inherit modus-themes-box-button-pressed)))
`(widget-button ((,class ,@(if (memq 'all-buttons modus-themes-box-buttons)
(list :inherit 'modus-themes-box-button)
(list :inherit 'bold :foreground blue-alt)))))
`(widget-button-pressed ((,class ,@(if (memq 'all-buttons modus-themes-box-buttons)
(list :inherit 'modus-themes-box-button-pressed)
(list :inherit 'bold :foreground magenta-alt)))))
`(widget-documentation ((,class :foreground ,green)))
`(widget-field ((,class :background ,bg-alt :foreground ,fg-main :extend nil)))
`(widget-inactive ((,class :inherit shadow :background ,bg-dim)))
@ -7684,11 +7699,19 @@ by virtue of calling either of `modus-themes-load-operandi' and
(360 . ,magenta-alt-other)))
`(vc-annotate-very-old-color nil)
;;;; wid-edit
`(widget-link-prefix " ")
`(widget-link-suffix " ")
`(widget-link-prefix ,(if (memq 'all-buttons modus-themes-box-buttons)
" "
"["))
`(widget-link-suffix ,(if (memq 'all-buttons modus-themes-box-buttons)
" "
"]"))
`(widget-mouse-face '(highlight widget-button))
`(widget-push-button-prefix " ")
`(widget-push-button-suffix " ")
`(widget-push-button-prefix ,(if (memq 'all-buttons modus-themes-box-buttons)
" "
"["))
`(widget-push-button-suffix ,(if (memq 'all-buttons modus-themes-box-buttons)
" "
"]"))
;;;; xterm-color
`(xterm-color-names ["black" ,red ,green ,yellow ,blue ,magenta ,cyan "gray65"])
`(xterm-color-names-bright ["gray35" ,red-alt ,green-alt ,yellow-alt ,blue-alt ,magenta-alt ,cyan-alt "white"])