From b31e7a31e099f6ecd97b12c1b9053b0537a69acc Mon Sep 17 00:00:00 2001 From: ozone10 Date: Tue, 26 Mar 2024 17:45:53 +0100 Subject: [PATCH] Change History GUI enhancement and tweaks - add 'Go to setting' for other Change History styles - make spacing consistent in preference - minor warning fix Close #14883 --- .../WinControls/ColourPicker/WordStyleDlg.cpp | 4 +- .../src/WinControls/Preference/preference.rc | 101 +++++++++--------- .../WinControls/Preference/preferenceDlg.cpp | 6 +- .../WinControls/Preference/preferenceDlg.h | 11 +- 4 files changed, 68 insertions(+), 54 deletions(-) diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp index d92756ba2..9edcb3370 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp @@ -960,7 +960,9 @@ std::pair WordStyleDlg::goToPreferencesSettings() result.first = margins; result.second = IDC_CHECK_BOOKMARKMARGE; } - else if (style._styleDesc == TEXT("Change History margin")) + else if (style._styleDesc == L"Change History margin" || style._styleDesc == L"Change History modified" + || style._styleDesc == L"Change History revert modified" || style._styleDesc == L"Change History revert origin" + || style._styleDesc == L"Change History saved") { result.first = margins; result.second = IDC_CHECK_CHANGHISTORYMARGIN; diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index dd6cbc02c..d2d2a5153 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -91,10 +91,10 @@ BEGIN LTEXT "S",IDC_CARETBLINKRATE_S_STATIC,140,114,12,8 RTEXT "F",IDC_CARETBLINKRATE_F_STATIC,68,114,12,8 - GROUPBOX "Line Wrap",IDC_LW_GB_STATIC,11,138,150,59,BS_CENTER - CONTROL "Default",IDC_RADIO_LWDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,16,151,68,10 - CONTROL "Aligned",IDC_RADIO_LWALIGN,"Button",BS_AUTORADIOBUTTON,16,166,68,10 - CONTROL "Indent",IDC_RADIO_LWINDENT,"Button",BS_AUTORADIOBUTTON,16,181,68,10 + GROUPBOX "Line Wrap",IDC_LW_GB_STATIC,11,136,150,59,BS_CENTER + CONTROL "Default",IDC_RADIO_LWDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,17,149,68,10 + CONTROL "Aligned",IDC_RADIO_LWALIGN,"Button",BS_AUTORADIOBUTTON,17,164,68,10 + CONTROL "Indent",IDC_RADIO_LWINDENT,"Button",BS_AUTORADIOBUTTON,17,179,68,10 CONTROL "Enable smooth font",IDC_CHECK_SMOOTHFONT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,13,270,10 CONTROL "Enable virtual space",IDC_CHECK_VIRTUALSPACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,28,270,10 @@ -109,25 +109,26 @@ IDD_PREFERENCE_SUB_EDITING2 DIALOGEX 115, 10, 460, 205 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "Multi-Editing",IDC_GB_STATIC_MULTIEDITING,12,6,290,59,BS_CENTER - CONTROL "Enable Multi-Editing (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,24,270,10 - CONTROL "Enable Column Selection to Multi-Editing",IDC_CHECK_COLUMN2MULTIEDITING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,39,270,10 + GROUPBOX "Multi-Editing",IDC_GB_STATIC_MULTIEDITING,11,3,290,59,BS_CENTER + CONTROL "Enable Multi-Editing (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,16,270,10 + CONTROL "Enable Column Selection to Multi-Editing",IDC_CHECK_COLUMN2MULTIEDITING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,31,270,10 - GROUPBOX "EOL (CRLF)",IDC_GB_STATIC_CRLF,318,6,131,59,BS_CENTER - CONTROL "Default",IDC_RADIO_ROUNDCORNER_CRLF,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,324,16,100,10 - CONTROL "Plain Text",IDC_RADIO_PLEINTEXT_CRLF,"Button",BS_AUTORADIOBUTTON,324,30,100,10 - CONTROL "Custom Color",IDC_CHECK_WITHCUSTOMCOLOR_CRLF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,324,50,100,10 - PUSHBUTTON "...",IDC_BUTTON_LAUNCHSTYLECONF_CRLF,429,47,16,14 + GROUPBOX "EOL (CRLF)",IDC_GB_STATIC_CRLF,311,3,138,59,BS_CENTER + CONTROL "Default",IDC_RADIO_ROUNDCORNER_CRLF,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,317,16,100,10 + CONTROL "Plain Text",IDC_RADIO_PLEINTEXT_CRLF,"Button",BS_AUTORADIOBUTTON,317,31,100,10 + CONTROL "Custom Color",IDC_CHECK_WITHCUSTOMCOLOR_CRLF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,317,47,100,10 + PUSHBUTTON "...",IDC_BUTTON_LAUNCHSTYLECONF_CRLF,429,44,16,14 - GROUPBOX "Non-Printing Characters",IDC_GB_STATIC_NPC,12,75,290,117,BS_CENTER - GROUPBOX "Appearance",IDC_STATIC_NPC_APPEARANCE,21,88,200,63,BS_CENTER - CONTROL "Abbreviation",IDC_RADIO_NPC_ABBREVIATION,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,33,102,110,10 - PUSHBUTTON "?",IDC_BUTTON_NPC_NOTE,147,100,16,14,NOT WS_TABSTOP - CONTROL "Codepoint",IDC_RADIO_NPC_CODEPOINT,"Button",BS_AUTORADIOBUTTON,33,116,110,10 - CONTROL "Custom Color",IDC_CHECK_NPC_COLOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,133,110,10 - PUSHBUTTON "...",IDC_BUTTON_NPC_LAUNCHSTYLECONF,147,130,16,14 - CONTROL "Apply Appearance settings to C0, C1 && Unicode EOL",IDC_CHECK_NPC_INCLUDECCUNIEOL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,153,281,10 - CONTROL "Prevent control character (C0 code) typing into document", IDC_CHECK_NPC_NOINPUTC0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,177,281,10 + GROUPBOX "Non-Printing Characters",IDC_GB_STATIC_NPC,11,68,310,121,BS_CENTER + GROUPBOX "",IDC_STATIC,21,78,290,89,BS_CENTER + GROUPBOX "Appearance",IDC_STATIC_NPC_APPEARANCE,31,88,150,59,BS_CENTER + CONTROL "Abbreviation",IDC_RADIO_NPC_ABBREVIATION,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,37,101,110,10 + PUSHBUTTON "?",IDC_BUTTON_NPC_NOTE,161,98,16,14,NOT WS_TABSTOP + CONTROL "Codepoint",IDC_RADIO_NPC_CODEPOINT,"Button",BS_AUTORADIOBUTTON,37,116,110,10 + CONTROL "Custom Color",IDC_CHECK_NPC_COLOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,132,110,10 + PUSHBUTTON "...",IDC_BUTTON_NPC_LAUNCHSTYLECONF,161,129,16,14 + CONTROL "Apply Appearance settings to C0, C1 && Unicode EOL",IDC_CHECK_NPC_INCLUDECCUNIEOL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,27,153,281,10 + CONTROL "Prevent control character (C0 code) typing into document", IDC_CHECK_NPC_NOINPUTC0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,173,281,10 END @@ -168,43 +169,43 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Fold Margin Style",IDC_FMS_GB_STATIC,22,21,83,89,BS_CENTER - CONTROL "Simple",IDC_RADIO_SIMPLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,31,34,59,10 - CONTROL "Arrow",IDC_RADIO_ARROW,"Button",BS_AUTORADIOBUTTON,31,48,60,10 - CONTROL "Circle tree",IDC_RADIO_CIRCLE,"Button",BS_AUTORADIOBUTTON,31,63,62,10 - CONTROL "None",IDC_RADIO_FOLDMARGENONE,"Button",BS_AUTORADIOBUTTON,31,92,61,10 - CONTROL "Box tree",IDC_RADIO_BOX,"Button",BS_AUTORADIOBUTTON,31,77,61,10 + CONTROL "Simple",IDC_RADIO_SIMPLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,28,34,62,10 + CONTROL "Arrow",IDC_RADIO_ARROW,"Button",BS_AUTORADIOBUTTON,28,49,62,10 + CONTROL "Circle tree",IDC_RADIO_CIRCLE,"Button",BS_AUTORADIOBUTTON,28,64,62,10 + CONTROL "Box tree",IDC_RADIO_BOX,"Button",BS_AUTORADIOBUTTON,28,79,62,10 + CONTROL "None",IDC_RADIO_FOLDMARGENONE,"Button",BS_AUTORADIOBUTTON,28,94,62,10 - GROUPBOX "Border Width",IDC_BORDERWIDTH_STATIC,22,121,83,47,BS_CENTER - CONTROL "",IDC_BORDERWIDTH_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,24,134,67,13 - LTEXT "0",IDC_BORDERWIDTHVAL_STATIC,92,135,12,8 - CONTROL "No edge",IDC_CHECK_NOEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,151,60,10 + GROUPBOX "Border Width",IDC_BORDERWIDTH_STATIC,22,116,83,45,BS_CENTER + CONTROL "",IDC_BORDERWIDTH_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,24,129,67,13 + LTEXT "0",IDC_BORDERWIDTHVAL_STATIC,92,130,12,8 + CONTROL "No edge",IDC_CHECK_NOEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,28,146,60,10 GROUPBOX "Vertical Edge Settings",IDC_VES_GB_STATIC,116,21,148,89,BS_CENTER - PUSHBUTTON "?",IDC_BUTTON_VES_TIP,181,33,16,14,NOT WS_TABSTOP - EDITTEXT IDC_COLUMNPOS_EDIT,126,51,125,36,ES_MULTILINE + PUSHBUTTON "?",IDC_BUTTON_VES_TIP,182,33,16,14,NOT WS_TABSTOP + EDITTEXT IDC_COLUMNPOS_EDIT,126,51,128,36,ES_MULTILINE CONTROL "Background mode",IDC_CHECK_EDGEBGMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,94,122,10 - GROUPBOX "Change History",IDC_GB_CHANGHISTORY,116,121,148,47,BS_CENTER - CONTROL "Show in the margin",IDC_CHECK_CHANGHISTORYMARGIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,135,140,10 - CONTROL "Show in the text",IDC_CHECK_CHANGHISTORYINDICATOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,150,140,10 + GROUPBOX "Change History",IDC_GB_CHANGHISTORY,116,116,148,45,BS_CENTER + CONTROL "Show in the margin",IDC_CHECK_CHANGHISTORYMARGIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,129,140,10 + CONTROL "Show in the text",IDC_CHECK_CHANGHISTORYINDICATOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,144,140,10 - GROUPBOX "Line Number",IDC_LINENUMBERMARGE_GB_STATIC,274,21,135,66,BS_CENTER - CONTROL "Display",IDC_CHECK_LINENUMBERMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,281,35,85,10 - CONTROL "Dynamic width",IDC_RADIO_DYNAMIC,"Button",BS_AUTORADIOBUTTON | WS_GROUP,293,51,110,10 - CONTROL "Constant width",IDC_RADIO_CONSTANT,"Button",BS_AUTORADIOBUTTON,293,65,108,10 + GROUPBOX "Line Number",IDC_LINENUMBERMARGE_GB_STATIC,274,21,135,59,BS_CENTER + CONTROL "Display",IDC_CHECK_LINENUMBERMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,34,85,10 + CONTROL "Dynamic width",IDC_RADIO_DYNAMIC,"Button",BS_AUTORADIOBUTTON | WS_GROUP,292,49,110,10 + CONTROL "Constant width",IDC_RADIO_CONSTANT,"Button",BS_AUTORADIOBUTTON,292,64,110,10 - GROUPBOX "Padding",IDC_PADDING_STATIC,274,94,135,63,BS_CENTER - RTEXT "Left",IDC_PADDINGLEFT_STATIC,280,108,45,8 - CONTROL "",IDC_PADDINGLEFT_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,328,107,67,13 - LTEXT "0",IDC_PADDINGLEFTVAL_STATIC,396,108,12,8 - RTEXT "Right",IDC_PADDINGRIGHT_STATIC,282,124,43,8 - CONTROL "",IDC_PADDINGRIGHT_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,328,123,67,13 - LTEXT "0",IDC_PADDINGRIGHTVAL_STATIC,396,124,12,8 - RTEXT "Distraction Free",IDC_DISTRACTIONFREE_STATIC,275,140,72,8 - CONTROL "",IDC_DISTRACTIONFREE_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,348,139,47,13 - LTEXT "0",IDC_DISTRACTIONFREEVAL_STATIC,396,140,12,8 + GROUPBOX "Padding",IDC_PADDING_STATIC,274,86,135,63,BS_CENTER + RTEXT "Left",IDC_PADDINGLEFT_STATIC,280,100,45,8 + CONTROL "",IDC_PADDINGLEFT_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,328,99,67,13 + LTEXT "0",IDC_PADDINGLEFTVAL_STATIC,396,100,12,8 + RTEXT "Right",IDC_PADDINGRIGHT_STATIC,282,116,43,8 + CONTROL "",IDC_PADDINGRIGHT_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,328,115,67,13 + LTEXT "0",IDC_PADDINGRIGHTVAL_STATIC,396,116,12,8 + RTEXT "Distraction Free",IDC_DISTRACTIONFREE_STATIC,275,132,72,8 + CONTROL "",IDC_DISTRACTIONFREE_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,348,131,47,13 + LTEXT "0",IDC_DISTRACTIONFREEVAL_STATIC,396,132,12,8 - CONTROL "Display bookmark",IDC_CHECK_BOOKMARKMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,281,163,150,10 + CONTROL "Display bookmark",IDC_CHECK_BOOKMARKMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,155,150,10 END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 9fb3dd174..11ac0a19d 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -5831,9 +5831,13 @@ intptr_t CALLBACK SearchingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR return TRUE; } + case WM_CTLCOLOREDIT: + { + return NppDarkMode::onCtlColorSofter(reinterpret_cast(wParam)); + } + case WM_CTLCOLORDLG: case WM_CTLCOLORSTATIC: - case WM_CTLCOLOREDIT: { return NppDarkMode::onCtlColorDarker(reinterpret_cast(wParam)); } diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.h b/PowerEditor/src/WinControls/Preference/preferenceDlg.h index 8f8235d2a..e683d53ad 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.h +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.h @@ -118,11 +118,18 @@ class MarginsBorderEdgeSubDlg : public StaticDialog friend class PreferenceDlg; public : MarginsBorderEdgeSubDlg() = default; - + ~MarginsBorderEdgeSubDlg() { + if (_verticalEdgeTip != nullptr) + { + ::DestroyWindow(_verticalEdgeTip); + _verticalEdgeTip = nullptr; + } + }; + private : HWND _verticalEdgeTip = nullptr; - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; void initScintParam(); };