Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding and solving theming issues #125

Open
VerMishelb opened this issue May 26, 2023 · 24 comments
Open

Finding and solving theming issues #125

VerMishelb opened this issue May 26, 2023 · 24 comments

Comments

@VerMishelb
Copy link

VerMishelb commented May 26, 2023

This issue is a collection of theming issues I personally faced and solutions to them when discovered, because creating a separate issue for these is a wastage and some of these are unlikely to be caused by msstyleEditor itself but by a series of unfortunate factors (or by both).


Issue: Corrupted colour and margin settings for some elements.
Solution: Keep the .msstyles file name "aero.msstyles" or "aerolite.msstyles" and install OldNewExplorer if some elements are still not modified (alternatively, a Windhawk mod "UIFILE Override" is said to do the same).
Alternative solution (longer but doesn't require modifying the path in .theme):
WARNING: The following doesn't seem to work for me anymore for some reason. The safest option is to use the solution above.
Find the "en-US" folder of the theme, it must contain the .mui resource. Copy it over and change to your own language (e.g. ru-RU). Open the copy up and open the .mui using ResourceHacker. From actions menu select "Change Language for All Resources" and select your own (e.g. "Russian", "DEFAULT"). The first resource in the .mui has a language code too. Export that resource as a .bin, edit it with a HEX editor (HxD, ImHex) and replace the en-US part with your own (don't break the null bytes between letters, the encoding here is UTF-16!). Save the result, replace the resource in ResourceHacker and save the edited .mui. Now it should work correctly.
Effect:

  • title bar buttons and text colour in some applications that try to use the theme (e.g. Firefox);
  • the entire aerolite, if used as a basis for theme modifications (buttons and window frame ignore sizing properties, checkboxes mix up the states etc);
  • control panel left side background and text colour;
Examples

Firefox title bar buttons are corrupted. Note how the tab text is white even though it should be black, making it unreadable.
изображение

aerolite — checkboxes, buttons and some other elements have corrupted properties

Luna10 by vprvnc — colourisation issues unless msstyles was renamed
изображение


Issue: Some parts are corrupted or don't have updated properties. Some images use the image file that is long gone.
Solution: Disable "Hide system files" and enable "Show hidden files" in explorer settings. Take ownership of C:\Windows\Resources\Themes\aero\VSCache, remove the corresponding cache file, re-apply the theme.


Issue: Some elements refuse to read new properties.
Solution: TBA Might be another case of the aforementioned issue.
Effect: #122 (comment)


Issue: Frame borders are not applied whatsoever on one machine but work just fine on another machine.
Solution: The theme might be using window shadows instead to achieve an authentic look. Enable window shadows.
Effect:

Image

Luna10 by vprvnc
My friend's machine:
изображение
My own machine: (note that the screenshot features oldnewexplorer, but the issue affects all windows)
изображение

I will be editing this main post whenever I face something else.

@nptr
Copy link
Owner

nptr commented May 28, 2023

Thanks! I might make wiki entries for some of those things.

@OrthodoxWindows
Copy link

@VerMishelb How do you fix issues with the aerolite style ? I encounter the same issues.

@VerMishelb
Copy link
Author

Keeping the .msstyles file name as aerolite.msstyles fixes most of aerolite issues. If you are making a custom theme I think the best way to store it would be C:\Windows\Resources\Themes\YourCustomTheme\aerolite.msstyles. The .theme file doesn't suffer from this so it is safe to rename it to anything.

@OrthodoxWindows
Copy link

It doesn't work for me. Even copying the original folder exactly, the style is corrupted.
Even applying the original aerolite/mssstyle with msstyleeditor (which by the way works) doesn't work.

@VerMishelb
Copy link
Author

Are you testing it using the editor's test feature or by saving and applying it using SecureUX/UltraUX?

@OrthodoxWindows
Copy link

Are you testing it using the editor's test feature or by saving and applying it using SecureUX/UltraUX?

I just did (I have UltraUX) it works. It's just that it doesn't work with msstyleeditor's "test" function.
Now I just need to check if it works with modifications. Anyway, thanks for all the research.

@VerMishelb
Copy link
Author

If I remember correctly from some other issue, msstyleEditor saves the theme in Documents when the test button is used, but I'm not sure whether it keeps the name. I suppose the test fails due to that.

@nptr
Copy link
Owner

nptr commented May 30, 2023

Its saved in /Users/Public/ under a random name, and removed once the test is stopped or the application exits.

@VerMishelb
Copy link
Author

I suppose it would be better to create a folder with random name instead and put the test theme inside it as "aero.msstyles" then? I'm still not sure whether there is a difference between "aero" and "aerolite" names.

@OrthodoxWindows
Copy link

OrthodoxWindows commented May 30, 2023

It does not work. In fact, if I modify aerolite, put it in another folder but with the same name, it applies the style but without the modifications. If I rename it, it applies the modifications but with the errors. I'm talking about the style applied without msstyleEditor.

@VerMishelb
Copy link
Author

Have you tried removing the cache file in VSCache?

@OrthodoxWindows
Copy link

Have you tried removing the cache file in VSCache?

Where is it stored ?

@VerMishelb
Copy link
Author

Take ownership of C:\Windows\Resources\Themes\aero\VSCache, remove the corresponding cache file, re-apply the theme.

@OrthodoxWindows
Copy link

The VSCache folder is empty.

@VerMishelb
Copy link
Author

VerMishelb commented May 30, 2023

Disable "Hide system files" in explorer settings (not hidden files, these are different).
It's in Russian but the layout should be the same.
изображение

@OrthodoxWindows
Copy link

OrthodoxWindows commented May 30, 2023

It works !

I showed hidden files (showing system files doesn't change anything, for some reason) in the edited visual style folder, and the
files show up. By reapplying the theme, it is the new visual style that applies, without the errors.

Many thanks !

@OrthodoxWindows
Copy link

OrthodoxWindows commented May 30, 2023

If not, I thought about the question, I thought that the corruption of aerolite may be related to the .mui file or to the shellstyle.dll. Maybe shellstyle or mui needs the exact name.

@VerMishelb
Copy link
Author

I've had that idea but simply renaming the mui and putting it near msstyles so it could find it didn't seem to help.

@e-t-l
Copy link

e-t-l commented Aug 7, 2024

There's another theming issue that I and a lot of others have run into, maybe you can help?

       

Certain elements of the Control Panel, like the sidebar, don't get themed correctly by dark themes. I've seen it frequently with the custom msstyles from Rectify11, but not exclusively. This is one example of many issues about it: Rectify11/Installer#288. One of the devs there just said "patch shell32.dll.mun in icons" which evidently is something you can do in Rectify11, but I don't know if it's something SecureUXTheme can do. That dev said in a similar issue "it's a microsoft issue and i can't do much about it" (namazso/SecureUxTheme#67).

Is there something that could be edited within the style to fix this part of Control Panel?

@VerMishelb
Copy link
Author

VerMishelb commented Aug 7, 2024

Files ending with .mun are simply resource files which can easily be opened and redacted using resource hacker. They are now used instead of storing everything inside of a dll for many system files. The problem is that this is not much of a portable solution as it requires you to take ownership over that file and keep a backup in order to survive unfortunate editing attempt by restoring the file through the recovery console. I doubt msstyles can solve this.

The control panel sidebar (at least in Win10) can be solved using oldnewexplorer, though. I've described that in the main post. The modifications it makes actually support and use msstyles instead of muns. Maybe ExplorerPatcher can do the trick? (sorry for many edits, I just can't build a complete message currently for some reason).

@Undisputed00x
Copy link

Undisputed00x commented Aug 7, 2024

There's another theming issue that I and a lot of others have run into, maybe you can help?

Certain elements of the Control Panel, like the sidebar, don't get themed correctly by dark themes.

Those white elements are not handled by the .msstyles theme but by the undocumented DirectUI API.

Is there something that could be edited within the style to fix this part of Control Panel?

To get rid of those in win10/11 use one of the below:

  • Use UXTheme Hook Windhawk mod which its an alternative to SecureUXTheme and has as an option setting to fix the control panel white header/sidebar
  • Patch shell32.dll.mun with Rectify11 but you'll get additional edited UI elements edited by R11
  • Patch shell32.dll.mun yourself by editing it with ResHacker the resource called UIFILE 24 and changing the background variable of
    <if class="HomePageHeader"> <Element background="valueWithHighContrastFallback(graphic(635,4,0,0,0,0,0,library(shell32.dll)),window)" to "20575" (its a immersive color which you can find here List immersive colors
  • [BONUS] Patching can be reverted on every Windows update, you can use Resource Redirect mod which instead of patching files it can load resources in-memory placed anywhere in your system.

@e-t-l
Copy link

e-t-l commented Aug 7, 2024

Wow, that was a very fast and informative response, thank you! I think I'll try manual patching with Resource Redirect and seehow it goes. (And if its too much work/too buggy, frankly I might just leave it as-is. Control Panel is the ONLY affected program I've noticed, and I don't use it super often.)

The one thing I don't quite understand is why every single person who uses SecureUXTheme for darker theming isn't complaining about it; if it's something an msstyles can't fix then I'd expect it to be universally present bug. Idk maybe the bug only appeared with a recent windows update?

@Undisputed00x
Copy link

Undisputed00x commented Aug 7, 2024

The one thing I don't quite understand is why every single person who uses SecureUXTheme for darker theming isn't complaining about it; if it's something an msstyles can't fix then I'd expect it to be universally present bug. Idk maybe the bug only appeared with a recent windows update?

That white background was always there.

Forgot to tell that DUI files (UIFILEs) in most cases are already precompiled in the resources. You need to extract and decompile them in a duixml format to be able to read the code. For that you either use DuiTool or uib2t

@VerMishelb
Copy link
Author

VerMishelb commented Sep 23, 2024

I think I've managed to win the .mui issue. Edited the main post to include the alternative solution to unskinned elements. Tested this just now with vaporvance's Aero10 and it seems to work fine.
In fact, I see a similar fix attempt from the 12th of May, 2023, but it was unsuccessful, probably because there was more than one mui file and I've missed the other one.

UPD: Nah, I take my words back, that did not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants