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
Feature request: Dark mode on Windows (10) #4493
Comments
This was discussed on one of the prusa live streams. I believe they mentioned that it was difficult “due to windows API” or something. I agree though, it’s worth figuring out! |
I really want this too as I have to use a dark theme for accessibility reasons. I was considering implementing this myself but the win32 dark theme API is undocumented and could possibly change. It's not likely to change though considering MS has updated most of it's apps to use it. See https://github.com/ysc3839/win32-darkmode for an example of how to use the current API. |
If you want a dark mode in PrusaSlicer on Windows 10, you should post a
complaint using the Windows 10 feedback application "Feedback Hub". If you
open an issue there, please post its name, so others could upvote it.
út 1. 9. 2020 v 1:22 odesílatel Mike Ratcliffe <notifications@github.com>
napsal:
… I really want this too as I have to use a dark theme for accessibility
reasons.
I was considering implementing this myself but the win32 dark theme API is
undocumented and could possibly change. It's not likely to change though
considering MS has updated most of it's apps to use it.
See https://github.com/ysc3839/win32-darkmode for an example of how to
use the current API.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4493 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMPSI2WVHBMRQSATCS4NKTSDQWEZANCNFSM4OSWUOTA>
.
|
See https://github.com/ysc3839/win32-darkmode for an example of how to
use the current API.
@YuSanka tried that quickly, but the Win32 dark mode support is half baked
(they implemented just what they needed to support Windows Explorer and
their other Win32 based system applications), so we don't think it is worth
the effort as of now. We need more love from Microsoft.
út 1. 9. 2020 v 8:53 odesílatel Vojtech Bubnik <vojtech.bubnik@prusa3d.cz>
napsal:
… If you want a dark mode in PrusaSlicer on Windows 10, you should post a
complaint using the Windows 10 feedback application "Feedback Hub". If you
open an issue there, please post its name, so others could upvote it.
út 1. 9. 2020 v 1:22 odesílatel Mike Ratcliffe ***@***.***>
napsal:
> I really want this too as I have to use a dark theme for accessibility
> reasons.
>
> I was considering implementing this myself but the win32 dark theme API
> is undocumented and could possibly change. It's not likely to change though
> considering MS has updated most of it's apps to use it.
>
> See https://github.com/ysc3839/win32-darkmode for an example of how to
> use the current API.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#4493 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABMPSI2WVHBMRQSATCS4NKTSDQWEZANCNFSM4OSWUOTA>
> .
>
|
I thought somebody had probably tried.
@bubnikv I have logged an issue in the Microsoft feedback hub here - Win32 dark mode API too basic to use in the wild. @YuSanka Can you let the Microsoft devs know which API functionality you need in order to implement this at https://aka.ms/AA9jecu? @EverybodyElse If you would like dark mode functionality in PrusaSlicer please upvote this issue here - Win32 dark mode API too basic to use in the wild. |
For me it looks like a Prusa devs are bit lazy when blaming Microsoft about that API. It is not that hard to create an option for a dark theme. Even a temporary dark theme would be nice until Microsoft fixes their dark mode APIs, if that never happens. |
Plenty of apps have lots of color themes. Dark mode in windows has been around for ages, it doesn't seem likely that MS is going to update the API for general use. There are also plenty of windows apps that are dark themed, so perhaps some consideration could be put into this under the assumption that the API won't be updated. |
Exactly.
Yeah, it is trivial. We are just lazy. Please provide a pull request.
It depends on the UI toolkit your application is built upon. Win32 does not support dark mode. Some others do. If the UI toolkit supports the dark theme, then it is quite easy to just skin the UI. If it does not, then it is very difficult. |
https://github.com/ysc3839/win32-darkmode
One may check the commit log of the unofficial Win32 dark mode support project how fragile the support is and that it may break with any Windows release. |
Prusa devs has been waited long time and still waiting with fingers crossed. Maybe Microsoft never fixes dark mode APIs. Perhaps it is better develop an alternative way to make dark mode possible? Currently i have installed many apps that have dark mode/theme and all them works well, so there must be an another way to make dark mode/theme. "Don’t sit and wait forever for the mountains to move out of the way. Use a detour" |
What i don't understand is this: Prusa devs has been waited long time and
still waiting with fingers crossed.
We are certainly not waiting with our fingers crossed. Trust me, we are all
very busy.
An alternative solution is to either abandon the Win32 API, which means an
extreme amount of time and effort, or hacking around the Win32 limitations,
which is also time consuming and the result will be fragile against changes
at the Microsoft side. There is no easy, cheap and quick solution. And if
we are investing our time into the dark mode support, we will not be
investing our time into making the slicer produce better supports, faster
prints etc.
čt 26. 11. 2020 v 0:42 odesílatel Kollimolli <notifications@github.com>
napsal:
… I understand this. It's shame that Microsoft have almost abandoned that
API.
What i don't understand is this: Prusa devs has been waited long time and
still waiting with fingers crossed. Maybe Microsoft never fixes dark mode
APIs. Perhaps it is better develop an alternative way to make dark mode
possible? Currently i have installed many apps that have dark mode/theme
and all them works well, so there must be an another way to make dark
mode/theme.
"Don’t sit and wait forever for the mountains to move out of the way. Use
a detour"
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4493 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMPSI3JS6GUD2TJV3OJGMDSRWI7JANCNFSM4OSWUOTA>
.
|
So long answer in short: Prusa devs still continues waiting for forever if Microsoft someday fixes dark mode APIs and until that there will not be a dark mode because there is no easy or cheap way to do it without MS dark mode APIs? Please dont understand me wrong, i appreciate lot your efforts and work making Prusaslicer better and better, it is already one of the best slicers available. But there is many users, me too, who cannot use or it is hard to use apps with light theme because visual impairment or other reasons. So it is not just a matter of taste, it is thing that defines can app be used or not. For me this is more important thing than better supports or faster prints. |
I am in the exact same position... I am very sensitive to light and it basically results in the same symptoms as a stroke and seizures (I recover in around 3 days). Sadly, the accessibility settings on Windows are too harsh so they don't work for me either. Even inverting the colors would be a start but at the same time I understand that we are in the minority so I understand why they focus on functionality above accessibility. That generally changes as a product becomes feature complete and they obviously have a bunch of features in the works at the moment so we just need to sit tight. |
I might be missing something, but I hope this helps: My first thought was just using the registry: public static boolean isSystemDarkTheme () {
boolean isDarkTheme = false;
if (OS.WIN32_VERSION >= OS.VERSION (10, 0)) {
TCHAR key = new TCHAR (0, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", true); //$NON-NLS-1$
long [] phkResult = new long [1];
boolean regKeyFound = false;
if (OS.RegOpenKeyEx(OS.HKEY_CURRENT_USER, key, 0, OS.KEY_READ, phkResult) == 0) {
regKeyFound = true;
} else if (OS.RegOpenKeyEx(OS.HKEY_LOCAL_MACHINE, key, 0, OS.KEY_READ, phkResult) == 0) {
// Try reading from HKLM
regKeyFound = true;
}
if (regKeyFound) {
int [] lpcbData = new int [1];
TCHAR buffer = new TCHAR (0, "AppsUseLightTheme", true); //$NON-NLS-1$
int result = OS.RegQueryValueEx (phkResult [0], buffer, 0, new int[] {OS.REG_DWORD}, (TCHAR)null, lpcbData);
if (result == 0) {
int[] lpData = new int[lpcbData[0] / TCHAR.sizeof];
result = OS.RegQueryValueEx(phkResult[0], buffer, 0, new int[] {OS.REG_DWORD}, lpData, lpcbData);
if (result == 0) {
isDarkTheme = (lpData[0] == 0);
}
}
OS.RegCloseKey (phkResult [0]);
}
}
return isDarkTheme;
} or maybe use parts of this example in Python? try:
import winreg
with winreg.ConnectRegistry(
None,
winreg.HKEY_CURRENT_USER
) as registry:
with winreg.OpenKey(
registry,
'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize'
) as key:
value, value_type = winreg.QueryValueEx(key, 'AppsUseLightTheme')
except Exception as e:
print('AutoDark: Error(_is_dark_os("windows")): ', e) I know it's not "the right way", but it could work, right? if not, maybe importing the WindowsApp.lib ? If I understand it correctly, it could help us do what UWP can do(?)
some C example: https://github.com/ysc3839/VCMPBrowser/blob/darkmode/DarkMode.h |
@SM-26 If you think that is sufficient, then please test it and provide a pull request. IMHO it is just around 3% of the total effort, the biggest issue will be to skin the Win32 controls, that Microsoft still did not bend to support the dark mode. |
I am a sysadmin, not an app developer, so I may be completely wrong here, but I will ask anyway. Why on earth is this project still maintaining the branch of the application that relies on that pile of obsolete junk called Win32 API? :-O I was living with an impression that only old obsolete/unmaintained apps still use that thing and everyone else already moved on. So to find out, that such a great, thriving and active project like Prusa Slicer still maintains a branch which relies on Win32 API doesn't make any sense to me. Not being able to easily implement dark skin to your app must be just an tip of the iceberg of the issues that this relying on the old unmaintained/undocumented MS API brings... |
PrusaSlicer is built upon wxWidgets toolkit, which uses Win32 API behind
the scenes.
Why on earth is this project still maintaining the branch of the
application that relies on that pile of obsolete junk called Win32 API? :-O
Chrome (and Edge) browsers use Win32 API on Windows. File explorer, notepad
and all the rest of the "old" windows applications are still built using
Win32 API.
pá 19. 3. 2021 v 17:06 odesílatel Tomas Klouda ***@***.***>
napsal:
… I am a sysadmin, not an app developer, so I may be completely wrong here,
but I will ask anyway.
Why on earth is this project still maintaining the branch of the
application that relies on that pile of obsolete junk called Win32 API? :-O
I was living with an impression that only old obsolete/unmaintained apps
still use that thing and everyone else already moved on. So to find out,
that such a great, thriving and active project like Prusa Slicer still
maintains a branch which relies on Win32 API doesn't make any sense to me.
You obviously have Linux and Mac versions of your app, which are with
almost 100% certainty using some different (hopefully multiplatform) API
and not Win32, so why are you still dragging this ball tightened to your
leg? :-O
This looks to me like a self-inflicted wound that you are keeping open and
bleeding.
Not being able to easily implement dark skin to your app must be just an
tip of the iceberg of the issues that this relying on the old
unmaintained/undocumented MS API brings...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4493 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMPSI7ECGQ7JZY3RBOOQATTENY7TANCNFSM4OSWUOTA>
.
|
@bubnikv Chromium based browsers use Win32 API on Windows? :-O That probably shows my lack of knowledge ;-) But also brings important question: |
@johny-mnemonic I will try to describe the issue in more detail, there clearly are misunderstandings. The "I don't know, but it can't be difficult because I saw a dark button in application XYZ" opinion simplifies things a bit too much. @bubnikv will certainly correct me if needed.
So, technically there are several options how to get dark mode into PrusaSlicer: b) wxWidgets would change the way it renders controls, implements both light and dark mode, we "just turn it on" (not going to happen) c) we switch to custom rendering of controls on Windows ourselves - lot of work and a maintanence burden (you're talking about being multiplatform, but this is exact opposite) d) we replace wxWidgets with another library whose authors already did the hard work - this is LOT of work and has many many more consequences. If it ever happens, it will not be because of Win dark mode. The choice is not simple. Especially when you think about all the other features we will not have time to work on because of this. |
Thanks for the detailed explanation @lukasmatena! So you are using wxWidgets also on Mac and Linux, just calling another underlying OS specific API? |
wxWidgets is multiplatform. It handles everything for macOS, Windows, and Linux. All PrusaSlicer has to do is implement wxWidgets into the app, and the "translation" to the different platforms is taken care of by wxWidgets. |
It looks like there is now a solution for users who uses Windows high contrast-themes. |
Sent to wx-users list (the list for discussing usage and issues of the multi-platform user interface library that PrusaSlicer is built upon):
That's our current status. We will likely invest a significant effort into investigating the ongoing Win32 Dark Mode effort of the Notepad++ project. We don't know, whether our effort will bring fruits or not as we have no source code example of any successful Win32 application supporting the Dark Mode. |
@bubnikv That has all changed recently... Dark mode was only fully implemented for UWP apps because there were plans to use WinUI to allow C++ Win32 apps to use UWP controls... this work has now been done. Because you can now host UWP controls inside your C++ Win32 app these controls will automatically apply dark mode settings when the setting is changed ;) To do this in a C++ Win32 app you need to use XAML islands. There are instructions and examples here: https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/using-the-xaml-hosting-api I would implement it myself but I am way too busy to contribute at the moment. |
Frankly I do not understand your response. We wrote our application in wxWidgets, which pack Win32 controls. Do you propose to turn PrusaSlicer into an UWP application, which would embed an XML island, which will then embed the whole PrusaSlicer Win32 application? Would then the UWP frame take care of skinning the Win32 controls inside the XML island? We know there is https://github.com/microsoft/ProjectReunion , but we don't know whether and how that could help us. |
Yes please. Dark mode all the way. |
yes, I love Dark mode in my apps. |
@coopermoto @jgeater yes what? We really need a fine grained feedback. None of us developers working on Windows likes the dark theme, thus we don't know what is passable and what is not and why you love it. Is it because it is easy on your eyes? Could we release one of the builds we posted? Which one? What is the worst eye sore in it in regard to the dark mode palette? |
I use Dark mode in every Windows apps that support it, mostly Office, Visual studio and visual studio code. It is far easier on my eyes and in many cases the contrast makes it easier to see warnings and errors. Specifically the yellow and red colors used with misspellings, errors, and warnings stand out better for me on a dark background. Does that help? |
Replaced the dll file (using Dark with no border buttons), but I keep getting an error: "Unhandled unknown exception; terminating the application", if I click ok(the only button) I get to another error which says:
If I replace the dll file with the old one, it works just fine. |
@Ferferite, Yes, you are right. In official released build missed some icons. Ok, I will put one of our last build to the link. |
Here is a build? |
Works perfectly now, thank you |
@bubnikv I love all three but I like the third one best... it just "feels" better. I wouldn't change anything from that screenshot. Sorry, I didn't notice your comment asking to Skype. I don't have any experience with wxWidgets and the library is a pain to work with on Windows so I couldn't create an example. It looks like you have found a way to implement it anyhow. I can understand your devs not liking dark themes if they are not used to working with them. I used to hate them until we implemented dark mode in Firefox DevTools and for me it was truly life changing. Personally, I use a dark theme on almost everything because looking at bright screens triggers serious migraines for me (much more serious than a headache). To be honest I don't think many people care whether it faithfully follows the Windows dark theme. An easy 👍 from me! |
How to switch this build to dark theme? I have Win 10 with selected dark theme, but this is still starting in light theme same as standard 2.3.0 build. I also tried downloading dll/exe files and replacing them, but that produces lot of errors about missing dll files (mostly their name ends with "D" so I guess those are debugging libs?). As other guys mentioned, any dark theme is better then default light theme. The reason is, that especially when you have system and all other apps in dark theme, then having single window in light theme is tiresome for the eyes and prolonged use hurts. |
You need to run the Prusaslicer 2.4.0 alpha to make this work. Goto the original link that was posted here (see quote below). Then click on download all (right top corner).
After download unzip the file and then you get the new PrusaSlicer alpha folder and the three dark theme variants. If you start the alpha as is, it starts in light mode but you can now copy the dark themes files over to the alpha folder and check out the new themes. PS.: I know I am going to test the fuzzy walls feature this weekend :-) |
@DesC21 As I described, I did exactly what you are suggesting. |
@johny-mnemonic , you have to raplace just PruSlacer.DLL |
replace the PrusaSlicer.dll from darkmode folder to PrusaSlicer.dll from pusaslicer 2.4 and the app wont start, it working again if replace with the orginal PrusaSlicer.dll |
@YuSanka I can confirm the same behavior as @fernandex00 describes. With only dll replaced, exe does nothing. No errors just short spinning wheel and then nothing happens. |
@YuSanka provided a DLL, which was compiled against debugging variants of Visual Studio libraries. She will post the release DLL soon. |
I used the word "lazy" with a tongue in cheek. They likely have their technical reasons. Windows is the only platform that really allows you to run very old executables. Microsoft invests huge effort in maintaining backwards compatibility, which is both their blessing and their curse. |
Ok, just try this build without any replacing :) It's a build of third variant od DarkMode |
me too :-), it wasn't meant to be offensive. I am sure they have their reasons and a lot of other more important topics to work on but since they announced the dark mode stuff not much happened to be honest (as is seen with the various programs that are not supported even from microsoft themselves). Anyway, I like that you guys invested some time to make this work and I would love to see it in a release if some things that were raised here can be easily fixed. |
It's working now, looks good, the thing I notice is that the dark theme works following the system theme, if I'm using the default color, prusaslicer will be using the default theme, will be nice to have the option to always have the app themed |
Dark mode is the main thing keeping me from switching from Cura, which has an excellent dark color scheme.
Thanks for uploading this, I just gave it a try. Here is some feedback. There are some minor visual issues:
Looking forward to the next version. |
For those looking for a "quick fix", NegativeScreen works quite well and works with any version of PrusaSlicer (or any other app you like). It's not perfect but it is very easy to turn on and off with a keyboard shortcut. |
Based on the popular request, we have implemented Dark Mode for Windows and we have also fixed the High Contrast mode #3038. While PrusaSlicer supports dark mode on OSX and Linux for some time already, Dark Mode on Windows was the one from the hard basket. PrusaSlicer's user interface is implemented using a wxWidgets multi-platform library, which wraps around the native controls the platform provides. On Windows, wxWidgets wrap around the aging Win32 controls, for which there is no official Dark Mode support provided by Microsoft since the introduction of the Dark Mode into Windows 10 in fall 2018. Unfortunately Microsoft just implemented an undocumented API for the controls used by Windows Explorer to switch to Dark Mode. If a Win32 control is not used by Windows Explorer main window, it is not Dark Moded and it never will be, and the API for those controls that are supported is not official, thus it may be changed without notice. We have done our best using the undocumented Dark Mode API and skinning of Win32 controls. We even implemented our own replacements for some Win32 controls, which were not skinnable, for example the tabbed notebook that we use to switch between the Plater / Print / Filament / Printer profiles (this one fixes speed of switching the tabs on 4k displays #6309). Still some of the controls are not skinned properly, for example the scroll bars, status bar or the spin control buttons, thus PrusaSlicer may not look quite polished in Dark Mode. Therefore for now we decided to not switch PrusaSlicer into Dark Mode following the Windows system settings, but we are letting the user to select dark mode from Preferences using the "Use Dark color mode (experimental)" checkbox. As an alternative to the "tabbed notebook" control to switch between the Plater / Print / Filament / Printer profiles, we newly allow these tabs to be placed into the application menu, which may be welcome on small laptop screens. Thhe dark mode will be released with PrusaSLicer 2.4.0-alpha1. |
I would love to see the dark version available on Mac, also be available on windows!
Reference:
https://i.imgur.com/HsT7M6T.png
The text was updated successfully, but these errors were encountered: