mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+chg: Workaround to fix DPI scaling issues related to VS2022 compiler toolset
+fix: don't store contrast adapted dark mode foreground color themes
This commit is contained in:
parent
5e8da0b976
commit
7fe5558a09
41
Version.ps1
41
Version.ps1
@ -45,14 +45,14 @@ try
|
||||
|
||||
if ($AppVeyorEnv) {
|
||||
if ($LastBuildDay -ne "$Revis") {
|
||||
$Revis | Set-Content "Versions\day.txt"
|
||||
$Revis | Set-Content -Path "Versions\day.txt"
|
||||
$Build = 1 # reset (AppVeyor)
|
||||
}
|
||||
$CommitID = ([string]($env:appveyor_repo_commit)).substring(0,8)
|
||||
}
|
||||
else {
|
||||
if ($LastBuildDay -ne "$Revis") {
|
||||
$Revis | Set-Content "Versions\day.txt"
|
||||
$Revis | Set-Content -Path "Versions\day.txt"
|
||||
$Build = 0 # reset (local build)
|
||||
}
|
||||
# locally: increase build number and persit it
|
||||
@ -73,7 +73,7 @@ try
|
||||
}
|
||||
}
|
||||
if (!$CommitID) { $CommitID = "---" }
|
||||
$Build | Set-Content "Versions\build.txt"
|
||||
$Build | Set-Content -Path "Versions\build.txt"
|
||||
|
||||
$CompleteVer = "$Major.$Minor.$Revis.$Build"
|
||||
DebugOutput("Notepad3 version number: 'v$CompleteVer $VerPatch'")
|
||||
@ -101,24 +101,25 @@ try
|
||||
#~if ($VerPatch) { $VerPatch = " $VerPatch" } # ensure space in front of string
|
||||
|
||||
Copy-Item -LiteralPath "Versions\VersionEx.h.tpl" -Destination "src\VersionEx.h" -Force
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$APPNAME\$', "$AppName" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$MAJOR\$', "$Major" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$MINOR\$', "$Minor" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$MAINT\$', "$Revis" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$BUILD\$', "$Build" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$SCIVER\$', "$SciVer" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$LXIVER\$', "$LxiVer" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$ONIGURUMAVER\$', "$OnigVer" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$UCHARDETVER\$', "$UChardetVer" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$TINYEXPRVER\$', "$TinyExprVer" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$UTHASHVER\$', "$UtHashVer" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$VERPATCH\$', "$VerPatch" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$COMMITID\$', "$CommitID" } | Set-Content "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$APPNAME\$', "$AppName" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$MAJOR\$', "$Major" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$MINOR\$', "$Minor" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$MAINT\$', "$Revis" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$BUILD\$', "$Build" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$SCIVER\$', "$SciVer" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$LXIVER\$', "$LxiVer" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$ONIGURUMAVER\$', "$OnigVer" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$UCHARDETVER\$', "$UChardetVer" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$TINYEXPRVER\$', "$TinyExprVer" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$UTHASHVER\$', "$UtHashVer" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$VERPATCH\$', "$VerPatch" } | Set-Content -Path "src\VersionEx.h"
|
||||
(Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$COMMITID\$', "$CommitID" } | Set-Content -Path "src\VersionEx.h"
|
||||
|
||||
Copy-Item -LiteralPath "Versions\Notepad3.exe.manifest.tpl" -Destination "res\Notepad3.exe.manifest.conf" -Force
|
||||
(Get-Content "res\Notepad3.exe.manifest.conf") | ForEach-Object { $_ -replace '\$APPNAME\$', "$AppName" } | Set-Content "res\Notepad3.exe.manifest.conf"
|
||||
(Get-Content "res\Notepad3.exe.manifest.conf") | ForEach-Object { $_ -replace '\$VERPATCH\$', "$VerPatch" } | Set-Content "res\Notepad3.exe.manifest.conf"
|
||||
(Get-Content "res\Notepad3.exe.manifest.conf") | ForEach-Object { $_ -replace '\$VERSION\$', "$CompleteVer" } | Set-Content "res\Notepad3.exe.manifest.conf"
|
||||
$confManifest = "res\Notepad3.exe.conf.manifest"
|
||||
Copy-Item -LiteralPath "Versions\Notepad3.exe.manifest.tpl" -Destination $confManifest -Force
|
||||
(Get-Content $confManifest) | ForEach-Object { $_ -replace '\$APPNAME\$', "$AppName" } | Set-Content -Path $confManifest
|
||||
(Get-Content $confManifest) | ForEach-Object { $_ -replace '\$VERPATCH\$', "$VerPatch" } | Set-Content -Path $confManifest
|
||||
(Get-Content $confManifest) | ForEach-Object { $_ -replace '\$VERSION\$', "$CompleteVer" } | Set-Content -Path $confManifest
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity
|
||||
name="Rizonesoft.$APPNAME$"
|
||||
processorArchitecture="*"
|
||||
version="$VERSION$"
|
||||
type="win32"
|
||||
/>
|
||||
<description>$APPNAME$ $VERPATCH$</description>
|
||||
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity
|
||||
name="Rizonesoft.$APPNAME$"
|
||||
version="$VERSION$"
|
||||
processorArchitecture="*"
|
||||
type="win32"
|
||||
/>
|
||||
<description>$APPNAME$ $VERPATCH$</description>
|
||||
</assembly>
|
||||
|
||||
11
res/Notepad3.exe.conf.manifest
Normal file
11
res/Notepad3.exe.conf.manifest
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity
|
||||
name="Rizonesoft.Notepad3"
|
||||
version="5.22.1105.5"
|
||||
processorArchitecture="*"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Notepad3 beta</description>
|
||||
</assembly>
|
||||
@ -1,50 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<description>Notepad3</description>
|
||||
<msix xmlns="urn:schemas-microsoft-com:msix.v1"
|
||||
publisher="CN=Rizonesoft"
|
||||
packageName="RizonesoftNotepad3"
|
||||
applicationId="RizonesoftNotepad3"/>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- Vista -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <!-- 7 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <!-- 8 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- 8.1 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> <!-- 10 -->
|
||||
</application>
|
||||
</compatibility>
|
||||
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||
<dpiAware>true/PM</dpiAware>
|
||||
</asmv3:windowsSettings>
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
|
||||
<dpiAwareness>PerMonitorV2,PerMonitor</dpiAwareness>
|
||||
</asmv3:windowsSettings>
|
||||
<asmv3:windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
|
||||
<ws2:longPathAware>true</ws2:longPathAware>
|
||||
</asmv3:windowsSettings>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<msix xmlns="urn:schemas-microsoft-com:msix.v1" publisher="CN=Rizonesoft" packageName="RizonesoftNotepad3" applicationId="RizonesoftNotepad3"/>
|
||||
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||
<!-- <dpiAware>true/PM</dpiAware> -->
|
||||
<dpiAware>true/PM</dpiAware>
|
||||
</asmv3:windowsSettings>
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
|
||||
<!-- <dpiAwareness>PerMonitorV2, PerMonitor</dpiAwareness> -->
|
||||
<dpiAwareness>PerMonitorV2, PerMonitor</dpiAwareness>
|
||||
</asmv3:windowsSettings>
|
||||
<asmv3:windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
|
||||
<ws2:longPathAware>true</ws2:longPathAware>
|
||||
</asmv3:windowsSettings>
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">
|
||||
<gdiScaling>true</gdiScaling>
|
||||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
<gdiScaling>false</gdiScaling> <!-- if set true, no WM_DPICHANGED message is send -->
|
||||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- Vista -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <!-- Win 7 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <!-- Win 8 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- Win 8.1 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> <!-- Win 10 & 11 -->
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity
|
||||
name="Rizonesoft.Notepad3"
|
||||
processorArchitecture="*"
|
||||
version="5.22.1104.1"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Notepad3 beta</description>
|
||||
</assembly>
|
||||
@ -306,7 +306,7 @@ static INT_PTR CALLBACK _InfoBoxLngDlgProc(HWND hwnd, UINT umsg, WPARAM wParam,
|
||||
if (hIconBmp) {
|
||||
SetBitmapControl(hwnd, IDC_INFOBOXICON, hIconBmp);
|
||||
}
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
@ -767,7 +767,7 @@ static INT_PTR CALLBACK CmdLineHelpProc(HWND hwnd, UINT umsg, WPARAM wParam, LPA
|
||||
return TRUE;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
@ -1076,7 +1076,7 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
|
||||
SendDlgItemMessageW(hwnd, IDC_VERSION, WM_SETFONT, (WPARAM)hVersionFont, true);
|
||||
}
|
||||
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1318,7 +1318,7 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -1571,7 +1571,7 @@ static INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -1827,7 +1827,7 @@ static INT_PTR CALLBACK FavoritesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -2045,7 +2045,7 @@ static INT_PTR CALLBACK AddToFavDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPA
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
break;
|
||||
|
||||
|
||||
@ -2349,7 +2349,7 @@ static INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPAR
|
||||
return TRUE;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT *)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
case WM_GETMINMAXINFO:
|
||||
@ -2649,7 +2649,7 @@ static INT_PTR CALLBACK ChangeNotifyDlgProc(HWND hwnd, UINT umsg, WPARAM wParam,
|
||||
return TRUE;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
@ -2811,7 +2811,7 @@ static INT_PTR CALLBACK ColumnWrapDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, L
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -2958,7 +2958,7 @@ static INT_PTR CALLBACK WordWrapSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wPa
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -3102,7 +3102,7 @@ static INT_PTR CALLBACK LongLineSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wPa
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -3260,7 +3260,7 @@ static INT_PTR CALLBACK TabSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPA
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -3435,7 +3435,7 @@ static INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wP
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -3632,7 +3632,7 @@ static INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -3862,7 +3862,7 @@ static INT_PTR CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wP
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
@ -6255,19 +6255,22 @@ void SetUACIcon(HWND hwnd, const HMENU hMenu, const UINT nItem)
|
||||
//
|
||||
// UpdateWindowLayoutForDPI()
|
||||
//
|
||||
void UpdateWindowLayoutForDPI(HWND hwnd, const RECT *pNewRect, const UINT adpi) {
|
||||
|
||||
#define USE_RECT_FOR_WIN_POS true
|
||||
|
||||
void UpdateWindowLayoutForDPI(HWND hwnd, const RECT *pNewRect, const UINT dpi)
|
||||
{
|
||||
UINT const uWndFlags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED; //~ SWP_NOMOVE | SWP_NOSIZE | SWP_NOREPOSITION
|
||||
|
||||
if (pNewRect) {
|
||||
if (pNewRect && (USE_RECT_FOR_WIN_POS || (dpi == 0))) {
|
||||
SetWindowPos(hwnd, NULL, pNewRect->left, pNewRect->top,
|
||||
(pNewRect->right - pNewRect->left), (pNewRect->bottom - pNewRect->top), uWndFlags);
|
||||
} else {
|
||||
RECT rc = { 0 };
|
||||
GetWindowRect(hwnd, &rc);
|
||||
//~MapWindowPoints(NULL, hWnd, (LPPOINT)&rc, 2);
|
||||
UINT const dpi = adpi ? adpi : Scintilla_GetWindowDPI(hwnd);
|
||||
Scintilla_AdjustWindowRectForDpi((LPWRECT)&rc, uWndFlags, 0, dpi);
|
||||
UINT const _dpi = (dpi < (USER_DEFAULT_SCREEN_DPI >> 2)) ? Scintilla_GetWindowDPI(hwnd) : dpi;
|
||||
Scintilla_AdjustWindowRectForDpi((LPWRECT)&rc, uWndFlags, 0, _dpi);
|
||||
SetWindowPos(hwnd, NULL, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), uWndFlags);
|
||||
}
|
||||
RedrawWindow(hwnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_ERASE | RDW_INTERNALPAINT | RDW_ALLCHILDREN | RDW_UPDATENOW);
|
||||
@ -6425,7 +6428,7 @@ INT_PTR CALLBACK FontDialogHookProc(
|
||||
case WM_DPICHANGED:
|
||||
dpi = LOWORD(wParam);
|
||||
//dpi.y = HIWORD(wParam);
|
||||
UpdateWindowLayoutForDPI(hdlg, (RECT *)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hdlg, (RECT*)lParam, LOWORD(wParam));
|
||||
int const ctl[] = { cmb1, cmb2, cmb3, cmb4, cmb5 };
|
||||
for (int i = 0; i < COUNTOF(ctl); ++i) {
|
||||
HFONT const hFont = (HFONT)SendMessage(GetDlgItem(hdlg, ctl[i]), WM_GETFONT, 0, 0);
|
||||
@ -6527,7 +6530,7 @@ INT_PTR CALLBACK ColorDialogHookProc(
|
||||
case WM_DPICHANGED:
|
||||
dpi = LOWORD(wParam);
|
||||
//dpi.y = HIWORD(wParam);
|
||||
UpdateWindowLayoutForDPI(hdlg, (RECT *)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hdlg, (RECT*)lParam, LOWORD(wParam));
|
||||
int const ctl[] = { COLOR_ADD, COLOR_MIX, IDOK, IDCANCEL };
|
||||
for (int i = 0; i < COUNTOF(ctl); ++i) {
|
||||
HFONT const hFont = (HFONT)SendMessage(GetDlgItem(hdlg, ctl[i]), WM_GETFONT, 0, 0);
|
||||
|
||||
38
src/Edit.c
38
src/Edit.c
@ -6408,11 +6408,9 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
return FALSE;
|
||||
|
||||
|
||||
case WM_DPICHANGED: {
|
||||
UINT const dpi = LOWORD(wParam);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT *)lParam, dpi);
|
||||
}
|
||||
return TRUE; // further processing
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE; // further processing
|
||||
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
@ -8346,11 +8344,9 @@ static INT_PTR CALLBACK EditLinenumDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPA
|
||||
return true;
|
||||
|
||||
|
||||
case WM_DPICHANGED: {
|
||||
UINT const dpi = LOWORD(wParam);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT *)lParam, dpi);
|
||||
}
|
||||
return true;
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
@ -8539,9 +8535,7 @@ static INT_PTR CALLBACK EditModifyLinesDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
}
|
||||
hFontHover = CreateFontIndirectW(&lf);
|
||||
}
|
||||
//~UINT const dpi = LOWORD(wParam);
|
||||
//~UpdateWindowLayoutForDPI(hwnd, NULL, dpi);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
@ -8751,8 +8745,8 @@ static INT_PTR CALLBACK EditAlignDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
return true;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
return true;
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
|
||||
@ -8867,7 +8861,7 @@ static INT_PTR CALLBACK EditEncloseSelectionDlgProc(HWND hwnd, UINT umsg, WPARAM
|
||||
return TRUE;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
@ -8986,11 +8980,11 @@ static INT_PTR CALLBACK EditInsertTagDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,L
|
||||
PostMessageW(GetDlgItem(hwnd, 100), EM_SETSEL, 1, (LPARAM)(StringCchLen(pData->pwsz1, 0) - 1));
|
||||
CenterDlgInParent(hwnd, NULL);
|
||||
}
|
||||
return false;
|
||||
return FALSE;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
return true;
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
|
||||
@ -9209,11 +9203,11 @@ static INT_PTR CALLBACK EditSortDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
}
|
||||
CenterDlgInParent(hwnd, NULL);
|
||||
}
|
||||
return true;
|
||||
return TRUE;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
return true;
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
|
||||
|
||||
@ -46,14 +46,14 @@
|
||||
|
||||
|
||||
#if (defined(_DEBUG) || defined(DEBUG)) && !defined(NDEBUG)
|
||||
void DbgLog(const char *fmt, ...)
|
||||
void DbgLog(const wchar_t *fmt, ...)
|
||||
{
|
||||
char buf[1024] = "";
|
||||
static wchar_t buf[2048] = { 0 };
|
||||
va_list va;
|
||||
va_start(va, fmt);
|
||||
wvsprintfA(buf, fmt, va);
|
||||
wvnsprintfW(buf, COUNTOF(buf), fmt, va);
|
||||
va_end(va);
|
||||
OutputDebugStringA(buf);
|
||||
OutputDebugStringW(buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ inline size_t SizeOfMem(LPCVOID lpMem)
|
||||
// ============================================================================
|
||||
|
||||
#if (defined(_DEBUG) || defined(DEBUG)) && !defined(NDEBUG)
|
||||
void DbgLog(const char *fmt, ...);
|
||||
void DbgLog(const wchar_t *fmt, ...);
|
||||
#else
|
||||
#define DbgLog(fmt, ...) NOOP
|
||||
#endif
|
||||
|
||||
@ -1128,8 +1128,8 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
|
||||
Style_ImportTheme(-1); // init (!)
|
||||
Style_ImportTheme(Globals.uCurrentThemeIndex);
|
||||
|
||||
//SetProcessDPIAware(); -> .manifest
|
||||
//SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
|
||||
//SetProcessDPIAware(); // ->.manifest
|
||||
//SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
||||
//~Scintilla_LoadDpiForWindow(); done in Sci::Platform_Initialize();
|
||||
|
||||
// ----------------------------------------------------
|
||||
@ -1265,6 +1265,7 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
|
||||
|
||||
MSG msg;
|
||||
while (GetMessage(&msg,NULL,0,0)) {
|
||||
|
||||
if (IsWindow(Globals.hwndDlgFindReplace) && ((msg.hwnd == Globals.hwndDlgFindReplace) || IsChild(Globals.hwndDlgFindReplace, msg.hwnd))) {
|
||||
const int iTr = TranslateAccelerator(Globals.hwndDlgFindReplace, hAccFindReplace, &msg);
|
||||
if (iTr || IsDialogMessage(Globals.hwndDlgFindReplace, &msg)) {
|
||||
@ -3195,12 +3196,14 @@ LRESULT MsgEndSession(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
//
|
||||
LRESULT MsgDPIChanged(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
//UINT const dpi = LOWORD(wParam);
|
||||
UINT const dpi = LOWORD(wParam);
|
||||
DbgLog(L"MsgDPIChanged() -> %u\n", dpi);
|
||||
|
||||
const RECT* const rc = (RECT*)lParam;
|
||||
|
||||
DocPos const pos = SciCall_GetCurrentPos();
|
||||
|
||||
UpdateWindowLayoutForDPI(hwnd, rc, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, rc, dpi);
|
||||
|
||||
SendMessage(Globals.hwndEdit, WM_DPICHANGED, wParam, lParam);
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='15.0'">v141</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='16.0'">v142</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v143</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v142</PlatformToolset>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
@ -49,7 +49,7 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='15.0'">v141</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='16.0'">v142</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v143</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v142</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
@ -60,7 +60,7 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='15.0'">v141</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='16.0'">v142</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v143</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v142</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
@ -70,7 +70,7 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='15.0'">v141</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='16.0'">v142</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v143</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v142</PlatformToolset>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
@ -81,7 +81,7 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='15.0'">v141</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='16.0'">v142</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v143</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v142</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
@ -91,7 +91,7 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='15.0'">v141</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='16.0'">v142</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v143</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)'=='17.0'">v142</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
@ -123,36 +123,42 @@
|
||||
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
|
||||
<EmbedManifest>true</EmbedManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
|
||||
<EmbedManifest>true</EmbedManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Dbg|Win32'">
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
|
||||
<EmbedManifest>true</EmbedManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
|
||||
<EmbedManifest>true</EmbedManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
|
||||
<EmbedManifest>true</EmbedManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Dbg|x64'">
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
|
||||
<EmbedManifest>true</EmbedManifest>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
@ -213,8 +219,7 @@
|
||||
</InputResourceManifests>
|
||||
</Manifest>
|
||||
<Manifest>
|
||||
<OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).embed.manifest</OutputManifestFile>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).manifest.conf</AdditionalManifestFiles>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).conf.manifest</AdditionalManifestFiles>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
<ManifestResourceCompile>
|
||||
@ -288,8 +293,7 @@
|
||||
</InputResourceManifests>
|
||||
</Manifest>
|
||||
<Manifest>
|
||||
<OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).embed.manifest</OutputManifestFile>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).manifest.conf</AdditionalManifestFiles>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).conf.manifest</AdditionalManifestFiles>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
<ManifestResourceCompile>
|
||||
@ -373,8 +377,7 @@
|
||||
</InputResourceManifests>
|
||||
</Manifest>
|
||||
<Manifest>
|
||||
<OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).embed.manifest</OutputManifestFile>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).manifest.conf</AdditionalManifestFiles>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).conf.manifest</AdditionalManifestFiles>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
<ManifestResourceCompile>
|
||||
@ -452,8 +455,7 @@
|
||||
</InputResourceManifests>
|
||||
</Manifest>
|
||||
<Manifest>
|
||||
<OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).embed.manifest</OutputManifestFile>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).manifest.conf</AdditionalManifestFiles>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).conf.manifest</AdditionalManifestFiles>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
<ManifestResourceCompile>
|
||||
@ -536,8 +538,7 @@
|
||||
</InputResourceManifests>
|
||||
</Manifest>
|
||||
<Manifest>
|
||||
<OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).embed.manifest</OutputManifestFile>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).manifest.conf</AdditionalManifestFiles>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).conf.manifest</AdditionalManifestFiles>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
<ManifestResourceCompile>
|
||||
@ -614,8 +615,7 @@
|
||||
</InputResourceManifests>
|
||||
</Manifest>
|
||||
<Manifest>
|
||||
<OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).embed.manifest</OutputManifestFile>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).manifest.conf</AdditionalManifestFiles>
|
||||
<AdditionalManifestFiles>$(ProjDir)..\res\$(TargetName)$(TargetExt).conf.manifest</AdditionalManifestFiles>
|
||||
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
|
||||
</Manifest>
|
||||
<ManifestResourceCompile>
|
||||
|
||||
@ -99,7 +99,7 @@ static UINT_PTR CALLBACK _LPPrintHookProc(HWND hwnd, UINT uiMsg, WPARAM wParam,
|
||||
break;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
break;
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
@ -612,7 +612,7 @@ static UINT_PTR CALLBACK _LPSetupHookProc(HWND hwnd, UINT uiMsg, WPARAM wParam,
|
||||
break;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT *)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
break;
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
|
||||
132
src/Styles.c
132
src/Styles.c
@ -1334,7 +1334,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
pCurrentStandard->Styles[STY_BRACE_OK].szValue); // brace light
|
||||
}
|
||||
else {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_BRACE_OK].szValue, FOREGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_BRACE_OK].szValue, FOREGROUND_LAYER, &dColor, NULL, false)) {
|
||||
SciCall_IndicSetFore(INDIC_NP3_MATCH_BRACE, dColor);
|
||||
}
|
||||
if (Style_StrGetAlpha(pCurrentStandard->Styles[STY_BRACE_OK].szValue, &iValue, true)) {
|
||||
@ -1363,7 +1363,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
pCurrentStandard->Styles[STY_BRACE_BAD].szValue); // brace bad
|
||||
}
|
||||
else {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_BRACE_BAD].szValue, FOREGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_BRACE_BAD].szValue, FOREGROUND_LAYER, &dColor, NULL, false)) {
|
||||
SciCall_IndicSetFore(INDIC_NP3_BAD_BRACE, dColor);
|
||||
}
|
||||
if (Style_StrGetAlpha(pCurrentStandard->Styles[STY_BRACE_BAD].szValue, &iValue, true)) {
|
||||
@ -1389,7 +1389,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
}
|
||||
|
||||
// Occurrences Marker
|
||||
if (!Style_StrGetColor(pCurrentStandard->Styles[STY_MARK_OCC].szValue, FOREGROUND_LAYER, &dColor, false)) {
|
||||
if (!Style_StrGetColor(pCurrentStandard->Styles[STY_MARK_OCC].szValue, FOREGROUND_LAYER, &dColor, NULL, false)) {
|
||||
dColor = GetSysColor(COLOR_HIGHLIGHT);
|
||||
WCHAR sty[32] = { L'\0' };
|
||||
Style_PrintfCchColor(sty, COUNTOF(sty), L"; ", FOREGROUND_LAYER, dColor);
|
||||
@ -1435,7 +1435,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
SciCall_IndicSetStrokeWidth(INDIC_NP3_UNICODE_POINT, iValue);
|
||||
}
|
||||
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_UNICODE_HOTSPOT].szValue, FOREGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_UNICODE_HOTSPOT].szValue, FOREGROUND_LAYER, &dColor, NULL, false)) {
|
||||
SciCall_IndicSetHoverFore(INDIC_NP3_UNICODE_POINT, dColor);
|
||||
}
|
||||
if (Style_StrGetAlpha(pCurrentStandard->Styles[STY_UNICODE_HOTSPOT].szValue, &iValue, true)) {
|
||||
@ -1455,7 +1455,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
SciCall_IndicSetHoverStyle(INDIC_NP3_UNICODE_POINT, iValue);
|
||||
|
||||
// Multi Edit Indicator
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_MULTI_EDIT].szValue, FOREGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_MULTI_EDIT].szValue, FOREGROUND_LAYER, &dColor, NULL, false)) {
|
||||
SciCall_IndicSetFore(INDIC_NP3_MULTI_EDIT, dColor);
|
||||
}
|
||||
if (Style_StrGetAlpha(pCurrentStandard->Styles[STY_MULTI_EDIT].szValue, &iValue, true)) {
|
||||
@ -1486,7 +1486,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
#define _SC_INDIC_IME_UNKNOWN INDIC_IME_MAX
|
||||
|
||||
COLORREF rgb = RGB(0xFF, 0xA0, 0x00);
|
||||
Style_StrGetColor(pCurrentStandard->Styles[STY_IME_COLOR].szValue, FOREGROUND_LAYER, &rgb, true); // IME foregr
|
||||
Style_StrGetColor(pCurrentStandard->Styles[STY_IME_COLOR].szValue, FOREGROUND_LAYER, &rgb, NULL, true); // IME foregr
|
||||
SciCall_IndicSetFore(_SC_INDIC_IME_INPUT, rgb);
|
||||
SciCall_IndicSetFore(_SC_INDIC_IME_TARGET, rgb);
|
||||
SciCall_IndicSetFore(_SC_INDIC_IME_CONVERTED, rgb);
|
||||
@ -1497,7 +1497,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
}
|
||||
Style_SetStyles(hwnd, pCurrentStandard->Styles[STY_INDENT_GUIDE].iStyle, pCurrentStandard->Styles[STY_INDENT_GUIDE].szValue); // indent guide
|
||||
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_SEL_TXT].szValue, FOREGROUND_LAYER, &rgb, false)) { // selection fore
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_SEL_TXT].szValue, FOREGROUND_LAYER, &rgb, NULL, false)) { // selection fore
|
||||
SciCall_SetElementColour(SC_ELEMENT_SELECTION_TEXT, RGBxA(rgb, SC_ALPHA_OPAQUE));
|
||||
SciCall_SetElementColour(SC_ELEMENT_SELECTION_ADDITIONAL_TEXT, RGBxA(rgb, SC_ALPHA_OPAQUE));
|
||||
}
|
||||
@ -1508,7 +1508,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
|
||||
rgb = RGB(0xC0, 0xC0, 0xC0);
|
||||
SciCall_SetSelectionLayer(SC_LAYER_UNDER_TEXT); // selection back
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_SEL_TXT].szValue, BACKGROUND_LAYER, &rgb, true)) {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_SEL_TXT].szValue, BACKGROUND_LAYER, &rgb, NULL, true)) {
|
||||
Style_StrGetAlpha(pCurrentStandard->Styles[STY_SEL_TXT].szValue, &iValue, true);
|
||||
SciCall_SetElementColour(SC_ELEMENT_SELECTION_BACK, RGBxA(rgb, iValue));
|
||||
SciCall_SetElementColour(SC_ELEMENT_SELECTION_ADDITIONAL_BACK, RGBxA(rgb, iValue * 2 / 3));
|
||||
@ -1543,7 +1543,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
|
||||
// whitespace colors
|
||||
rgb = RGB(0, 0, 0);
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_WHITESPACE].szValue, FOREGROUND_LAYER, &rgb, false)) {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_WHITESPACE].szValue, FOREGROUND_LAYER, &rgb, NULL, false)) {
|
||||
Style_PrintfCchColor(wch, COUNTOF(wch), L"; ", FOREGROUND_LAYER, rgb);
|
||||
StringCchCat(wchSpecificStyle, COUNTOF(wchSpecificStyle), wch);
|
||||
|
||||
@ -1558,7 +1558,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
}
|
||||
|
||||
rgb = RGB(0, 0, 0);
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_WHITESPACE].szValue, BACKGROUND_LAYER, &rgb, true)) {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_WHITESPACE].szValue, BACKGROUND_LAYER, &rgb, NULL, true)) {
|
||||
Style_PrintfCchColor(wch, COUNTOF(wch), L"; ", FOREGROUND_LAYER, rgb);
|
||||
StringCchCat(wchSpecificStyle, COUNTOF(wchSpecificStyle), wch);
|
||||
|
||||
@ -1627,7 +1627,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
}
|
||||
// caret fore
|
||||
rgb = GetModeTextColor(UseDarkMode());
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_CARET].szValue, FOREGROUND_LAYER, &rgb, false)) {
|
||||
if (Style_StrGetColor(pCurrentStandard->Styles[STY_CARET].szValue, FOREGROUND_LAYER, &rgb, NULL, false)) {
|
||||
Style_PrintfCchColor(wch, COUNTOF(wch), L"; ", FOREGROUND_LAYER, rgb);
|
||||
StringCchCat(wchSpecificStyle,COUNTOF(wchSpecificStyle),wch);
|
||||
}
|
||||
@ -1873,10 +1873,10 @@ void Style_SetUrlHotSpot(HWND hwnd)
|
||||
}
|
||||
|
||||
COLORREF activeFG = RGB(0x00, 0x00, 0xE0);
|
||||
Style_StrGetColor(lpszStyleHotSpot, FOREGROUND_LAYER, &activeFG, false);
|
||||
Style_StrGetColor(lpszStyleHotSpot, FOREGROUND_LAYER, &activeFG, NULL, false);
|
||||
|
||||
COLORREF inactiveFG = RGB(0x00, 0x60, 0xB0);
|
||||
Style_StrGetColor(lpszStyleHotSpot, BACKGROUND_LAYER, &inactiveFG, false);
|
||||
Style_StrGetColor(lpszStyleHotSpot, BACKGROUND_LAYER, &inactiveFG, NULL, false);
|
||||
|
||||
int iValue = SC_ALPHA_OPAQUE;
|
||||
Style_StrGetAlpha(lpszStyleHotSpot, &iValue, true);
|
||||
@ -1944,11 +1944,11 @@ void Style_SetMultiEdgeLine(const int colVec[], const size_t count)
|
||||
Globals.iWrapCol = iLongLineLimit; // long line limit should be explicit wrap column too
|
||||
|
||||
if (mLongLineMode == EDGE_BACKGROUND) {
|
||||
if (!Style_StrGetColor(GetCurrentStdLexer()->Styles[STY_LONG_LN_MRK].szValue, BACKGROUND_LAYER, &rgb, false)) { // edge back
|
||||
if (!Style_StrGetColor(GetCurrentStdLexer()->Styles[STY_LONG_LN_MRK].szValue, BACKGROUND_LAYER, &rgb, NULL, false)) { // edge back
|
||||
rgb = GetSysColor(COLOR_3DSHADOW);
|
||||
}
|
||||
} else {
|
||||
if (!Style_StrGetColor(GetCurrentStdLexer()->Styles[STY_LONG_LN_MRK].szValue, FOREGROUND_LAYER, &rgb, false)) { // edge fore
|
||||
if (!Style_StrGetColor(GetCurrentStdLexer()->Styles[STY_LONG_LN_MRK].szValue, FOREGROUND_LAYER, &rgb, NULL, false)) { // edge fore
|
||||
rgb = GetSysColor(COLOR_3DLIGHT);
|
||||
}
|
||||
}
|
||||
@ -1991,7 +1991,7 @@ void Style_HighlightCurrentLine(HWND hwnd, int iHiLitCurLn)
|
||||
LPCWSTR szValue = GetCurrentStdLexer()->Styles[STY_CUR_LN].szValue;
|
||||
|
||||
COLORREF rgb;
|
||||
if (!Style_StrGetColor(szValue, (backgrColor ? BACKGROUND_LAYER : FOREGROUND_LAYER), &rgb, false)) {
|
||||
if (!Style_StrGetColor(szValue, (backgrColor ? BACKGROUND_LAYER : FOREGROUND_LAYER), &rgb, NULL, false)) {
|
||||
rgb = (backgrColor ? RGB(0xFF, 0xFF, 0x00) : RGB(0xC2, 0xC0, 0xC3));
|
||||
}
|
||||
|
||||
@ -2079,25 +2079,25 @@ void Style_SetMargin(HWND hwnd, LPCWSTR lpszStyle) /// iStyle == STYLE_LINENUMBE
|
||||
COLORREF colorRead;
|
||||
|
||||
// foreground
|
||||
if (!Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &colorRead, false)) {
|
||||
if (!Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
colorRead = GetModeTextColor(UseDarkMode());
|
||||
}
|
||||
COLORREF const clrLineNumFore = colorRead;
|
||||
SciCall_StyleSetFore(STYLE_LINENUMBER, clrLineNumFore);
|
||||
|
||||
// background
|
||||
if (!Style_StrGetColor(lpszStyle, BACKGROUND_LAYER, &colorRead, false)) {
|
||||
if (!Style_StrGetColor(lpszStyle, BACKGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
colorRead = GetModeBtnfaceColor(UseDarkMode());
|
||||
}
|
||||
COLORREF const clrMarginBack = colorRead;
|
||||
|
||||
COLORREF fldHiLight = clrLineNumFore;
|
||||
const WCHAR* wchHighlightStyleStrg = GetCurrentStdLexer()->Styles[STY_SEL_TXT].szValue;
|
||||
Style_StrGetColor(wchHighlightStyleStrg, FOREGROUND_LAYER, &fldHiLight, true);
|
||||
Style_StrGetColor(wchHighlightStyleStrg, FOREGROUND_LAYER, &fldHiLight, NULL, true);
|
||||
|
||||
COLORREF clrFoldMarginBack = clrMarginBack;
|
||||
const WCHAR* wchDefaultStyleStrg = GetCurrentStdLexer()->Styles[STY_DEFAULT].szValue;
|
||||
Style_StrGetColor(wchDefaultStyleStrg, BACKGROUND_LAYER, &clrFoldMarginBack, true);
|
||||
Style_StrGetColor(wchDefaultStyleStrg, BACKGROUND_LAYER, &clrFoldMarginBack, NULL, true);
|
||||
|
||||
|
||||
// --- Line Numbers ---
|
||||
@ -2117,12 +2117,12 @@ void Style_SetMargin(HWND hwnd, LPCWSTR lpszStyle) /// iStyle == STYLE_LINENUMBE
|
||||
const WCHAR* const wchBookMarkStyleStrg = GetCurrentStdLexer()->Styles[STY_BOOK_MARK].szValue;
|
||||
|
||||
colorRead = clrLineNumFore;
|
||||
Style_StrGetColor(wchBookMarkStyleStrg, FOREGROUND_LAYER, &colorRead, false);
|
||||
Style_StrGetColor(wchBookMarkStyleStrg, FOREGROUND_LAYER, &colorRead, NULL, false);
|
||||
|
||||
COLORREF const clrBookMarkFore = colorRead;
|
||||
|
||||
colorRead = clrMarginBack;
|
||||
Style_StrGetColor(wchBookMarkStyleStrg, BACKGROUND_LAYER, &colorRead, false);
|
||||
Style_StrGetColor(wchBookMarkStyleStrg, BACKGROUND_LAYER, &colorRead, NULL, false);
|
||||
// adjust background color by alpha in case of show margin
|
||||
int alpha = SC_ALPHA_OPAQUE;
|
||||
Style_StrGetAlpha(wchBookMarkStyleStrg, &alpha, true);
|
||||
@ -2152,7 +2152,7 @@ void Style_SetMargin(HWND hwnd, LPCWSTR lpszStyle) /// iStyle == STYLE_LINENUMBE
|
||||
COLORREF color;
|
||||
for (int m = MARKER_NP3_1; m < MARKER_NP3_BOOKMARK; ++m) {
|
||||
SciCall_MarkerDefine(m, (Settings.FocusViewMarkerMode & FVMM_LN_BACKGR) ? SC_MARK_BACKGROUND : SC_MARK_BOOKMARK);
|
||||
Style_StrGetColor(WordBookMarks[m], BACKGROUND_LAYER, &color, true);
|
||||
Style_StrGetColor(WordBookMarks[m], BACKGROUND_LAYER, &color, NULL, true);
|
||||
SciCall_MarkerSetForeTranslucent(m, RGBxA(color, SC_ALPHA_OPAQUE));
|
||||
SciCall_MarkerSetBackTranslucent(m, RGBxA(color, alpha)); // 'alpha' no meaning for SC_MARK_BACKGROUND
|
||||
}
|
||||
@ -2168,11 +2168,11 @@ void Style_SetMargin(HWND hwnd, LPCWSTR lpszStyle) /// iStyle == STYLE_LINENUMBE
|
||||
|
||||
const WCHAR* const wchChgHistMrkModifiedStyleStrg = GetCurrentStdLexer()->Styles[STY_CHGHIST_MODIFIED].szValue;
|
||||
colorRead = clrBookMarkFore;
|
||||
if (Style_StrGetColor(wchChgHistMrkModifiedStyleStrg, FOREGROUND_LAYER, &colorRead, false)) {
|
||||
if (Style_StrGetColor(wchChgHistMrkModifiedStyleStrg, FOREGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
SciCall_MarkerSetFore(SC_MARKNUM_HISTORY_MODIFIED, colorRead);
|
||||
}
|
||||
colorRead = clrMarginBack;
|
||||
Style_StrGetColor(wchChgHistMrkModifiedStyleStrg, BACKGROUND_LAYER, &colorRead, false);
|
||||
Style_StrGetColor(wchChgHistMrkModifiedStyleStrg, BACKGROUND_LAYER, &colorRead, NULL, false);
|
||||
// also if not defined, use margin backgr
|
||||
SciCall_MarkerSetBack(SC_MARKNUM_HISTORY_MODIFIED, colorRead);
|
||||
|
||||
@ -2184,31 +2184,31 @@ void Style_SetMargin(HWND hwnd, LPCWSTR lpszStyle) /// iStyle == STYLE_LINENUMBE
|
||||
|
||||
const WCHAR* const wchChgHistMrkSavedStyleStrg = GetCurrentStdLexer()->Styles[STY_CHGHIST_SAVED].szValue;
|
||||
colorRead = clrBookMarkFore;
|
||||
if (Style_StrGetColor(wchChgHistMrkSavedStyleStrg, FOREGROUND_LAYER, &colorRead, false)) {
|
||||
if (Style_StrGetColor(wchChgHistMrkSavedStyleStrg, FOREGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
SciCall_MarkerSetFore(SC_MARKNUM_HISTORY_SAVED, colorRead);
|
||||
}
|
||||
colorRead = clrMarginBack;
|
||||
if (Style_StrGetColor(wchChgHistMrkSavedStyleStrg, BACKGROUND_LAYER, &colorRead, false)) {
|
||||
if (Style_StrGetColor(wchChgHistMrkSavedStyleStrg, BACKGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
SciCall_MarkerSetBack(SC_MARKNUM_HISTORY_SAVED, colorRead);
|
||||
}
|
||||
|
||||
const WCHAR* const wchChgHistMrkRev2OrgStyleStrg = GetCurrentStdLexer()->Styles[STY_CHGHIST_REV_TO_ORG].szValue;
|
||||
colorRead = clrBookMarkFore;
|
||||
if (Style_StrGetColor(wchChgHistMrkRev2OrgStyleStrg, FOREGROUND_LAYER, &colorRead, false)) {
|
||||
if (Style_StrGetColor(wchChgHistMrkRev2OrgStyleStrg, FOREGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
SciCall_MarkerSetFore(SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN, colorRead);
|
||||
}
|
||||
colorRead = clrMarginBack;
|
||||
if (Style_StrGetColor(wchChgHistMrkRev2OrgStyleStrg, BACKGROUND_LAYER, &colorRead, false)) {
|
||||
if (Style_StrGetColor(wchChgHistMrkRev2OrgStyleStrg, BACKGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
SciCall_MarkerSetBack(SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN, colorRead);
|
||||
}
|
||||
|
||||
const WCHAR* const wchChgHistMrkRev2ModStyleStrg = GetCurrentStdLexer()->Styles[STY_CHGHIST_REV_TO_MOD].szValue;
|
||||
colorRead = clrBookMarkFore;
|
||||
if (Style_StrGetColor(wchChgHistMrkRev2ModStyleStrg, FOREGROUND_LAYER, &colorRead, false)) {
|
||||
if (Style_StrGetColor(wchChgHistMrkRev2ModStyleStrg, FOREGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
SciCall_MarkerSetFore(SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED, colorRead);
|
||||
}
|
||||
colorRead = clrMarginBack;
|
||||
if (Style_StrGetColor(wchChgHistMrkRev2ModStyleStrg, BACKGROUND_LAYER, &colorRead, false)) {
|
||||
if (Style_StrGetColor(wchChgHistMrkRev2ModStyleStrg, BACKGROUND_LAYER, &colorRead, NULL, false)) {
|
||||
SciCall_MarkerSetBack(SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED, colorRead);
|
||||
}
|
||||
|
||||
@ -3220,11 +3220,14 @@ void Style_AppendWeightAttribute(LPWSTR lpszWeight, int cchSize, int fontWeight)
|
||||
//
|
||||
// Style_StrGetColor()
|
||||
//
|
||||
bool Style_StrGetColor(LPCWSTR lpszStyle, COLOR_LAYER layer, COLORREF *rgb, bool useDefault) {
|
||||
|
||||
bool const bFGLayer = (layer == FOREGROUND_LAYER);
|
||||
bool bIsDefined = false;
|
||||
const WCHAR *const pItem = bFGLayer ? L"fore:" : L"back:";
|
||||
bool Style_StrGetColor(LPCWSTR lpszStyle, COLOR_LAYER layer, COLORREF* rgb, COLORREF* rgbOrig, bool useDefault)
|
||||
{
|
||||
bool const bFGLayer = (layer == FOREGROUND_LAYER);
|
||||
//~COLORREF const colorDefault = bFGLayer ? GetModeTextColor(UseDarkMode()) : GetModeBkColor(UseDarkMode());
|
||||
COLORREF const colorDefault = bFGLayer ? SciCall_StyleGetFore(STYLE_DEFAULT) : SciCall_StyleGetBack(STYLE_DEFAULT); //~ SCI maybe not initialized
|
||||
COLORREF color = rgbOrig ? *rgbOrig : (rgb ? *rgb : colorDefault);
|
||||
bool bIsDefined = false;
|
||||
const WCHAR* const pItem = bFGLayer ? L"fore:" : L"back:";
|
||||
WCHAR *p = StrStr(lpszStyle, pItem);
|
||||
if (p) {
|
||||
WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' };
|
||||
@ -3240,19 +3243,24 @@ bool Style_StrGetColor(LPCWSTR lpszStyle, COLOR_LAYER layer, COLORREF *rgb, bool
|
||||
|
||||
unsigned int iValue = 0;
|
||||
if (swscanf_s(tch, L"%x", &iValue) == 1) {
|
||||
*rgb = RGB((iValue & 0xFF0000) >> 16, (iValue & 0xFF00) >> 8, iValue & 0xFF);
|
||||
color = RGB((iValue & 0xFF0000) >> 16, (iValue & 0xFF00) >> 8, iValue & 0xFF);
|
||||
bIsDefined = true;
|
||||
}
|
||||
}
|
||||
// no colordef bIsDefined - use default as fallback ?
|
||||
if (!bIsDefined && useDefault)
|
||||
{
|
||||
//~*rgb = bFGLayer ? GetModeTextColor(UseDarkMode()) : GetModeBkColor(UseDarkMode());
|
||||
*rgb = bFGLayer ? SciCall_StyleGetFore(STYLE_DEFAULT) : SciCall_StyleGetBack(STYLE_DEFAULT); //~ SCI maybe not initialized
|
||||
|
||||
if (!bIsDefined && useDefault) {
|
||||
color = colorDefault;
|
||||
//~ don't: bIsDefined = true;
|
||||
}
|
||||
|
||||
if (rgbOrig) {
|
||||
*rgbOrig = color;
|
||||
}
|
||||
if (bFGLayer && UseDarkMode()) {
|
||||
*rgb = ContrastColor(*rgb, Settings2.DarkModeHiglightContrast);
|
||||
color = ContrastColor(color, Settings2.DarkModeHiglightContrast);
|
||||
}
|
||||
if (rgb) {
|
||||
*rgb = color;
|
||||
}
|
||||
|
||||
return bIsDefined;
|
||||
@ -3460,10 +3468,11 @@ void Style_CopyStyles_IfNotDefined(LPCWSTR lpszStyleSrc, LPWSTR lpszStyleDest, i
|
||||
}
|
||||
|
||||
// foreground color
|
||||
if (Style_StrGetColor(lpszStyleDest, FOREGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(lpszStyleDest, FOREGROUND_LAYER, NULL, &dColor, false)) {
|
||||
Style_PrintfCchColor(tch, COUNTOF(tch), L"; ", FOREGROUND_LAYER, dColor);
|
||||
StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch);
|
||||
} else if (Style_StrGetColor(lpszStyleSrc, FOREGROUND_LAYER, &dColor, false)) {
|
||||
}
|
||||
else if (Style_StrGetColor(lpszStyleSrc, FOREGROUND_LAYER, NULL, &dColor, false)) {
|
||||
Style_PrintfCchColor(tch, COUNTOF(tch), L"; ", FOREGROUND_LAYER, dColor);
|
||||
StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch);
|
||||
}
|
||||
@ -3471,10 +3480,11 @@ void Style_CopyStyles_IfNotDefined(LPCWSTR lpszStyleSrc, LPWSTR lpszStyleDest, i
|
||||
// ######## attributes not defined by Font Selection Dialog ########
|
||||
|
||||
// background color
|
||||
if (Style_StrGetColor(lpszStyleDest, BACKGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(lpszStyleDest, BACKGROUND_LAYER, NULL, &dColor, false)) {
|
||||
Style_PrintfCchColor(tch, COUNTOF(tch), L"; ", BACKGROUND_LAYER, dColor);
|
||||
StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch);
|
||||
} else if (Style_StrGetColor(lpszStyleSrc, BACKGROUND_LAYER, &dColor, false)) {
|
||||
}
|
||||
else if (Style_StrGetColor(lpszStyleSrc, BACKGROUND_LAYER, NULL, &dColor, false)) {
|
||||
Style_PrintfCchColor(tch, COUNTOF(tch), L"; ", BACKGROUND_LAYER, dColor);
|
||||
StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch);
|
||||
}
|
||||
@ -3636,7 +3646,7 @@ bool Style_SelectFont(HWND hwnd, LPWSTR lpszStyle, int cchStyle, LPCWSTR sLexerN
|
||||
int const iQuality = MapSciToWinFontQuality(Settings2.SciFontQuality);
|
||||
|
||||
COLORREF fgColor = 0L;
|
||||
Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &fgColor, true);
|
||||
Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &fgColor, NULL, true);
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
@ -3767,7 +3777,7 @@ bool Style_SelectFont(HWND hwnd, LPWSTR lpszStyle, int cchStyle, LPCWSTR sLexerN
|
||||
}
|
||||
|
||||
COLORREF fgColorDefault = 0L;
|
||||
Style_StrGetColor(L"", FOREGROUND_LAYER, &fgColorDefault, true);
|
||||
Style_StrGetColor(L"", FOREGROUND_LAYER, &fgColorDefault, NULL, true);
|
||||
if (cf.rgbColors != fgColorDefault) {
|
||||
WCHAR fgColorStr[32] = { L'\0' };
|
||||
Style_PrintfCchColor(fgColorStr, COUNTOF(fgColorStr), L"; ", FOREGROUND_LAYER, cf.rgbColors);
|
||||
@ -3795,7 +3805,7 @@ bool Style_SelectColor(HWND hwnd,bool bForeGround,LPWSTR lpszStyle,int cchStyle,
|
||||
|
||||
COLOR_LAYER const layer = (bForeGround ? FOREGROUND_LAYER : BACKGROUND_LAYER);
|
||||
COLORREF dRGBResult;
|
||||
Style_StrGetColor(lpszStyle, layer, &dRGBResult, true);
|
||||
Style_StrGetColor(lpszStyle, layer, &dRGBResult, NULL, true);
|
||||
|
||||
CHOOSECOLOR cc = { sizeof(CHOOSECOLOR) };
|
||||
cc.hwndOwner = hwnd;
|
||||
@ -3826,14 +3836,14 @@ bool Style_SelectColor(HWND hwnd,bool bForeGround,LPWSTR lpszStyle,int cchStyle,
|
||||
Style_PrintfCchColor(tch, COUNTOF(tch), L"; ", FOREGROUND_LAYER, dRGBResult);
|
||||
StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch);
|
||||
|
||||
if (Style_StrGetColor(lpszStyle, BACKGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(lpszStyle, BACKGROUND_LAYER, &dColor, NULL, false)) {
|
||||
Style_PrintfCchColor(tch, COUNTOF(tch), L"; ", BACKGROUND_LAYER, dColor);
|
||||
StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch);
|
||||
}
|
||||
|
||||
} else { // set background
|
||||
|
||||
if (Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &dColor, NULL, false)) {
|
||||
Style_PrintfCchColor(tch, COUNTOF(tch), L"; ", FOREGROUND_LAYER, dColor);
|
||||
StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch);
|
||||
}
|
||||
@ -3936,22 +3946,22 @@ void Style_SetStyles(HWND hwnd, const int iStyle, LPCWSTR lpszStyle)
|
||||
|
||||
COLORREF dColor = 0L;
|
||||
// Foregr
|
||||
if (Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &dColor, NULL, false)) {
|
||||
SciCall_StyleSetFore(iStyle, dColor);
|
||||
} else if (bIsDefaultStyle) {
|
||||
SciCall_StyleSetFore(iStyle, GetModeTextColor(UseDarkMode()));
|
||||
} else { // fallback: SCI default
|
||||
Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &dColor, true);
|
||||
Style_StrGetColor(lpszStyle, FOREGROUND_LAYER, &dColor, NULL, true);
|
||||
SciCall_StyleSetFore(iStyle, dColor);
|
||||
}
|
||||
|
||||
// Backgr
|
||||
if (Style_StrGetColor(lpszStyle, BACKGROUND_LAYER, &dColor, false)) {
|
||||
if (Style_StrGetColor(lpszStyle, BACKGROUND_LAYER, &dColor, NULL, false)) {
|
||||
SciCall_StyleSetBack(iStyle, dColor);
|
||||
} else if (bIsDefaultStyle) {
|
||||
SciCall_StyleSetBack(iStyle, GetModeBkColor(UseDarkMode()));
|
||||
} else { // fallback: SCI default
|
||||
Style_StrGetColor(lpszStyle, BACKGROUND_LAYER, &dColor, true);
|
||||
Style_StrGetColor(lpszStyle, BACKGROUND_LAYER, &dColor, NULL, true);
|
||||
SciCall_StyleSetBack(iStyle, dColor);
|
||||
}
|
||||
|
||||
@ -4385,7 +4395,7 @@ INT_PTR CALLBACK Style_CustomizeSchemesDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
MakeBitmapButton(hwnd, IDC_PREVSTYLE, IDB_PREV, -1, -1);
|
||||
MakeBitmapButton(hwnd, IDC_NEXTSTYLE, IDB_NEXT, -1, -1);
|
||||
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, LOWORD(wParam));
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
@ -4769,11 +4779,11 @@ CASE_WM_CTLCOLOR_SET:
|
||||
GetDlgItemText(hwnd, IDC_STYLEEDIT, tch, COUNTOF(tch));
|
||||
|
||||
COLORREF cr = COLORREF_MAX; // SciCall_StyleGetFore(STYLE_DEFAULT);
|
||||
Style_StrGetColor(tch, FOREGROUND_LAYER, &cr, true);
|
||||
Style_StrGetColor(tch, FOREGROUND_LAYER, &cr, NULL, true);
|
||||
MakeColorPickButton(hwnd, IDC_STYLEFORE, Globals.hInstance, cr);
|
||||
|
||||
cr = COLORREF_MAX; // SciCall_StyleGetBack(STYLE_DEFAULT);
|
||||
Style_StrGetColor(tch, BACKGROUND_LAYER, &cr, true);
|
||||
Style_StrGetColor(tch, BACKGROUND_LAYER, &cr, NULL, true);
|
||||
MakeColorPickButton(hwnd, IDC_STYLEBACK, Globals.hInstance, cr);
|
||||
}
|
||||
}
|
||||
@ -5017,10 +5027,8 @@ INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPAR
|
||||
|
||||
|
||||
case WM_DPICHANGED: {
|
||||
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT *)lParam, 0);
|
||||
|
||||
UINT const dpi = LOWORD(wParam);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, dpi);
|
||||
SHFILEINFO shfi = { 0 };
|
||||
UINT const flagIconSize = (dpi >= LargeIconDPI()) ? SHGFI_LARGEICON : SHGFI_SMALLICON;
|
||||
ListView_SetImageList(hwndLV,
|
||||
|
||||
@ -91,7 +91,7 @@ bool Style_StrGetSizeStr(LPCWSTR lpszStyle,LPWSTR lpszSize,int cchSize);
|
||||
void Style_AppendSizeAttribute(LPWSTR lpszSize, int cchSize, const float fFontSize, const float fBaseFontSize);
|
||||
bool Style_StrGetWeightValue(LPCWSTR lpszWeight, int *weight);
|
||||
void Style_AppendWeightAttribute(LPWSTR lpszWeight, int cchSize, int fontWeight);
|
||||
bool Style_StrGetColor(LPCWSTR lpszStyle, COLOR_LAYER layer, COLORREF *rgb, bool useDefault);
|
||||
bool Style_StrGetColor(LPCWSTR lpszStyle, COLOR_LAYER layer, COLORREF *rgb, COLORREF *rgbOrig, bool useDefault);
|
||||
bool Style_StrGetStrokeWidth(HWND hwnd, int indicID, LPCWSTR lpszStyle, int *piStrokeWidth);
|
||||
bool Style_StrGetCase(LPCWSTR lpszStyle, int *i);
|
||||
bool Style_StrGetAlpha(LPCWSTR lpszStyle, int* iOutValue, bool bAlpha1st);
|
||||
|
||||
@ -156,7 +156,7 @@ INT_PTR CALLBACK SetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
return TRUE;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hDlg, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hDlg, (RECT*)lParam, (UINT)HIWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
//#define WM_CTLCOLORMSGBOX 0x0132
|
||||
@ -352,7 +352,7 @@ INT_PTR CALLBACK GetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
return !0;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hDlg, (RECT*)lParam, 0);
|
||||
UpdateWindowLayoutForDPI(hDlg, (RECT*)lParam, (UINT)HIWORD(wParam));
|
||||
return !0;
|
||||
|
||||
#ifdef D_NP3_WIN10_DARK_MODE
|
||||
|
||||
Loading…
Reference in New Issue
Block a user