Permalink
Browse files

Add "Transparent mode on losing focus" configuration for find and rep…

…lace dialog.
  • Loading branch information...
zufuliu committed Oct 29, 2018
1 parent 7b3189c commit 7f5e2823a38cc5288d746d54ac6ff6b13afce719
Showing with 22 additions and 7 deletions.
  1. +10 −1 src/Edit.c
  2. +3 −0 src/Notepad2.c
  3. +8 −6 src/Notepad2.rc
  4. +1 −0 src/resource.h
@@ -4089,6 +4089,7 @@ void EditSelectLine(HWND hwnd) {
SendMessage(hwnd, SCI_CHOOSECARETX, 0, 0);
}
extern BOOL bFindReplaceTransparentMode;
extern int iFindReplaceOpacityLevel;
//=============================================================================
//
@@ -4235,6 +4236,10 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
CopyMemory(lpefr, &efrSave, sizeof(EDITFINDREPLACE));
}
if (bFindReplaceTransparentMode) {
CheckDlgButton(hwnd, IDC_TRANSPARENT, BST_CHECKED);
}
HMENU hmenu = GetSystemMenu(hwnd, FALSE);
GetString(SC_SAVEPOS, tch, COUNTOF(tch));
InsertMenu(hmenu, 0, MF_BYPOSITION | MF_STRING | MF_ENABLED, SC_SAVEPOS, tch);
@@ -4291,6 +4296,10 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
break;
#endif
case IDC_TRANSPARENT:
bFindReplaceTransparentMode = IsButtonChecked(hwnd, IDC_TRANSPARENT);
break;
case IDOK:
case IDC_FINDPREV:
case IDC_REPLACE:
@@ -4562,7 +4571,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
break;
case WM_ACTIVATE :
SetWindowTransparentMode(hwnd, LOWORD(wParam) == WA_INACTIVE, iFindReplaceOpacityLevel);
SetWindowTransparentMode(hwnd, (LOWORD(wParam) == WA_INACTIVE && bFindReplaceTransparentMode), iFindReplaceOpacityLevel);
break;
}
@@ -184,6 +184,7 @@ static int iEscFunction;
static BOOL bAlwaysOnTop;
static BOOL bMinimizeToTray;
static BOOL bTransparentMode;
BOOL bFindReplaceTransparentMode;
static BOOL bEditLayoutRTL;
BOOL bWindowLayoutRTL;
int iRenderingTechnology;
@@ -5469,6 +5470,7 @@ void LoadSettings(void) {
bAlwaysOnTop = IniSectionGetBool(pIniSection, L"AlwaysOnTop", 0);
bMinimizeToTray = IniSectionGetBool(pIniSection, L"MinimizeToTray", 0);
bTransparentMode = IniSectionGetBool(pIniSection, L"TransparentMode", 0);
bFindReplaceTransparentMode = IniSectionGetBool(pIniSection, L"FindReplaceTransparentMode", 1);
bEditLayoutRTL = IniSectionGetBool(pIniSection, L"EditLayoutRTL", 0);
bWindowLayoutRTL = IniSectionGetBool(pIniSection, L"WindowLayoutRTL", 0);
@@ -5725,6 +5727,7 @@ void SaveSettings(BOOL bSaveSettingsNow) {
IniSectionSetBoolEx(pIniSection, L"AlwaysOnTop", bAlwaysOnTop, 0);
IniSectionSetBoolEx(pIniSection, L"MinimizeToTray", bMinimizeToTray, 0);
IniSectionSetBoolEx(pIniSection, L"TransparentMode", bTransparentMode, 0);
IniSectionSetBoolEx(pIniSection, L"FindReplaceTransparentMode", bFindReplaceTransparentMode, 1);
IniSectionSetBoolEx(pIniSection, L"EditLayoutRTL", bEditLayoutRTL, 0);
IniSectionSetBoolEx(pIniSection, L"WindowLayoutRTL", bWindowLayoutRTL, 0);
IniSectionSetIntEx(pIniSection, L"RenderingTechnology", iRenderingTechnology, (IsVistaAndAbove()? SC_TECHNOLOGY_DIRECTWRITE : SC_TECHNOLOGY_DEFAULT));
@@ -887,7 +887,7 @@ BEGIN
CONTROL "",IDC_EMAIL_LINK,"SysLink",WS_TABSTOP,45,128,140,10
END
IDD_FIND DIALOGEX 0, 0, 290, 100
IDD_FIND DIALOGEX 0, 0, 290, 112
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_NOFAILCREATE | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Find Text"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
@@ -904,17 +904,18 @@ BEGIN
DEFPUSHBUTTON "&Find Next",IDOK,223,7,60,14
PUSHBUTTON "Find &Previous",IDC_FINDPREV,223,24,60,14
PUSHBUTTON "Close",IDCANCEL,223,41,60,14
CONTROL "<a>Goto Replace (Ctrl+H)</a>",IDC_TOGGLEFINDREPLACE, "SysLink",0x0,136,84,100,10
CONTROL "<a>Goto Replace (Ctrl+H)</a>",IDC_TOGGLEFINDREPLACE, "SysLink",0x0,136,97,100,10
//#ifdef BOOKMARK_EDITION
CONTROL "<a>(?)</a>",IDC_REGEXPHELP,"SysLink",0x0,118,73,14,10
CONTROL "<a>(?)</a>",IDC_BACKSLASHHELP,"SysLink",0x0,118,85,14,10
CONTROL "W&ildcard Search",IDC_WILDCARDSEARCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,132,61,74,10
CONTROL "W&ildcard search",IDC_WILDCARDSEARCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,132,61,74,10
CONTROL "<a>(?)</a>",IDC_WILDCARDHELP,"SysLink",0x0,208,61,14,10
//#endif
CONTROL "<a>Clear History</a>",IDC_CLEAR_FIND,"SysLink",WS_TABSTOP,173,7,48,10
CONTROL "Transparent mode on losing focus",IDC_TRANSPARENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,96,124,10
END
IDD_REPLACE DIALOGEX 0, 0, 290, 130
IDD_REPLACE DIALOGEX 0, 0, 290, 142
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_NOFAILCREATE | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Replace Text"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
@@ -936,15 +937,16 @@ BEGIN
PUSHBUTTON "Replace &All",IDC_REPLACEALL,223,58,60,14
PUSHBUTTON "In &Selection",IDC_REPLACEINSEL,223,75,60,14
PUSHBUTTON "Close",IDCANCEL,223,92,60,14
CONTROL "<a>Goto Find (Ctrl+F)</a>",IDC_TOGGLEFINDREPLACE, "SysLink",0x0,136,114,80,10
CONTROL "<a>Goto Find (Ctrl+F)</a>",IDC_TOGGLEFINDREPLACE, "SysLink",0x0,136,127,80,10
//#ifdef BOOKMARK_EDITION
CONTROL "<a>(?)</a>",IDC_REGEXPHELP,"SysLink",0x0,118,102,14,10
CONTROL "<a>(?)</a>",IDC_BACKSLASHHELP,"SysLink",0x0,118,114,14,10
CONTROL "W&ildcard Search",IDC_WILDCARDSEARCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,132,90,74,10
CONTROL "W&ildcard search",IDC_WILDCARDSEARCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,132,90,74,10
CONTROL "<a>(?)</a>",IDC_WILDCARDHELP,"SysLink",0x0,208,90,14,10
//#endif
CONTROL "<a>Clear History</a>",IDC_CLEAR_FIND,"SysLink",WS_TABSTOP,173,6,48,10
CONTROL "<a>Clear History</a>",IDC_CLEAR_REPLACE,"SysLink",WS_TABSTOP,173,35,48,10
CONTROL "Transparent mode on losing focus",IDC_TRANSPARENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,126,124,10
END
IDD_RUN DIALOGEX 0, 0, 234, 86
@@ -124,6 +124,7 @@
#define IDC_WILDCARDSEARCH 154
#define IDC_CLEAR_FIND 155
#define IDC_CLEAR_REPLACE 156
#define IDC_TRANSPARENT 157
#define IDACC_FIND 200
#define IDACC_REPLACE 201
#define IDACC_SAVEPOS 202

0 comments on commit 7f5e282

Please sign in to comment.