Open tefkah opened 3 years ago
Thanks! Do you know if it is possible to darken the header line as well in solaire mode?
Yes, I've been trying to implement it, but it's been rather difficult due to the way the faces in nano-modeline
are implemented. Solaire-mode works by remapping the header-line
face for certain buffers, but none of the nano-modeline faces inherit from that face. Additionally, header-line
is set to be blank by default, but even after changing this it does not work.
I found a way to make it work, but it's extremely cumbersome:
header-line
face to the current colors (nano-face-subtle
as background)nano-modeline
, change all the 'face 'nano-header-default
definitions to
`face '(:background (face-background `header-line)
:foreground (face-foreground `nano-face-header-default)
:weight (face-attribute`nano-face-header-default :weight))
You cannot simply inherit from nano-face-header-default
and just set the background differently, for some reason that does not work.
There's probably a slightly nicer way to do this, but that does not change the nature of it.
The best way would probably be to rewrite nano-headline
to use header-line
more directly, or to use something else than the strings of concat (propertize)
it's has now, but that would be a rather big rewrite, plus kind of against the spirit of nano
by not just using the 6 faces.
From commit [c43b36](https://github.com/rougier/nano-emacs/pull/78/commits/c4d3b46be3c04af217f2f5debe1ab50ef05552c50 the modeline now updates properly, but it did include changing the modeline function somewhat, but luckily less than I'd feared.
Ideally we would set some new colors for the header-line background and foreground face, the current implementation works alright, but it'd be better to lighten the text in the light-theme somewhat, and darken it in the dark-theme. There's probably some clever function you can write for that, but I don't currently know how to, very happy to hear your suggestions!
Light
Dark
Wonderful! I'm not sure we can modify the text color without adding a new specific face and I would prefer to avoid that for such a specific case. I think your PR is ready to be merged for me. If you're happy with it, I'll merge.
I'm happy enough with it, you can merge it!
This PR adds the minimum to work with solaire-mode, which darkens non-file-visiting buffers. The values are picked somewhat arbitrarily, but they look nice I think. Should not conflict with non-solaire-mode users.
Dark![image](https://user-images.githubusercontent.com/21983833/119869303-97600880-bf0f-11eb-99eb-658e13237964.png)
Light![image](https://user-images.githubusercontent.com/21983833/119869456-c9716a80-bf0f-11eb-9c3a-c55ec98a26cc.png)