This unifies color handling on Windows. First of all, it uses slightly
modified palettes directly from Qt 6.5.0, keeping the fix for the
barely legible dark blue links in dark mode. The light palette is
unmodified.
Second, this adds an option in the preferences, letting the user chose
which palette to apply: either the light one, the dark one, or one
based on system settings.
The system settings now only take this flag into account, nothing
else (e.g. not high contrast settings).
The logic which palette is used is rather simple:
• If the user has selected either light or dark in MKVToolNix GUI's
settings, use that one.
• Otherwise look at the application color mode registry key & derive
which palette to use from it.
Fixes#3528.
When following these steps:
1. select multiple tracks
2. open language dialog
3. select anything in the drop-down boxes or enter something in the
line edits
4. hit cancel
5. open the language dialog again
the values selected/entered in step 3 were still selected, even if the
multiple selected tracks had different languages. Additionally the
state of the dialog was always that the value is invalid.
This wasn't intentional; the controls should all be reset to having
nothing selected/entered.
This could also happen under certain circumstances with single
selections.
Part of the fix of #3532.
This only happened when the GUI was configured to have the
component-based controls active when opening the dialog. It could be
triggered by first opening the dialog, selecting the free-form based
editing (here's where the controls got deactivated, closing the dialog
& opening it again (and here they weren't enabled).
Part of the fix of #3532.
Due to a bug in Qt 6.5.0 the dark palette will not be enabled on
certain installations. For those situations a new option was added to
the preferences called "Force the use of the legacy dark palette"
which forces MKVToolNix GUI to use the legacy dark palette, no matter
what Windows 11's application color mode is set to. This option will
be removed once the bug in Qt has been fixed.
This is a workaround for #3528.
Creating a new instance takes a noticeable amount of time for setting
up the all the combo boxes which have more than 10.000 entries in
total. This commit changes the behavior so that the dialog is only
created once: the first time the user wants to edit a
language. Afterwards the instance is cached & reused.
Changes to the preferences that alter the settings concerning the
language dialog will cause the cached instance to be discarded.
Qt 6.5.0 does not support Windows' dark mode on Windows 10
itself. Therefore my custom palette-based variant must be used there.
On Windows 11 it is left to Qt.
The option for disabling the dark mode remains removed as it isn't
possible to disable it in Qt on Windows 11 anymore.
Fixes#3517. See also #3264.
This type of garbage seems to exist before each (most?) sync
frames. ffmpeg contains the same type of code. I'm not sure what this
garbage is supposed to be.
Fixes#3484.