diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index ba2bb101..4917e0fe 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -789,6 +789,8 @@ + + diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 6aa375cd..8c82c33d 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -56,7 +56,11 @@ enum tb_stat {tb_saved, tb_unsaved, tb_ro}; #define DIR_LEFT true #define DIR_RIGHT false -int docTabIconIDs[] = {IDI_SAVED_ICON, IDI_UNSAVED_ICON, IDI_READONLY_ICON, IDI_MONITORING_ICON}; +int docTabIconIDs[][4] = +{ + { IDI_SAVED_ICON, IDI_UNSAVED_ICON, IDI_READONLY_ICON, IDI_MONITORING_ICON }, + { IDI_SAVED1_ICON, IDI_UNSAVED1_ICON, IDI_READONLY1_ICON, IDI_MONITORING_ICON }, +}; ToolBarButtonUnit toolBarIcons[] = { {IDM_FILE_NEW, IDI_NEW_OFF_ICON, IDI_NEW_ON_ICON, IDI_NEW_OFF_ICON, IDR_FILENEW}, @@ -230,9 +234,12 @@ LRESULT Notepad_plus::init(HWND hwnd) const ScintillaViewParams & svp1 = nppParam.getSVP(); int tabBarStatus = nppGUI._tabStatus; + _toReduceTabBar = ((tabBarStatus & TAB_REDUCE) != 0); - int iconDpiDynamicalSize = nppParam._dpiManager.scaleY(_toReduceTabBar?13:20); - _docTabIconList.create(iconDpiDynamicalSize, _pPublicInterface->getHinst(), docTabIconIDs, sizeof(docTabIconIDs)/sizeof(int)); + int iconDpiDynamicalSize = nppParam._dpiManager.scaleY(_toReduceTabBar ? 12 : 18); + + _docTabIconList.create(iconDpiDynamicalSize, _pPublicInterface->getHinst(), + docTabIconIDs[(tabBarStatus & TAB_ALTICONS) ? 1 : 0], sizeof(docTabIconIDs[0]) / sizeof(int)); _mainDocTab.init(_pPublicInterface->getHinst(), hwnd, &_mainEditView, &_docTabIconList); _subDocTab.init(_pPublicInterface->getHinst(), hwnd, &_subEditView, &_docTabIconList); @@ -753,7 +760,8 @@ bool Notepad_plus::saveGUIParams() (TabBarPlus::isVertical() ? TAB_VERTICAL:0) | \ (TabBarPlus::isMultiLine() ? TAB_MULTILINE:0) |\ (nppGUI._tabStatus & TAB_HIDE) | \ - (nppGUI._tabStatus & TAB_QUITONEMPTY); + (nppGUI._tabStatus & TAB_QUITONEMPTY) | \ + (nppGUI._tabStatus & TAB_ALTICONS); nppGUI._splitterPos = _subSplitter.isVertical()?POS_VERTICAL:POS_HORIZOTAL; UserDefineDialog *udd = _pEditView->getUserDefineDlg(); bool b = udd->isDocked(); diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index cfd64326..ff32e060 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -116,8 +116,11 @@ IDI_UNDO_DISABLE_ICON ICON "icons/undo_dis.ico" IDI_REDO_DISABLE_ICON ICON "icons/redo_dis.ico" // IDI_SAVED_ICON ICON "icons/saved.ico" +IDI_SAVED1_ICON ICON "icons/saved1.ico" IDI_UNSAVED_ICON ICON "icons/unsaved.ico" +IDI_UNSAVED1_ICON ICON "icons/unsaved1.ico" IDI_READONLY_ICON ICON "icons/readonly.ico" +IDI_READONLY1_ICON ICON "icons/readonly1.ico" IDI_MONITORING_ICON ICON "icons/monitoring.ico" IDI_DELETE_ICON ICON "icons/delete.ico" IDI_FIND_RESULT_ICON ICON "icons/findResult.ico" diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 3ab4547e..13b6b56a 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -4217,10 +4217,20 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) else isFailed = true; } + + val = element->Attribute(TEXT("iconSetNumber")); + if (val) + { + if (!lstrcmp(val, TEXT("1"))) + _nppGUI._tabStatus |= TAB_ALTICONS; + else if (!lstrcmp(val, TEXT("0"))) + _nppGUI._tabStatus |= 0; + else + isFailed = true; + } + if (isFailed) _nppGUI._tabStatus = oldValue; - - } else if (!lstrcmp(nm, TEXT("Auto-detection"))) { @@ -5603,7 +5613,7 @@ void NppParameters::createXmlTreeFromGUIParams() GUIConfigElement->InsertEndChild(TiXmlText(pStr)); } - // + // { TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); GUIConfigElement->SetAttribute(TEXT("name"), TEXT("TabBar")); @@ -5637,6 +5647,9 @@ void NppParameters::createXmlTreeFromGUIParams() pStr = (_nppGUI._tabStatus & TAB_QUITONEMPTY) ? TEXT("yes") : TEXT("no"); GUIConfigElement->SetAttribute(TEXT("quitOnEmpty"), pStr); + + pStr = (_nppGUI._tabStatus & TAB_ALTICONS) ? TEXT("1") : TEXT("0"); + GUIConfigElement->SetAttribute(TEXT("iconSetNumber"), pStr); } // vertical diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 8624c08a..5d7d03d3 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -63,6 +63,7 @@ const int TAB_VERTICAL = 64; //0000 0100 0000 const int TAB_MULTILINE = 128; //0000 1000 0000 const int TAB_HIDE = 256; //0001 0000 0000 const int TAB_QUITONEMPTY = 512; //0010 0000 0000 +const int TAB_ALTICONS = 1024; //0100 0000 0000 enum class EolType: std::uint8_t diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 1542c95d..fe3e2797 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -60,14 +60,15 @@ BEGIN GROUPBOX "Tab Bar",IDC_TABBAR_GB_STATIC,223,6,176,156,BS_CENTER CONTROL "Hide",IDC_CHECK_TAB_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,15,108,10 CONTROL "Multi-line",IDC_CHECK_TAB_MULTILINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,29,134,10 - CONTROL "Vertical",IDC_CHECK_TAB_VERTICAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,43,134,10 - CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,58,108,10 - CONTROL "Lock (no drag and drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,72,134,10 - CONTROL "Darken inactive tabs",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,87,134,10 - CONTROL "Draw a coloured bar on active tab",IDC_CHECK_ORANGE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,229,102,137,10 - CONTROL "Show close button on each tab",IDC_CHECK_ENABLETABCLOSE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,229,117,133,10 + CONTROL "Vertical",IDC_CHECK_TAB_VERTICAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,41,134,10 + CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,54,108,10 + CONTROL "Alternate icons (need to restart Notepad++)", IDC_CHECK_TAB_ALTICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,67,164,10 + CONTROL "Lock (no drag and drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,80,134,10 + CONTROL "Darken inactive tabs",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,93,134,10 + CONTROL "Draw a coloured bar on active tab",IDC_CHECK_ORANGE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,229,106,137,10 + CONTROL "Show close button on each tab",IDC_CHECK_ENABLETABCLOSE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,229,119,133,10 CONTROL "Double click to close document",IDC_CHECK_DBCLICK2CLOSE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,229,132,133,10 - CONTROL "Exit on close the last tab",IDC_CHECK_TAB_LAST_EXIT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,229,147,165,10 + CONTROL "Exit on close the last tab",IDC_CHECK_TAB_LAST_EXIT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,229,145,165,10 CONTROL "Show status bar",IDC_CHECK_SHOWSTATUSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,57,169,130,10 CONTROL "Hide menu bar (use Alt or F10 key to toggle)",IDC_CHECK_HIDEMENUBAR, "Button", BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,223,169,218,10 END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 11488677..fa1976c2 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -391,6 +391,7 @@ INT_PTR CALLBACK BarsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) ::SendDlgItemMessage(_hSelf, IDC_CHECK_TAB_VERTICAL, BM_SETCHECK, tabBarStatus & TAB_VERTICAL, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_TAB_MULTILINE, BM_SETCHECK, tabBarStatus & TAB_MULTILINE, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_TAB_LAST_EXIT, BM_SETCHECK, tabBarStatus & TAB_QUITONEMPTY, 0); + ::SendDlgItemMessage(_hSelf, IDC_CHECK_TAB_ALTICONS, BM_SETCHECK, tabBarStatus & TAB_ALTICONS, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_TAB_HIDE, BM_SETCHECK, tabBarStatus & TAB_HIDE, 0); ::SendMessage(_hSelf, WM_COMMAND, IDC_CHECK_TAB_HIDE, 0); @@ -470,6 +471,7 @@ INT_PTR CALLBACK BarsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_ENABLETABCLOSE), !toBeHidden); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_DBCLICK2CLOSE), !toBeHidden); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_TAB_LAST_EXIT), !toBeHidden); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_TAB_ALTICONS), !toBeHidden); ::SendMessage(::GetParent(_hParent), NPPM_HIDETABBAR, 0, toBeHidden); return TRUE; @@ -490,6 +492,12 @@ INT_PTR CALLBACK BarsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) } return TRUE; + case IDC_CHECK_TAB_ALTICONS: + { + NppGUI& nppGUI = const_cast(nppParam.getNppGUI()); + nppGUI._tabStatus ^= TAB_ALTICONS; + return TRUE; + } case IDC_CHECK_REDUCE : ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_REDUCETABBAR, 0); diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index 2eb66cce..c37b3dff 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -62,6 +62,7 @@ #define IDC_DOCSWITCH_GB_STATIC (IDD_PREFERENCE_BAR_BOX + 25) #define IDC_CHECK_DOCSWITCH (IDD_PREFERENCE_BAR_BOX + 26) #define IDC_CHECK_DOCSWITCH_NOEXTCOLUMN (IDD_PREFERENCE_BAR_BOX + 27) + #define IDC_CHECK_TAB_ALTICONS (IDD_PREFERENCE_BAR_BOX + 28) #define IDD_PREFERENCE_MULTIINSTANCE_BOX 6150 //(IDD_PREFERENCE_BOX + 150) #define IDC_MULTIINST_GB_STATIC (IDD_PREFERENCE_MULTIINSTANCE_BOX + 1) diff --git a/PowerEditor/src/icons/readonly1.ico b/PowerEditor/src/icons/readonly1.ico new file mode 100644 index 00000000..3c1196c9 Binary files /dev/null and b/PowerEditor/src/icons/readonly1.ico differ diff --git a/PowerEditor/src/icons/saved1.ico b/PowerEditor/src/icons/saved1.ico new file mode 100644 index 00000000..77ea185b Binary files /dev/null and b/PowerEditor/src/icons/saved1.ico differ diff --git a/PowerEditor/src/icons/unsaved1.ico b/PowerEditor/src/icons/unsaved1.ico new file mode 100644 index 00000000..468114e7 Binary files /dev/null and b/PowerEditor/src/icons/unsaved1.ico differ diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index 13ec6cc2..f07e31ed 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -129,11 +129,14 @@ #define IDI_SYNCH_ON_ICON 417 #define IDI_SYNCH_DISABLE_ICON 418 -#define IDI_SAVED_ICON 501 -#define IDI_UNSAVED_ICON 502 +#define IDI_SAVED_ICON 501 +#define IDI_UNSAVED_ICON 502 #define IDI_READONLY_ICON 503 #define IDI_FIND_RESULT_ICON 504 #define IDI_MONITORING_ICON 505 +#define IDI_SAVED1_ICON 506 +#define IDI_UNSAVED1_ICON 507 +#define IDI_READONLY1_ICON 508 #define IDI_PROJECT_WORKSPACE 601 #define IDI_PROJECT_WORKSPACEDIRTY 602