[MouseHighlighter]Add always-on pointer (#27186)

* [MouseHighlighter]Add always pointer

Make color pick UI ARGB
Delete Opacity setting

* Fix opacity and color

Fix "always color" incorrectly initialized
Revert default opacity to 65%, which was unintentionally lowered to 25% when
changing to percent

* Fix crash when opening MouseUtils settings page

Migration code was bugged, made malformed json and led to settings page crash.

* Implement migration in module side
This commit is contained in:
hayatogh
2023-07-26 23:48:00 +09:00
committed by GitHub
parent a99b2e0bc0
commit a71411d931
12 changed files with 331 additions and 74 deletions

View File

@@ -19,3 +19,23 @@ inline bool checkValidRGB(std::wstring_view hex, uint8_t* R, uint8_t* G, uint8_t
}
return true;
}
// helper function to get the ARGB from a #FFFFFFFF string.
inline bool checkValidARGB(std::wstring_view hex, uint8_t* A, uint8_t* R, uint8_t* G, uint8_t* B)
{
if (hex.length() != 9)
return false;
hex = hex.substr(1, 8); // remove #
for (auto& c : hex)
{
if (!((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')))
{
return false;
}
}
if (swscanf_s(hex.data(), L"%2hhx%2hhx%2hhx%2hhx", A, R, G, B) != 4)
{
return false;
}
return true;
}