mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 05:45:00 +02:00
Use gdi dpi scaling for Windows dialog
- tweak dpi scaling for ColourPopup dialog. ref #14959 Close #15186
This commit is contained in:
parent
00ea1a9089
commit
6c5f0009b4
@ -49,8 +49,7 @@ void ColourPopup::doDialog(POINT p)
|
||||
{
|
||||
if (!isCreated())
|
||||
{
|
||||
const DPI_AWARENESS_CONTEXT dpiContextSystem = NppDarkMode::isWindows10() ? DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED : DPI_AWARENESS_CONTEXT_SYSTEM_AWARE;
|
||||
const auto dpiContext = DPIManagerV2::setThreadDpiAwarenessContext(dpiContextSystem);
|
||||
const auto dpiContext = DPIManagerV2::setThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED);
|
||||
|
||||
create(IDD_COLOUR_POPUP);
|
||||
|
||||
@ -248,8 +247,7 @@ intptr_t CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
|
||||
|
||||
display(false);
|
||||
|
||||
const DPI_AWARENESS_CONTEXT dpiContextSystem = NppDarkMode::isWindows10() ? DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED : DPI_AWARENESS_CONTEXT_SYSTEM_AWARE;
|
||||
const auto dpiContext = DPIManagerV2::setThreadDpiAwarenessContext(dpiContextSystem);
|
||||
const auto dpiContext = DPIManagerV2::setThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED);
|
||||
const bool isCreated = ChooseColor(&cc) == TRUE;
|
||||
if (dpiContext != NULL)
|
||||
{
|
||||
|
@ -552,7 +552,15 @@ void WindowsDlg::updateButtonState()
|
||||
|
||||
int WindowsDlg::doDialog()
|
||||
{
|
||||
return static_cast<int>(DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_WINDOWS), _hParent, dlgProc, reinterpret_cast<LPARAM>(this)));
|
||||
const auto dpiContext = DPIManagerV2::setThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED);
|
||||
|
||||
int result = static_cast<int>(DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_WINDOWS), _hParent, dlgProc, reinterpret_cast<LPARAM>(this)));
|
||||
|
||||
if (dpiContext != NULL)
|
||||
{
|
||||
DPIManagerV2::setThreadDpiAwarenessContext(dpiContext);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
BOOL WindowsDlg::onInitDialog()
|
||||
|
Loading…
x
Reference in New Issue
Block a user