Browse Source

Add tooltips in performance section to make features more explicit

Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/12310#issuecomment-1279826809
pull/12352/head
Don Ho 2 years ago
parent
commit
c02c23b7d4
  1. 3
      PowerEditor/installer/nativeLang/english.xml
  2. 2
      PowerEditor/installer/nativeLang/french.xml
  3. 5
      PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
  4. 20
      PowerEditor/src/NppDarkMode.cpp
  5. 11
      PowerEditor/src/WinControls/Preference/preferenceDlg.cpp
  6. 10
      PowerEditor/src/WinControls/Preference/preferenceDlg.h

3
PowerEditor/installer/nativeLang/english.xml

@ -1605,7 +1605,8 @@ Find in all files but exclude all folders log or logs recursively:
<contextMenu-styleAlloccurrencesOfToken value="Style all occurrences of token" />
<contextMenu-styleOneToken value="Style one token" />
<contextMenu-clearStyle value="Clear style" />
<contextMenu-PluginCommands value="Plugin commands" />
<enable-disable-largeFileRestriction-tip value="Toggling &quot;Enable Large File Restriction&quot; takes effect only after closing and re-opening the large file" />
<change-largeFileRestriction_fileLength-tip value="Modifying file size value takes effect only after closing and re-opening the large file" />
</MiscStrings>
</Native-Langue>
</NotepadPlus>

2
PowerEditor/installer/nativeLang/french.xml

@ -1606,6 +1606,8 @@ Rechercher dans tous les fichiers mais pas dans les dossiers log ou logs récurs
<contextMenu-styleOneToken value="Appliquer le style à 1 seul occurrence" />
<contextMenu-clearStyle value="Dégager le style" />
<contextMenu-PluginCommands value="Modules d'extension" />
<enable-disable-largeFileRestriction-tip value="Basculer &quot;Activer la restriction des fichiers volumineux&quot; ne prend effet qu'après la fermeture et la réouverture du fichier volumineux" />
<change-largeFileRestriction_fileLength-tip value="La modification de la valeur de la taille du fichier ne prend effet qu'après la fermeture et la réouverture du fichier volumineux" />
</MiscStrings>
</Native-Langue>
</NotepadPlus>

5
PowerEditor/installer/nativeLang/taiwaneseMandarin.xml

@ -1011,6 +1011,7 @@
<Item id="6353" name="僅符合整個單字"/>
<Item id="6333" name="智慧醒目提示"/>
<Item id="6326" name="啟動智慧醒目提示"/>
<Item id="6354" name="匹配"/>
<Item id="6332" name="區分大小寫"/>
<Item id="6338" name="僅符合整個單字"/>
<Item id="6339" name="使用尋找與取代對話方塊的設定"/>
@ -1142,7 +1143,7 @@
<Performance title="性能">
<Item id="7141" name="大型檔案限制"/>
<Item id="7142" name="在開啟大型文件時,為了優化性能,一些功能會被關閉。 可以在此處自開啟它們。"/>
<Item id="7142" name="在開啟大型文件時,為了優化性能,一些功能會被關閉。 可以在此處自開啟它們。"/>
<Item id="7143" name="啟動大型檔案限制"/>
<Item id="7144" name="定義大型檔案文件長度大小:"/>
<Item id="7146" name="MB (1 - 4096)"/>
@ -1546,6 +1547,8 @@
<contextMenu-styleOneToken value="僅樣式化選擇的字串" />
<contextMenu-clearStyle value="清除樣式" />
<contextMenu-PluginCommands value="外掛模組" />
<enable-disable-largeFileRestriction-tip value="切換「啟動大型檔案限制」 僅在關閉並重新打開大型文件後生效" />
<change-largeFileRestriction_fileLength-tip value="修改大型檔案長度大小值只有在關閉並重新打開大文件後生效" />
</MiscStrings>
</Native-Langue>
</NotepadPlus>

20
PowerEditor/src/NppDarkMode.cpp

@ -1795,7 +1795,7 @@ namespace NppDarkMode
EnumChildWindows(hwndParent, [](HWND hwnd, LPARAM lParam) WINAPI_LAMBDA {
auto& p = *reinterpret_cast<NppDarkModeParams*>(lParam);
constexpr size_t classNameLen = 16;
constexpr size_t classNameLen = 32;
TCHAR className[classNameLen]{};
GetClassName(hwnd, className, classNameLen);
@ -1854,6 +1854,24 @@ namespace NppDarkMode
return TRUE;
}
/*
// for debugging
if (wcscmp(className, L"#32770") == 0)
{
return TRUE;
}
if (wcscmp(className, L"Static") == 0)
{
return TRUE;
}
if (wcscmp(className, L"msctls_trackbar32") == 0)
{
return TRUE;
}
*/
return TRUE;
}, reinterpret_cast<LPARAM>(&p));
}

11
PowerEditor/src/WinControls/Preference/preferenceDlg.cpp

@ -263,6 +263,12 @@ intptr_t CALLBACK PreferenceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
case NPPM_INTERNAL_REFRESHDARKMODE:
{
NppDarkMode::autoThemeChildControls(_hSelf);
if (_performanceSubDlg._enableLargeFileRestrictionTip)
NppDarkMode::setDarkTooltips(_performanceSubDlg._enableLargeFileRestrictionTip, NppDarkMode::ToolTipsType::tooltip);
if (_performanceSubDlg._changeLargeFileLengthTip)
NppDarkMode::setDarkTooltips(_performanceSubDlg._changeLargeFileLengthTip, NppDarkMode::ToolTipsType::tooltip);
return TRUE;
}
@ -4931,6 +4937,11 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE), largeFileRestrictionEnabled);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWWORDWRAP), largeFileRestrictionEnabled);
NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
generic_string checkboxTip = pNativeSpeaker->getLocalizedStrFromID("enable-disable-largeFileRestriction-tip", TEXT("Toggling \"Enable Large File Restriction\" takes effect only after closing and re-opening the large file"));
generic_string editTip = pNativeSpeaker->getLocalizedStrFromID("change-largeFileRestriction_fileLength-tip", TEXT("Modifying file size value takes effect only after closing and re-opening the large file"));
_enableLargeFileRestrictionTip = CreateToolTip(IDC_CHECK_PERFORMANCE_ENABLE, _hSelf, _hInst, const_cast<PTSTR>(checkboxTip.c_str()), false);
_changeLargeFileLengthTip = CreateToolTip(IDC_EDIT_PERFORMANCE_FILESIZE, _hSelf, _hInst, const_cast<PTSTR>(editTip.c_str()), false);
}
break;

10
PowerEditor/src/WinControls/Preference/preferenceDlg.h

@ -254,11 +254,21 @@ private :
class PerformanceSubDlg : public StaticDialog
{
friend class PreferenceDlg;
public :
PerformanceSubDlg() = default;
~PerformanceSubDlg() {
if (_enableLargeFileRestrictionTip)
::DestroyWindow(_enableLargeFileRestrictionTip);
if (_changeLargeFileLengthTip)
::DestroyWindow(_changeLargeFileLengthTip);
};
private :
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
HWND _enableLargeFileRestrictionTip = nullptr;
HWND _changeLargeFileLengthTip = nullptr;
};
class PreferenceDlg : public StaticDialog

Loading…
Cancel
Save