[Mouse Crosshairs] Hide crosshairs when cursor hides (#27381)

* hide crosshairs when cursor hides

* fix formatting
This commit is contained in:
Davide Giacometti
2023-07-18 14:33:32 +02:00
committed by GitHub
parent ed44db25e3
commit 7e4e8f59bb
7 changed files with 143 additions and 18 deletions

View File

@@ -17,6 +17,7 @@ namespace
const wchar_t JSON_KEY_CROSSHAIRS_THICKNESS[] = L"crosshairs_thickness";
const wchar_t JSON_KEY_CROSSHAIRS_BORDER_COLOR[] = L"crosshairs_border_color";
const wchar_t JSON_KEY_CROSSHAIRS_BORDER_SIZE[] = L"crosshairs_border_size";
const wchar_t JSON_KEY_CROSSHAIRS_AUTO_HIDE[] = L"crosshairs_auto_hide";
}
extern "C" IMAGE_DOS_HEADER __ImageBase;
@@ -330,6 +331,16 @@ public:
{
Logger::warn("Failed to initialize border color from settings. Will use default value");
}
try
{
// Parse auto hide
auto jsonPropertiesObject = settingsObject.GetNamedObject(JSON_KEY_PROPERTIES).GetNamedObject(JSON_KEY_CROSSHAIRS_AUTO_HIDE);
inclusiveCrosshairsSettings.crosshairsAutoHide = static_cast<bool>(jsonPropertiesObject.GetNamedBoolean(JSON_KEY_VALUE));
}
catch (...)
{
Logger::warn("Failed to initialize auto hide from settings. Will use default value");
}
}
else
{