mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+chg: changing default settings: LaunchInstanceWndPosOffset=28 and LaunchInstanceFullVisible=true
This commit is contained in:
parent
16a963d588
commit
ade52ed531
@ -38,8 +38,8 @@ SettingsVersion=5
|
||||
;ShellAppUserModelID=Rizonesoft.Notepad3
|
||||
;ShellUseSystemMRU=1
|
||||
;StickyWindowPosition=0
|
||||
;LaunchInstanceWndPosOffset=0
|
||||
;LaunchInstanceFullVisible=0
|
||||
;LaunchInstanceWndPosOffset=28
|
||||
;LaunchInstanceFullVisible=true
|
||||
;UseOldStyleBraceMatching=0
|
||||
;WebTemplate1=https://google.com/search?q=%s
|
||||
;WebTmpl1MenuName=Open Web Action 1
|
||||
|
||||
@ -1220,9 +1220,8 @@ void LoadSettings()
|
||||
Settings2.IMEInteraction = ((codePage == 949 || codePage == 1361) ? SC_IME_INLINE : SC_IME_WINDOWED);
|
||||
}
|
||||
|
||||
Settings2.LaunchInstanceWndPosOffset = clampi(IniSectionGetInt(IniSecSettings2, L"LaunchInstanceWndPosOffset", 0), -10000, 10000);
|
||||
|
||||
Settings2.LaunchInstanceFullVisible = IniSectionGetBool(IniSecSettings2, L"LaunchInstanceFullVisible", false);
|
||||
Settings2.LaunchInstanceWndPosOffset = clampi(IniSectionGetInt(IniSecSettings2, L"LaunchInstanceWndPosOffset", 28), -10000, 10000);
|
||||
Settings2.LaunchInstanceFullVisible = IniSectionGetBool(IniSecSettings2, L"LaunchInstanceFullVisible", true);
|
||||
|
||||
Settings2.SciFontQuality = clampi(IniSectionGetInt(IniSecSettings2, L"SciFontQuality", SC_EFF_QUALITY_LCD_OPTIMIZED), SC_EFF_QUALITY_DEFAULT, SC_EFF_QUALITY_LCD_OPTIMIZED);
|
||||
|
||||
|
||||
@ -4449,24 +4449,29 @@ WINDOWPLACEMENT WindowPlacementFromInfo(HWND hwnd, const WININFO* pWinInfo, SCRE
|
||||
|
||||
WININFO winfo = INIT_WININFO;
|
||||
if (pWinInfo) {
|
||||
RECT rc = { 0 };
|
||||
RectFromWinInfo(pWinInfo, &rc);
|
||||
|
||||
winfo = *pWinInfo;
|
||||
FitIntoMonitorGeometry(&rc, &winfo, mode, false);
|
||||
winfo = *pWinInfo;
|
||||
if (Settings2.LaunchInstanceFullVisible) {
|
||||
RECT rc = { 0 };
|
||||
RectFromWinInfo(pWinInfo, &rc);
|
||||
FitIntoMonitorGeometry(&rc, &winfo, mode, false);
|
||||
}
|
||||
if (pWinInfo->max) {
|
||||
wndpl.flags &= WPF_RESTORETOMAXIMIZED;
|
||||
}
|
||||
wndpl.showCmd = SW_RESTORE;
|
||||
} else {
|
||||
RECT rc = {0};
|
||||
if (hwnd) {
|
||||
GetWindowRect(hwnd, &rc);
|
||||
} else {
|
||||
GetWindowRect(GetDesktopWindow(), &rc);
|
||||
}
|
||||
FitIntoMonitorGeometry(&rc, &winfo, mode, false);
|
||||
|
||||
RECT rc = { 0 };
|
||||
if (hwnd) {
|
||||
GetWindowRect(hwnd, &rc);
|
||||
}
|
||||
else {
|
||||
GetWindowRect(GetDesktopWindow(), &rc);
|
||||
}
|
||||
if (Settings2.LaunchInstanceFullVisible) {
|
||||
FitIntoMonitorGeometry(&rc, &winfo, mode, false);
|
||||
} else {
|
||||
WinInfoFromRect(&rc, &winfo);
|
||||
}
|
||||
wndpl.showCmd = SW_SHOW;
|
||||
}
|
||||
RectFromWinInfo(&winfo, &(wndpl.rcNormalPosition));
|
||||
|
||||
@ -11528,9 +11528,7 @@ bool LaunchNewInstance(HWND hwnd, LPCWSTR lpszParameter, LPCWSTR lpszFilePath)
|
||||
else {
|
||||
int const offset = Settings2.LaunchInstanceWndPosOffset;
|
||||
int const instCnt = CountRunningInstances();
|
||||
WININFO wi = g_IniWinInfo;
|
||||
wi.x += (instCnt * offset);
|
||||
wi.y += (instCnt * offset);
|
||||
WININFO wi = GetMyWindowPlacement(hwnd, NULL, offset * instCnt);
|
||||
WCHAR wchPos[80] = { L'\0' };
|
||||
StringCchPrintf(wchPos, COUNTOF(wchPos), L"-pos %i,%i,%i,%i,%i", wi.x, wi.y, wi.cx, wi.cy, (int)wi.max);
|
||||
|
||||
|
||||
@ -112,6 +112,16 @@ __forceinline void RectFromWinInfo(const WININFO* const pWinInfo, LPRECT pRect)
|
||||
{
|
||||
SetRect(pRect, pWinInfo->x, pWinInfo->y, pWinInfo->x + pWinInfo->cx, pWinInfo->y + pWinInfo->cy);
|
||||
}
|
||||
__forceinline void WinInfoFromRect(LPCRECT pRect, WININFO* pWinInfo)
|
||||
{
|
||||
pWinInfo->x = pRect->left;
|
||||
pWinInfo->y = pRect->top;
|
||||
pWinInfo->cx = pRect->right - pRect->left;
|
||||
pWinInfo->cy = pRect->bottom - pRect->top;
|
||||
pWinInfo->max = false;
|
||||
pWinInfo->zoom = 100;
|
||||
pWinInfo->dpi = USER_DEFAULT_SCREEN_DPI;
|
||||
}
|
||||
|
||||
extern WININFO g_IniWinInfo;
|
||||
extern WININFO g_DefWinInfo;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user