linuxmint / mint-themes

Mint-X, Mint-Y..
207 stars 118 forks source link

Adapt nemo desktop item text shadow for brighter wallpapers #466

Open anaximeno opened 8 months ago

anaximeno commented 8 months ago
Before After
01_prev 01_after
02_prev 02_after
03_prev 03_after

It improves the readability of the text of the items a bit when using brighter wallpaper images.

Adapted from @moloch1994's suggestion on https://github.com/orgs/linuxmint/discussions/296

TODO

moloch1994 commented 8 months ago

Thanks for creating this, I don't know how to do these myself and have been too busy lately to figure it out

mtwebster commented 7 months ago

You can't change the .css files, you need to modify the SASS files instead in its own 'language':

https://github.com/linuxmint/mint-themes/tree/master/src/Mint-Y/gtk-3.0/sass

Then regenerate the .css files by running parse-sass.sh (in the .css folder).

We had a look at using multiple shadows to improve contrast years ago but it unexpectedly started eating up CPU if we applied more than one. Probably they've fixed it, but it's something to check also.

moloch1994 commented 7 months ago

You can't change the .css files, you need to modify the SASS files instead in its own 'language':

Why can't you though? I've changed (or rather created) mine and have been doing so for more than 3 years now on various installs of various versions of Mint. I've never run into any issues relating to it and it had no effect on my CPU.

Maybe I'm misunderstanding something here, as I'm not a techy person, but this really doesn't seem like a complicated issue to me. Correct me if I'm wrong. Frankly, I don't even get why this is in "mint-themes", as this gtk.css file is outside of the themes folder, and changes to it work across all themes.

mtwebster commented 7 months ago

Because the gtk.css and gtk-dark.css files are overwritten during an actual build of this package, reverting all changes made in this PR.

I don't understand what you mean about why this is in mint-themes. These are indeed part of these themes. Maybe you're just throwing the modified files into ~/.config/gtk-3.0, I don't know.

anaximeno commented 7 months ago

You can't change the .css files, you need to modify the SASS files instead in its own 'language':

https://github.com/linuxmint/mint-themes/tree/master/src/Mint-Y/gtk-3.0/sass

Then regenerate the .css files by running parse-sass.sh (in the .css folder).

We had a look at using multiple shadows to improve contrast years ago but it unexpectedly started eating up CPU if we applied more than one. Probably they've fixed it, but it's something to check also.

Ok, sure, I'll check that.

anaximeno commented 7 months ago

You can't change the .css files, you need to modify the SASS files instead in its own 'language':

Why can't you though? I've changed (or rather created) mine and have been doing so for more than 3 years now on various installs of various versions of Mint. I've never run into any issues relating to it and it had no effect on my CPU.

Maybe I'm misunderstanding something here, as I'm not a techy person, but this really doesn't seem like a complicated issue to me. Correct me if I'm wrong. Frankly, I don't even get why this is in "mint-themes", as this gtk.css file is outside of the themes folder, and changes to it work across all themes.

It's better to implement this here because this way this change will be dependent on the theme selected by the user (currently Mint-Y), so if for example, another person wants to create a theme with a different kind of shadow effect (or even not using it) their change won't be overridden by the theme at ~/.config/gtk3.0 (if this was put there), I believe.

moloch1994 commented 7 months ago

Because the gtk.css and gtk-dark.css files are overwritten during an actual build of this package, reverting all changes made in this PR.

Ah, I see.

I don't understand what you mean about why this is in mint-themes. These are indeed part of these themes. Maybe you're just throwing the modified files into ~/.config/gtk-3.0, I don't know.

Yes, that's precisely what I was doing and was my original suggestion. I didn't know they could placed into a theme folder.

moloch1994 commented 7 months ago

It's better to implement this here because this way this change will be dependent on the theme selected by the user (currently Mint-Y), so if for example, another person wants to create a theme with a different kind of shadow effect (or even not using it) their change won't be overridden by the theme at ~/.config/gtk3.0 (if this was put there), I believe.

That does make sense, but in reality I've tried out numerous themes and have never seen anyone modifying this part. As I pointed out in my previous comment, up until now I didn't even know these things could be changed within the theme files. So, while I understand your reasoning, I think in practice anyone using custom themes will end up without these shadows.

anaximeno commented 7 months ago

That does make sense, but in reality I've tried out numerous themes and have never seen anyone modifying this part. As I pointed out in my previous comment, up until now I didn't even know these things could be changed within the theme files. So, while I understand your reasoning, I think in practice anyone using custom themes will end up without these shadows.

That should be the responsibility of the person who creates the custom theme to make it best suitable for the user, and as I said it could be a design decision of the theme developer not to use the shadow (or using a different shadow effect), enforcing this would just make that more difficult, but I'll let to the Mint team to decide on that.

anaximeno commented 6 months ago

@mtwebster After testing for some time, I haven't noticed significant overheating that could be attributed to the text-shadow on the desktop, nor a significant increase in the GPU or CPU usage when using or not using it. If there are any more specific tests you used in the past to confirm the heating, please let me know (I would prefer if this could be tested completely before considering merging this).

mfreeman72 commented 2 months ago

I don't understand what you mean about why this is in mint-themes. These are indeed part of these themes. Maybe you're just throwing the modified files into ~/.config/gtk-3.0, I don't know.

That's exactly what I've been doing for many years. I put it in ~/.config/gtk-3.0 because I want it to remain that way, no matter what theme I use. It seems like it should be more of a desktop configuration option than a theme option, in my opinion.

mfreeman72 commented 2 months ago

It's better to implement this here because this way this change will be dependent on the theme selected by the user (currently Mint-Y), so if for example, another person wants to create a theme with a different kind of shadow effect (or even not using it) their change won't be overridden by the theme at ~/.config/gtk3.0 (if this was put there), I believe.

I would absolutely hate that, personally. I want my desktop icon labels to have the same shadow style, no matter what theme I use. Themes are more for windows and panels, not the desktop itself. Using themes to do this would be like using themes to determine which fonts to use. Putting different shadow styles in themes would be so incredibly annoying. I would rather see something like this go into Desktop Configuration Settings if they need to be changeable, definitely not in themes. So yeah, I use the ~/.config/gtk-3.0 file to do this. In my opinion, that's the only real option.

moloch1994 commented 2 months ago

I would like to add that recently I tried adding this code into a theme, and it didn't work for some reason. I tried it every which way, spent a good couple of hours playing around with it. I'm not sure whether I did it wrong, but what I discovered is that there was already some code like that in there, yet it wasn't taking effect. I suspect that perhaps the reason I've never seen themes modify this is because they did and it just never worked for some reason.

For me it only works when added to gtk.css in ~/.config/gtk3.0.

anaximeno commented 2 months ago

I would like to add that recently I tried adding this code into a theme, and it didn't work for some reason. I tried it every which way, spent a good couple of hours playing around with it. I'm not sure whether I did it wrong, but what I discovered is that there was already some code like that in there, yet it wasn't taking effect. I suspect that perhaps the reason I've never seen themes modify this is because they did and it just never worked for some reason.

For me it only works when added to gtk.css in ~/.config/gtk3.0.

Did you still had it in the ~/.config/gtk3.0 when you tried to add it into another theme? The one ~/.config/gtk3.0 takes precedence iirc, so that would make it not take effect iirc.

anaximeno commented 2 months ago

I would absolutely hate that, personally. I want my desktop icon labels to have the same shadow style, no matter what theme I use. Themes are more for windows and panels, not the desktop itself. Using themes to do this would be like using themes to determine which fonts to use. Putting different shadow styles in themes would be so incredibly annoying. I would rather see something like this go into Desktop Configuration Settings if they need to be changeable, definitely not in themes. So yeah, I use the ~/.config/gtk-3.0 file to do this. In my opinion, that's the only real option.

I understand your point and I am not against it, if it were chosen to be the best for users. The only issue I see is that changing the shadow (and even the font) is already something you can do with themes, and everytime you define a value that will sit above all the others you are also "breaking" a bit the support for theming. Adding it to Mint-X, Mint-L, and Mint-Y would be enough imo since most users use that, and it is in the responsibility of the other themes deciding whats best in their cases, or the user to add an override at ~/.config/gtk-3.0.

mfreeman72 commented 2 months ago

I understand your point and I am not against it, if it were chosen to be the best for users. The only issue I see is that changing the shadow (and even the font) is already something you can do with themes, and everytime you define a value that will sit above all the others you are also "breaking" a bit the support for theming. Adding it to Mint-X, Mint-L, and Mint-Y would be enough imo since most users use that, and it is in the responsibility of the other themes deciding whats best in their cases, or the user to add an override at ~/.config/gtk-3.0.

I have never once seen anyone use it in a theme (and I've tried A LOT of themes). So breaking a theme would be an extremely rare case unless people suddenly start doing this in their themes. But again, I think people don't do this in themes because themes are primarily focused on window/panel elements and icons. Icon label shadows simply don't make sense to do in themes. It's more closely related to desktop fonts, since it sits behind a desktop icon font. Fonts are not controlled by themes, so why should the shadow behind a font be controlled by themes?

I don't think it would hurt anyone to have this overridden in ~/.config/gtk-3.0. I think the best situation would be to have it overridden with a default that looks nice and works well with light (even white) colored backgrounds, and then create a simple GUI to give the user the option to adjust it to their needs (possibly put that GUI control into System Settings > Desktop). Having it controlled by a theme means if the user likes a theme, but they don't like how the theme creator made their icon label unreadable on their chosen background, then they'd have to either manually dig into theme coding to figure out how to change the theme themselves, or learn how to adjust the gtk.css file by hand. Neither of which is nice to new users, who would be most likely to be annoyed by things like this and dump Linux Mint for making things more difficult than it needs to be.

anaximeno commented 2 months ago

I have never once seen anyone use it in a theme (and I've tried A LOT of themes). So breaking a theme would be an extremely rare case unless people suddenly start doing this in their themes. But again, I think people don't do this in themes because themes are primarily focused on window/panel elements and icons. Icon label shadows simply don't make sense to do in themes. It's more closely related to desktop fonts, since it sits behind a desktop icon font. Fonts are not controlled by themes, so why should the shadow behind a font be controlled by themes?

The configuration is already available in theming, and the desktop items are already handled by theming, I believe you might have noticed the different highlight colors when selecting the items in the desktop, that's also something determined by the theming and defined very close to the text-shadow theme settings, so theme developers very likely are aware and can decide to change things like that easily whenever they want. So having something that would directly override that, could be already breaking theming for that part.

Breaking that is not a big issue in my view, the question is if it is worth to do that instead of only adding to the system default themes, and let the other themes also do what they should do for the best support of their users or breaking that part for every other themes even if they would like to make it different.

moloch1994 commented 2 months ago

I would like to add that recently I tried adding this code into a theme, and it didn't work for some reason. I tried it every which way, spent a good couple of hours playing around with it. I'm not sure whether I did it wrong, but what I discovered is that there was already some code like that in there, yet it wasn't taking effect. I suspect that perhaps the reason I've never seen themes modify this is because they did and it just never worked for some reason. For me it only works when added to gtk.css in ~/.config/gtk3.0.

Did you still had it in the ~/.config/gtk3.0 when you tried to add it into another theme? The one ~/.config/gtk3.0 takes precedence iirc, so that would make it not take effect iirc.

Yeah, and I relogged in. And I did so every time I tried changing the theme, and it just never worked. I don't think I did something wrong cause I've messed around with themes before, and the CSS code is very self-explanatory, so I'm not sure why it didn't work. But, if you could point to a theme with such alterations that works, it'd be greatly appreciated. Cause then I could take a look at it and probably figure out where I went wrong (if at all).

mfreeman72 commented 2 months ago

In case you didn't see this in the other thread: I made a program to adjust this. I would prefer an official Linux Mint-santioned way to do this, but if you don't mind a quick and dirty GUI-based solution, you can try it.

This python-based GUI program allows you to override the default or theme-coded icon label shadows, and adjust them to your preferences. You can also easily turn them off to revert back to the default or theme shadows.

Download this file: https://drive.google.com/file/d/1LYgZI6EoPZCpQX2l1SDKYifcMGQlPjjC/view?usp=drive_link

Make sure to start with a clean ~/.config/gtk-3.0/gtk.css file, taking it back to defaults, or just renaming it to keep a backup of any previous edits (the program will create a new one). The program does work around any other css code that's there, but if you have two of the same css elements in the same file, I can't guarantee it will work the way it's supposed to.

Decompress the folder wherever you want to store it, and run the .sh file. The window will open. Click the Enable switch, adjust the settings the way you want them, and when you close the window, Nemo will restart and your new shadow settings will be visible.

moloch1994 commented 2 months ago

In case you didn't see this in the other thread: I made a program to adjust this. I would prefer an official Linux Mint-santioned way to do this, but if you don't mind a quick and dirty GUI-based solution, you can try it.

This python-based GUI program allows you to override the default or theme-coded icon label shadows, and adjust them to your preferences. You can also easily turn them off to revert back to the default or theme shadows.

Download this file: https://drive.google.com/file/d/1LYgZI6EoPZCpQX2l1SDKYifcMGQlPjjC/view?usp=drive_link

Make sure to start with a clean ~/.config/gtk-3.0/gtk.css file, taking it back to defaults, or just renaming it to keep a backup of any previous edits (the program will create a new one). The program does work around any other css code that's there, but if you have two of the same css elements in the same file, I can't guarantee it will work the way it's supposed to.

Decompress the folder wherever you want to store it, and run the .sh file. The window will open. Click the Enable switch, adjust the settings the way you want them, and when you close the window, Nemo will restart and your new shadow settings will be visible.

Sounds great, I will try it out! FYI the file is private, so it requires me to request access.

mfreeman72 commented 2 months ago

Sounds great, I will try it out! FYI the file is private, so it requires me to request access.

I don't share things on Google Drive very often. I had a feeling I was missing a step. Fixed the permissions. Now anyone should be able to download it.

echuber2 commented 2 months ago

You could probably just post it on GitHub if it's useful. (Inspired by this thread, I tried putting this in my own gtk.css:)

.nemo-desktop .nemo-canvas-item {
  color: #ffffff;
  text-shadow:
    0px 0px 2px rgba(0, 0, 0, 1.0),
    0px 0px 2.5px rgba(0, 0, 0, 0.95),
    0px 0px 3px rgba(0, 0, 0, 0.8); }
mfreeman72 commented 2 months ago

It is on github as well. https://github.com/mfreeman72/Nemo-Shadow-Control