The `QtUtils::AdjustSizeWithinScreen()` function now centers the
widget on their parent window after the widget's size is adjusted. This
is required in some desktop environments (generally on Linux systems) to
ensure that the just-resized widget remains aligned with its parent
window.
The creation of the **Cheats Manager** dialog is now deferred to first
show, as creating it within the main window's constructor prevents the
dialog from knowing the real position of its parent window, which is
only properly calculated on first show.
For the same reasons, the analytics prompt is now shown only when the
application is ready (i.e. when the main window has been shown).
| Before | After |
| ------ | ----- |
| <img width="1920" height="1080" alt="[Dolphin Emulator] Misplaced analytics prompt" title="[Dolphin Emulator] Misplaced analytics prompt" src="https://github.com/user-attachments/assets/c3e43b3b-cf79-4398-b531-7de6068c583e" /> | <img width="1920" height="1080" alt="[Dolphin Emulator] Centered analytics prompt" title="[Dolphin Emulator] Centered analytics prompt" src="https://github.com/user-attachments/assets/a10d06d9-7438-4032-b96c-dfcb48826349" /> |
| <img width="1920" height="1080" alt="[Dolphin Emulator] Misplaced Settings dialog" title="[Dolphin Emulator] Misplaced Settings dialog" src="https://github.com/user-attachments/assets/f35b10ee-4f07-48d4-86f9-2537ad5ca7ca" /> | <img width="1920" height="1080" alt="[Dolphin Emulator] Centered Settings dialog" title="[Dolphin Emulator] Centered Settings dialog" src="https://github.com/user-attachments/assets/33e37237-77a4-44f6-a0e2-b709f65b672b" /> |
| <img width="1920" height="1080" alt="[Dolphin Emulator] Misplaced Cheats Manager dialog" title="[Dolphin Emulator] Misplaced Cheats Manager dialog" src="https://github.com/user-attachments/assets/1fbd3836-5639-4d5a-b57e-e2e21f21c9db" /> | <img width="1920" height="1080" alt="[Dolphin Emulator] Centered Cheats Manager dialog" title="[Dolphin Emulator] Centered Cheats Manager dialog" src="https://github.com/user-attachments/assets/3f2b1b50-de16-49b7-bac4-c444c6cab0bc" /> |
Remove window hints clearing the flag Qt::WindowContextHelpButtonHint,
which is already off by default in Qt 6.
In Qt 5 this flag was set by default for QDialogs, and on Windows put a
? button in the corner of the title bar allowing users to activate Qt's
QWhatsThis help system for a given widget. Since we don't set that text
the ? button was useless and so we hid it manually.
A new class that derives from `QMenu` has been introduced. Menus of this
`NonAutodismissibleMenu` type will stay visible when a _checkable_
action is triggered.
This is convenient in menus that feature a series of check boxes that
toggle visibility of third components (e.g. the **List Columns** menu),
allowing the user to toggle several actions at once.
For now, the new type is used in the top menu bar.
Use QObject->deleteLater() instead of the delete operator to destroy
child widgets of the layout. This prevents crashes caused by pending
events trying to access the now-destroyed widget.
Fixes dynamically changing dpi scaling.
Load resources from svg if possible.
Currently svg support is not in Qt build in Externals,
and image files need to be added later.
Previously, if you have "Hotkeys Require Window Focus" disabled, you could repeatedly use the "Open" hotkey, for example, to stack File Open windows over top of each other over and over.
This commit allows the hotkey manager to disable/enable on QFileDialog creation and destruction.
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
This function has been marked as obsolete. In Qt 6.0 it's removed
entirely, so we must use getContentsMargin() explicitly instead
(margin() would do this for us).
Ditto for setMargin(), in which case we use setContentsMargin instead.
setMargin() would just pass its argument to all four parameters of
setContentsMargin(), so we can do the same.
I believe the value returned by value() resets when we call
setValue() with the maximum (due to auto-reset). I have been
unable to test this because I can't reproduce the issue, which is
described at https://bugs.dolphin-emu.org/issues/12158#note-9.