CodingWonders / DISMTools

The connected place for Windows system administration
GNU General Public License v3.0
397 stars 18 forks source link

System colour theming option doesn't follow system colours #111

Closed Fraaaaaunimib closed 6 months ago

Fraaaaaunimib commented 6 months ago

What is the bug about? Usually, a "system colour" option in Personalisation should make all the UI elements use the colors inside the System.Colors class. Instead, it uses a very weird mix-match of hardcoded colour values and system colours, like many other modern developed apps. immagine

immagine

immagine

Upon resizing it of even just a single pixel, it loads the custom dark mode which, although serviceable, it doesn't happen on the first load. immagine

It seems like though, upon first opening the app, it loads the true system colour mode which... well, doesn't look great. immagine

Speaking of which, I shouldn't be able to write anything I'd want in these dropdown boxes. immagine

How does it happen? Load any other theme other than aero.msstyles.

Expected behavior On System Color mode, it must theme all the controls using the System.Colors class without any hardcoded colour. While on this mode, it shouldn't switch to dark mode after starting it the first time and then resizing it.

CodingWonders commented 6 months ago

I see custom controls (a.k.a. buttons). Are you using Rectify11 or a different theme?

EDIT: "Use system setting" only detects the color preference of the system and sets the themes automatically

Fraaaaaunimib commented 6 months ago

In this case yes, but it could happen on any theme that doesn't use the colors of aero.msstyles.

CodingWonders commented 6 months ago

In this case yes, but it could happen on any theme that doesn't use the colors of aero.msstyles.

I improved the consistency of dialogs just because of Rectify11, back in the development of version 0.2 (circa December 2022), and haven't considered that since. I'll make a Windows 11 VM and apply Rectify11 to see what happens

CodingWonders commented 6 months ago

UPDATE: installing Windows...

Anyway, as a workaround, try setting up the light theme

CodingWonders commented 6 months ago

You'll need to provide more information about the components installed with Rectify11 since I can't seem to reproduce it. In some cases, some controls look even more beautiful than on the standard theme to me:

Rectify11-2024-04-13-15-33-42 Rectify11-2024-04-13-15-33-58 Rectify11-2024-04-13-15-34-29 Rectify11-2024-04-13-15-34-39 Rectify11-2024-04-13-15-34-51

Fraaaaaunimib commented 6 months ago

I've tried redownloading the 0.5 preview version, and I'm having the same problem. immagine

I'm not running the full version of Rectify11, but rather only the theme and certain system files (shouldn't be a problem though), and I'm running the 0.5 preview version from this repo. Just redownloaded it brand new after deleting it too.

I'm also getting these errors upon bootup of the application: `System.IO.FileNotFoundException: c:\$RECYCLE.BIN\S-1-5-21-3861414630-43215771-1940960715-1001\$RYA0DSI\Windows\system32\ntoskrnl.exe in System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName) in DISMTools.MainForm.DetectMountedImages(Boolean DebugLog) in DISMTools.MainForm.MainForm_Load(Object sender, EventArgs e) in System.EventHandler.Invoke(Object sender, EventArgs e) in System.Windows.Forms.Form.OnLoad(EventArgs e) in System.Windows.Forms.Form.OnCreateControl() in System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) in System.Windows.Forms.Control.CreateControl() in System.Windows.Forms.Control.WmShowWindow(Message& m) in System.Windows.Forms.Control.WndProc(Message& m) in System.Windows.Forms.Form.WmShowWindow(Message& m) in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Error Message: c:\$RECYCLE.BIN\S-1-5-21-3861414630-43215771-1940960715-1001\$RYA0DSI\Windows\system32\ntoskrnl.exe

Error Code (HRESULT): -2147024894

Machine information:

Operating system information:

Processor information:

This information is gathered to help isolate the issue to a specific hardware or software configuration. No information that can be used to identify the user or the exact system is gathered.

If you don't want to send this information to the developers, paste the text that was copied to the clipboard in a text editor, remove this information, and copy the new text again.

This information has been copied to the clipboard.`

And upon opening Settings, I get this: `System.ArgumentOutOfRangeException: InvalidArgument=Valore di '1' non valido per 'SelectedIndex'. Nome parametro: SelectedIndex in System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value) in DISMTools.Options.GatherCustomSettings() in DISMTools.Options.Options_Load(Object sender, EventArgs e) in System.Windows.Forms.Form.OnLoad(EventArgs e) in System.Windows.Forms.Form.OnCreateControl() in System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) in System.Windows.Forms.Control.CreateControl() in System.Windows.Forms.Control.WmShowWindow(Message& m) in System.Windows.Forms.Control.WndProc(Message& m) in System.Windows.Forms.Form.WmShowWindow(Message& m) in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Error Message: InvalidArgument=Valore di '1' non valido per 'SelectedIndex'. Nome parametro: SelectedIndex

Error Code (HRESULT): -2146233086

Machine information:

Operating system information:

Processor information:

This information is gathered to help isolate the issue to a specific hardware or software configuration. No information that can be used to identify the user or the exact system is gathered.

If you don't want to send this information to the developers, paste the text that was copied to the clipboard in a text editor, remove this information, and copy the new text again.

This information has been copied to the clipboard.`

CodingWonders commented 6 months ago

When testing the program to see if it had this issue, I only applied the theme, so I'm curious to know about the system files that you've installed.

As per the recycle bin exception, I'm stunned that it's pointing there. Maybe you have an image in there?

Fraaaaaunimib commented 6 months ago

Theoretically no... I did remove the old copy of the program I did download this morning, re-downloaded it, extracted the zip and it's sitting in my Downloads folder. The only thing I can think of being in the recycle bin is the original zip folder, but that shouldn't be a problem... that problem occurs also when I just open the app, before selecting any option.

As far as system files go, I have duires.dll, explorerframe.dll.mun, shell32.dll, and black.msstyles - I don't have the full package installed. They're all from the r11 repo under Files.

I know the developer of r11, I'll ask him too about this so we can know further if it's a problem of the theme 👍

Edit: as I said before though, upon resizing the window, it removed that strange mixmatch theme

CodingWonders commented 6 months ago

I applied black.msstyles and it still shows up correctly. Needless to say, I have only applied the themes, so something could be up with duires.dll or explorerframe.dll.mun. I ruled out shell32.dll since it only affects system icons for the most part.

Rectify11-2024-04-13-19-24-22

I'll do additional testing but, if you want, ask him about this issue. If it affects him as well, it may be a problem with the theme or the DLLs I have mentioned.

Fraaaaaunimib commented 6 months ago

Upon resizing, it gets fixed and it shows just like your screenshot does. Weird behaviour... I've asked now if he could look into it, I'll update once I get any reply.

immagine

CodingWonders commented 6 months ago

By the way, resizing the window is not a weird behavior. It's by design, as it's the functionality of "Hey, let's change the theme automatically when the system changes the theme!"

CodingWonders commented 6 months ago

@Fraaaaaunimib, any response from the Rectify11 developer?

CodingWonders commented 6 months ago

A thing I've found out is that there's a registry key that changes when you change the system theme:

regedit_npjHmATHLz

Can you show me your DllName value stored in HKCU\Software\Microsoft\Windows\CurrentVersion\ThemeManager? If it is different from Aero.msstyles, then we can check the currently applied theme programmatically

Fraaaaaunimib commented 6 months ago

winex (the developer) wrote "Just checked this now because github stopped loading on iOS 15. idk how is that even possible, A/B testing???"

That's why I didn't write anything, it doesn't seem like it helped a lot.

immagine Here is my registry entries, yes it's different from aero.msstyles.

CodingWonders commented 6 months ago

Then a check for that registry key will be added to the program. By the way, does the program look correctly in light mode? Set it to that theme, close the program, and reopen it

EDIT: I also find the visual glitches weird because, like I previously mentioned, I had made consistency improvements just because of Rectify11 that still work with the latest version applied by the installer

Fraaaaaunimib commented 6 months ago

@winexperiments

added a mention so you can speak directly from it in case you need anything

By the way, yes it indeed looks fine, there are just minor glitches due to the theme immagine

CodingWonders commented 6 months ago

@WinExperiments, how does the program look to you?

CodingWonders commented 6 months ago

@Fraaaaaunimib, by the way, the other glitches regarding placeholder strings are because of an unsupported language. Force the program to use English in the Personalization settings

CodingWonders commented 6 months ago

@Fraaaaaunimib, the latest nightly installer features the following warning:

You'll also need to reconfigure the program, since it now detects unsupported languages and goes back to English, which fixes the placeholder strings

Fraaaaaunimib commented 6 months ago

Is it normal that the warning msgbox doesn't have a theme manifest?

CodingWonders commented 6 months ago

Is it normal that the warning msgbox doesn't have a theme manifest?

This is a representation of the warning using VBScript. Since I haven't set a custom theme, the warning doesn't come up for me

CodingWonders commented 6 months ago

I'm going to close this issue. Feel free to reopen it or make a new one if you encounter the same problem or a different one