Skip to content

Commit

Permalink
[win] fix top border accent color for win10
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplestStudio committed Sep 16, 2024
1 parent 6dfdab2 commit 256b946
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion win-linux/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,11 @@ namespace WindowHelper {
*(FARPROC*)&DwmGetColorizationColor = GetProcAddress(module, "DwmGetColorizationColor");
}
if (DwmGetColorizationColor && SUCCEEDED(DwmGetColorizationColor(&dwcolor, &opaque))) {
return QColor((dwcolor & 0xff0000) >> 16, (dwcolor & 0xff00) >> 8, dwcolor & 0xff);
float a = (float)((dwcolor >> 24) & 0xff)/255;
int r = (int)(((dwcolor >> 16) & 0xff) * a + 255 * (1 - a));
int g = (int)(((dwcolor >> 8) & 0xff) * a + 255 * (1 - a));
int b = (int)((dwcolor & 0xff) * a + 255 * (1 - a));
return QColor(r, g, b);
}
} else {
QSettings reg_lt("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", QSettings::NativeFormat);
Expand Down

0 comments on commit 256b946

Please sign in to comment.