feat: Allow switching off borderless window mode

This commit is contained in:
WerWolv
2024-02-11 14:12:14 +01:00
parent daf4e5cad6
commit 5cfcca0bc4
11 changed files with 47 additions and 39 deletions

View File

@@ -35,11 +35,7 @@ static void detectSystemTheme() {
auto error = RegQueryValueEx(hkey, "AppsUseLightTheme", nullptr, nullptr, reinterpret_cast<LPBYTE>(&value), &size);
if (error == ERROR_SUCCESS) {
RequestChangeTheme::post(value == 0 ? "Dark" : "Light");
} else {
ImHexApi::System::impl::setBorderlessWindowMode(false);
}
} else {
ImHexApi::System::impl::setBorderlessWindowMode(false);
}
});
@@ -51,13 +47,6 @@ static void detectSystemTheme() {
});
}
static void checkBorderlessWindowOverride() {
bool borderlessWindowForced = ContentRegistry::Settings::read<bool>("hex.builtin.setting.interface", "hex.builtin.setting.interface.force_borderless_window_mode", false);
if (borderlessWindowForced)
ImHexApi::System::impl::setBorderlessWindowMode(true);
}
IMHEX_PLUGIN_SETUP("Windows", "WerWolv", "Windows-only features") {
using namespace hex::plugin::windows;
@@ -71,5 +60,4 @@ IMHEX_PLUGIN_SETUP("Windows", "WerWolv", "Windows-only features") {
registerSettings();
detectSystemTheme();
checkBorderlessWindowOverride();
}