Open StrangePeanut opened 4 months ago
Sounds like a good idea. Should be reasonably easy to implement once Mumble switches to Qt 6.5 https://stackoverflow.com/a/77751363
Hello , I’m new to contributing to open-source projects, and I’m looking to get involved as part of a requirement for my studies. I have some experience with C++, but I'm new to Qt. Could I take a crack at this issue?
Could I take a crack at this issue?
Sure, have a go! If you have any questions feel free to ask here, in a newly created PR or in our Matrix chat room!
@Krzmbrzl Are we Qt 6.5 yet?
Yes.
No we are not. We can only require Qt >= 6.2 in order to stay compatible with Ubuntu 22.04 which ships with that version (btw. 24.04 comes with 6.4)
However, I would totally be fine with making this feature available only if Mumble has been compiled with Qt >=6.5 which can be achieved by using the preprocessor like this:
#if QT_VERSION >= QT_VERSION_CHECK(6,5,0)
// Your code here
#endif
As an aside: this issue seems rather closely related to https://github.com/mumble-voip/mumble/issues/4420
No we are not. We can only require Qt >= 6.2 in order to stay compatible with Ubuntu 22.04 which ships with that version (btw. 24.04 comes with 6.4)
Ah, sorry, I had only checked our vcpkg build environment...
However, I would totally be fine with making this feature available only if Mumble has been compiled with Qt >=6.5 which can be achieved by using the preprocessor like this:
#if QT_VERSION >= QT_VERSION_CHECK(6,5,0) // Your code here #endif
Definitely.
As an aside: this issue seems rather closely related to #4420
Yes, in fact we should first address my comment:
Maybe we could add a flag to each theme that indicates whether it's dark/light/neutral and then decide which one to set depending on the system's.
Although the official version for this issue will be for Qt 6.5 as discussed, I will also look into trying to implementing this feature for Qt 6.2.
As mentioned in #4420
Switching themes while Mumble is running is not possible either as that requires it to be restarted so I'm not sure if that'd make for a great experience...
Would you like me to explore a solution to avoid requiring a restart when switching themes, or is this behavior expected and not something that needs to be address?
Would you like me to explore a solution to avoid requiring a restart when switching themes, or is this behavior expected and not something that needs to be address?
I would say this depends on how complicated this gets. The primary goal would be for Mumble to choose the light or dark theme on startup (if the user configures automatic theme detection of course). That would be enough of a feature to be merged for sure.
Of course, this is not ideal for users whose theme switches with the time of day. If you manage to additionally also address this in a neat way - preferably in a separate commit - that would be a nice bonus.
My gut tells me that fixing the need for a restart of Mumble in order to change the theme is rather tricky
I am new here. Could somebody tell me how can I start this project by cloning
That should by covered by e.g. https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
Greetings, I am looking into implementing this feature with the understanding that it would be enabled only if compiler detects Qt version over 6.5, as mentioned here: https://github.com/mumble-voip/mumble/issues/6515#issuecomment-2391824925.
One question though: should I default dark theme to Mumble's default dark theme and light theme to Mumble's light theme?
Besides this, should the option be implemented in the themes combobox or as a checkbox? Insertion of the default-by-OS theme can be implemented with the StyleInfo class, but I don't know whether that is correct at all.
I am new to the codebase, and the behavior of these fields confuses me a bit.
QFileInfo defaultQss; QMap< QString, QFileInfo > qssFiles;
Technically speaking, the code trying to pull the theme would be overriden (by me) and forced to use the chosen themes, but should I change QFileInfo to point to a different file (the default dark theme file etc) and swap qssFiles out for different ones each time a theme gets refreshed?
@NSHABV Hello , could I ask you to hold off on you working on this? I am currently working on this. Could you give me 1-2 weeks to try to finish this.
@NSHABV This issue was indeed already assigned to @jakub2682-tuke
@jakub2682-tuke No pressure :)
Little update on how it's going.
It took me a few days to build dependencies, as I never did so for such a project, and I struggled a little. I found out your vcpkg got a problem with boost ports as several components got wrong hashes.
On my Windows 11, it currently works for qt 6.2, and it is dynamic, so it doesn't have to restart to change the theme when auto would be enabled. I wrote code for the qt6.5 version, but I haven't tested it yet, as I don't know how to upgrade the qt to qt6.5, as when I build with qt6.5, it has problems on the last building step.
Also, currently it's always auto, as I haven't figured out how to properly add the option to choose "Auto" and then detect its on auto. But I think when I look at that part of the code properly, I should easily finish that.
Context
No response
Description
Introduce a new default 'Sync with OS' theme option that automatically uses the light or dark theme based on the current OS colour scheme. Users can override the behaviour by explicitly selecting a theme option.
This improves the overall user experience for those who regularly switch between the light and dark colour schemes. It also benefits new users who use the dark colour scheme around the clock as they no longer need to change the theme setting from default.
Mumble component
Client
OS-specific?
No
Additional information
No response