Skip to content

Commit

Permalink
Make "Show close/pin button on each inactive tab" optional
Browse files Browse the repository at this point in the history
  • Loading branch information
donho committed Jan 14, 2025
1 parent 26c3008 commit 8fde4bd
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 104 deletions.
1 change: 1 addition & 0 deletions PowerEditor/src/Notepad_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ bool Notepad_plus::saveGUIParams()
(TabBarPlus::isDbClk2Close() ? TAB_DBCLK2CLOSE : 0) | \
(TabBarPlus::isVertical() ? TAB_VERTICAL : 0) | \
(TabBarPlus::isMultiLine() ? TAB_MULTILINE : 0) |\
(nppGUI._tabStatus & TAB_INACTIVETABSHOWBUTTON) | \
(nppGUI._tabStatus & TAB_HIDE) | \
(nppGUI._tabStatus & TAB_QUITONEMPTY) | \
(nppGUI._tabStatus & TAB_ALTICONS);
Expand Down
12 changes: 8 additions & 4 deletions PowerEditor/src/Notepad_plus.rc
Original file line number Diff line number Diff line change
Expand Up @@ -327,24 +327,28 @@ IDR_FILEBROWSER BITMAP "icons/standard/toolbar/fileBrowser.bm
IDR_FILEMONITORING BITMAP "icons/standard/toolbar/monitoring.bmp"

IDR_CLOSETAB ICON "icons/standard/tabbar/closeTabButton.ico"
IDR_CLOSETAB_INACT ICON "icons/standard/tabbar/empty.ico"
IDR_CLOSETAB_INACT ICON "icons/standard/tabbar/closeTabButton_hoverOnTab.ico"
IDR_CLOSETAB_INACT_EMPTY ICON "icons/standard/tabbar/empty.ico"
IDR_CLOSETAB_HOVERIN ICON "icons/standard/tabbar/closeTabButton_hoverIn.ico"
IDR_CLOSETAB_HOVERONTAB ICON "icons/standard/tabbar/closeTabButton_hoverOnTab.ico"
IDR_CLOSETAB_PUSH ICON "icons/standard/tabbar/closeTabButton_push.ico"
IDR_CLOSETAB_DM ICON "icons/dark/tabbar/closeTabButton.ico"
IDR_CLOSETAB_INACT_DM ICON "icons/dark/tabbar/empty.ico"
IDR_CLOSETAB_INACT_DM ICON "icons/dark/tabbar/closeTabButton.ico"
IDR_CLOSETAB_INACT_EMPTY_DM ICON "icons/dark/tabbar/empty.ico"
IDR_CLOSETAB_HOVERIN_DM ICON "icons/dark/tabbar/closeTabButton_hoverIn.ico"
IDR_CLOSETAB_HOVERONTAB_DM ICON "icons/dark/tabbar/closeTabButton_hoverOnTab.ico"
IDR_CLOSETAB_PUSH_DM ICON "icons/dark/tabbar/closeTabButton_push.ico"

IDR_PINTAB ICON "icons/standard/tabbar/pinTabButton.ico"
IDR_PINTAB_INACT ICON "icons/standard/tabbar/empty.ico"
IDR_PINTAB_INACT ICON "icons/standard/tabbar/pinTabButton.ico"
IDR_PINTAB_INACT_EMPTY ICON "icons/standard/tabbar/empty.ico"
IDR_PINTAB_HOVERIN ICON "icons/standard/tabbar/pinTabButton_pinned.ico"
IDR_PINTAB_HOVERONTAB ICON "icons/standard/tabbar/pinTabButton.ico"
IDR_PINTAB_PINNED ICON "icons/standard/tabbar/pinTabButton_pinned.ico"
IDR_PINTAB_PINNEDHOVERIN ICON "icons/standard/tabbar/pinTabButton.ico"
IDR_PINTAB_DM ICON "icons/dark/tabbar/pinTabButton.ico"
IDR_PINTAB_INACT_DM ICON "icons/dark/tabbar/empty.ico"
IDR_PINTAB_INACT_DM ICON "icons/dark/tabbar/pinTabButton.ico"
IDR_PINTAB_INACT_EMPTY_DM ICON "icons/dark/tabbar/empty.ico"
IDR_PINTAB_HOVERIN_DM ICON "icons/dark/tabbar/pinTabButton_pinned.ico"
IDR_PINTAB_HOVERONTAB_DM ICON "icons/dark/tabbar/pinTabButton.ico"
IDR_PINTAB_PINNED_DM ICON "icons/dark/tabbar/pinTabButton_pinned.ico"
Expand Down
13 changes: 13 additions & 0 deletions PowerEditor/src/NppBigSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4088,6 +4088,19 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
return TRUE;
}

case NPPM_INTERNAL_DRAWINACTIVETABBARBUTTON:
{
::SendMessage(_mainDocTab.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
::SendMessage(_subDocTab.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);

::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0);
_mainDocTab.refresh();
_subDocTab.refresh();

return TRUE;
}


default:
{
if (message == WDN_NOTIFY)
Expand Down
14 changes: 14 additions & 0 deletions PowerEditor/src/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4932,6 +4932,17 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
_nppGUI._tabStatus |= TAB_PINBUTTON;
}

val = element->Attribute(L"buttonsOninactiveTabs");
if (val)
{
if (!lstrcmp(val, L"yes"))
_nppGUI._tabStatus |= TAB_INACTIVETABSHOWBUTTON;
else if (!lstrcmp(val, L"no"))
_nppGUI._tabStatus |= 0;
else
isFailed = true;
}

val = element->Attribute(L"doubleClick2Close");
if (val)
{
Expand Down Expand Up @@ -7282,6 +7293,9 @@ void NppParameters::createXmlTreeFromGUIParams()
pStr = (_nppGUI._tabStatus & TAB_PINBUTTON) ? L"yes" : L"no";
GUIConfigElement->SetAttribute(L"pinButton", pStr);

pStr = (_nppGUI._tabStatus & TAB_INACTIVETABSHOWBUTTON) ? L"yes" : L"no";
GUIConfigElement->SetAttribute(L"buttonsOninactiveTabs", pStr);

pStr = (_nppGUI._tabStatus & TAB_DBCLK2CLOSE) ? L"yes" : L"no";
GUIConfigElement->SetAttribute(L"doubleClick2Close", pStr);

Expand Down
25 changes: 13 additions & 12 deletions PowerEditor/src/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,19 @@ const int UDD_DOCKED = 2; // 0000 0010
// 2 : 0000 0010 hide & docked
// 3 : 0000 0011 show & docked

const int TAB_DRAWTOPBAR = 1; //0000 0000 0001
const int TAB_DRAWINACTIVETAB = 2; //0000 0000 0010
const int TAB_DRAGNDROP = 4; //0000 0000 0100
const int TAB_REDUCE = 8; //0000 0000 1000
const int TAB_CLOSEBUTTON = 16; //0000 0001 0000
const int TAB_DBCLK2CLOSE = 32; //0000 0010 0000
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
const int TAB_PINBUTTON = 2048; //1000 0000 0000
const int TAB_DRAWTOPBAR = 1; // 0000 0000 0000 0001
const int TAB_DRAWINACTIVETAB = 2; // 0000 0000 0000 0010
const int TAB_DRAGNDROP = 4; // 0000 0000 0000 0100
const int TAB_REDUCE = 8; // 0000 0000 0000 1000
const int TAB_CLOSEBUTTON = 16; // 0000 0000 0001 0000
const int TAB_DBCLK2CLOSE = 32; // 0000 0000 0010 0000
const int TAB_VERTICAL = 64; // 0000 0000 0100 0000
const int TAB_MULTILINE = 128; // 0000 0000 1000 0000
const int TAB_HIDE = 256; // 0000 0001 0000 0000
const int TAB_QUITONEMPTY = 512; // 0000 0010 0000 0000
const int TAB_ALTICONS = 1024; // 0000 0100 0000 0000
const int TAB_PINBUTTON = 2048; // 0000 1000 0000 0000
const int TAB_INACTIVETABSHOWBUTTON = 4096; // 0001 0000 0000 0000

const bool activeText = true;
const bool activeNumeric = false;
Expand Down
59 changes: 32 additions & 27 deletions PowerEditor/src/WinControls/Preference/preference.rc
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,38 @@ IDD_PREFERENCE_SUB_GENRAL DIALOGEX 115, 10, 460, 205
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
GROUPBOX "Localization",IDC_LOCALIZATION_GB_STATIC,27,0,186,36,BS_CENTER
COMBOBOX IDC_COMBO_LOCALIZATION,60,14,125,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Status Bar",IDC_STATUSBAR_GB_STATIC,27,39,186,31,BS_CENTER
CONTROL "Hide",IDC_CHECK_HIDESTATUSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,52,174,10
GROUPBOX "Toolbar",IDC_TOOLBAR_GB_STATIC,27,75,186,91,BS_CENTER
CONTROL "Hide",IDC_CHECK_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,84,100,10
CONTROL "Fluent UI: small",IDC_RADIO_SMALLICON,"Button",BS_AUTORADIOBUTTON,33,100,174,10
CONTROL "Fluent UI: large",IDC_RADIO_BIGICON,"Button",BS_AUTORADIOBUTTON,33,113,174,10
CONTROL "Filled Fluent UI: small",IDC_RADIO_SMALLICON2,"Button",BS_AUTORADIOBUTTON,33,126,174,10
CONTROL "Filled Fluent UI: large",IDC_RADIO_BIGICON2,"Button",BS_AUTORADIOBUTTON,33,139,174,10
CONTROL "Standard icons: small",IDC_RADIO_STANDARD,"Button",BS_AUTORADIOBUTTON,33,152,174,10
GROUPBOX "Tab Bar",IDC_TABBAR_GB_STATIC,223,0,177,166,BS_CENTER
CONTROL "Hide",IDC_CHECK_TAB_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,8,100,10
CONTROL "Multi-line",IDC_CHECK_TAB_MULTILINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,21,164,10
CONTROL "Vertical",IDC_CHECK_TAB_VERTICAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,34,164,10
CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,47,164,10
CONTROL "Alternate icons",IDC_CHECK_TAB_ALTICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,60,164,10
CONTROL "Lock (no drag and drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,73,164,10
CONTROL "Change inactive tab color",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,86,164,10
CONTROL "Draw a coloured bar on active tab",IDC_CHECK_ORANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,99,164,10
CONTROL "Show close button",IDC_CHECK_ENABLETABCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,112,164,10
CONTROL "Enable pin tab feature", IDC_CHECK_ENABLETABPIN,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 229, 125, 164, 10
CONTROL "Double click to close document",IDC_CHECK_DBCLICK2CLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,138,164,10
CONTROL "Exit on close the last tab",IDC_CHECK_TAB_LAST_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,151,164,10
GROUPBOX "Menu",IDC_MENU_GB_STATIC,27,168,373,34,BS_CENTER
CONTROL "Hide menu bar (use Alt or F10 key to toggle)",IDC_CHECK_HIDEMENUBAR, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,176,218,10
CONTROL "Hide right shortcuts + ? ? from the menu bar (Need to restart Notepad++)",IDC_CHECK_HIDERIGHTSHORTCUTSOFMENUBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,189,350,10
GROUPBOX "Localization",IDC_LOCALIZATION_GB_STATIC,39,0,186,36,BS_CENTER
COMBOBOX IDC_COMBO_LOCALIZATION,72,14,125,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP

GROUPBOX "Menu",IDC_MENU_GB_STATIC,39,39,186,34,BS_CENTER
CONTROL "Hide (use Alt or F10 key to toggle)",IDC_CHECK_HIDEMENUBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,47,174,10
CONTROL "Hide right shortcuts + ▼ ✕",IDC_CHECK_HIDERIGHTSHORTCUTSOFMENUBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,60,174,10

GROUPBOX "Toolbar",IDC_TOOLBAR_GB_STATIC,39,75,186,91,BS_CENTER
CONTROL "Hide",IDC_CHECK_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,84,100,10
CONTROL "Fluent UI: small",IDC_RADIO_SMALLICON,"Button",BS_AUTORADIOBUTTON,45,100,174,10
CONTROL "Fluent UI: large",IDC_RADIO_BIGICON,"Button",BS_AUTORADIOBUTTON,45,113,174,10
CONTROL "Filled Fluent UI: small",IDC_RADIO_SMALLICON2,"Button",BS_AUTORADIOBUTTON,45,126,174,10
CONTROL "Filled Fluent UI: large",IDC_RADIO_BIGICON2,"Button",BS_AUTORADIOBUTTON,45,139,174,10
CONTROL "Standard icons: small",IDC_RADIO_STANDARD,"Button",BS_AUTORADIOBUTTON,45,152,174,10

GROUPBOX "Status Bar",IDC_STATUSBAR_GB_STATIC,39,169,186,26,BS_CENTER
CONTROL "Hide",IDC_CHECK_HIDESTATUSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,179,174,10

GROUPBOX "Tab Bar",IDC_TABBAR_GB_STATIC,235,0,177,195,BS_CENTER
CONTROL "Hide",IDC_CHECK_TAB_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,15,100,10
CONTROL "Multi-line",IDC_CHECK_TAB_MULTILINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,28,164,10
CONTROL "Vertical",IDC_CHECK_TAB_VERTICAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,41,164,10
CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,54,164,10
CONTROL "Alternate icons",IDC_CHECK_TAB_ALTICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,67,164,10
CONTROL "Lock (no drag and drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,80,164,10
CONTROL "Change inactive tab color",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,93,164,10
CONTROL "Draw a coloured bar on active tab",IDC_CHECK_ORANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,106,164,10
CONTROL "Show close button",IDC_CHECK_ENABLETABCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,119,164,10
CONTROL "Enable pin tab feature",IDC_CHECK_ENABLETABPIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,132,164,10
CONTROL "Show buttons on inactive tabs",IDC_CHECK_INACTTABDRAWBUTTON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,144,164,10
CONTROL "Double click to close document",IDC_CHECK_DBCLICK2CLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,157,164,10
CONTROL "Exit on close the last tab",IDC_CHECK_TAB_LAST_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,241,170,164,10
END

IDD_PREFERENCE_SUB_EDITING DIALOGEX 115, 10, 460, 205
Expand Down
51 changes: 44 additions & 7 deletions PowerEditor/src/WinControls/Preference/preferenceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
{
case WM_INITDIALOG :
{
const NppGUI & nppGUI = nppParam.getNppGUI();
NppGUI & nppGUI = nppParam.getNppGUI();
toolBarStatusType tbStatus = nppGUI._toolBarStatus;
int tabBarStatus = nppGUI._tabStatus;
bool showTool = nppGUI._toolbarShow;
Expand Down Expand Up @@ -609,8 +609,22 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
::SendDlgItemMessage(_hSelf, IDC_CHECK_LOCK, BM_SETCHECK, !(tabBarStatus & TAB_DRAGNDROP), 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_ORANGE, BM_SETCHECK, tabBarStatus & TAB_DRAWTOPBAR, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_DRAWINACTIVE, BM_SETCHECK, tabBarStatus & TAB_DRAWINACTIVETAB, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLETABCLOSE, BM_SETCHECK, tabBarStatus & TAB_CLOSEBUTTON, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLETABPIN, BM_SETCHECK, tabBarStatus & TAB_PINBUTTON, 0);

bool showCloseButton = tabBarStatus & TAB_CLOSEBUTTON;
bool enablePinButton = tabBarStatus & TAB_PINBUTTON;
bool showButtonOnInactiveTabs = tabBarStatus & TAB_INACTIVETABSHOWBUTTON;

::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLETABCLOSE, BM_SETCHECK, showCloseButton, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLETABPIN, BM_SETCHECK, enablePinButton, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_INACTTABDRAWBUTTON, BM_SETCHECK, showButtonOnInactiveTabs, 0);

if (!(showCloseButton || enablePinButton))
{
nppGUI._tabStatus &= ~TAB_INACTIVETABSHOWBUTTON;
::SendDlgItemMessage(_hSelf, IDC_CHECK_INACTTABDRAWBUTTON, BM_SETCHECK, FALSE, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_INACTTABDRAWBUTTON), FALSE);
}

::SendDlgItemMessage(_hSelf, IDC_CHECK_DBCLICK2CLOSE, BM_SETCHECK, tabBarStatus & TAB_DBCLK2CLOSE, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_TAB_VERTICAL, BM_SETCHECK, tabBarStatus & TAB_VERTICAL, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_TAB_MULTILINE, BM_SETCHECK, tabBarStatus & TAB_MULTILINE, 0);
Expand Down Expand Up @@ -753,13 +767,36 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWINACIVETAB, 0, 0);
return TRUE;

case IDC_CHECK_ENABLETABCLOSE :
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABBARCLOSEBUTTON, 0, 0);
case IDC_CHECK_ENABLETABCLOSE:
case IDC_CHECK_ENABLETABPIN:
{
::SendMessage(::GetParent(_hParent), wParam == IDC_CHECK_ENABLETABCLOSE ? NPPM_INTERNAL_DRAWTABBARCLOSEBUTTON : NPPM_INTERNAL_DRAWTABBARPINBUTTON, 0, 0);

bool showCloseButton = isCheckedOrNot(IDC_CHECK_ENABLETABCLOSE);
bool enablePinButton = isCheckedOrNot(IDC_CHECK_ENABLETABPIN);

if (!(showCloseButton || enablePinButton))
{
nppParam.getNppGUI()._tabStatus &= ~TAB_INACTIVETABSHOWBUTTON;
::SendDlgItemMessage(_hSelf, IDC_CHECK_INACTTABDRAWBUTTON, BM_SETCHECK, FALSE, 0);
}
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_INACTTABDRAWBUTTON), showCloseButton || enablePinButton);

return TRUE;
}

case IDC_CHECK_ENABLETABPIN:
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABBARPINBUTTON, 0, 0);
case IDC_CHECK_INACTTABDRAWBUTTON:
{
const bool isChecked = isCheckedOrNot(IDC_CHECK_INACTTABDRAWBUTTON);
NppGUI& nppgui = nppParam.getNppGUI();
if (isChecked)
nppgui._tabStatus |= TAB_INACTIVETABSHOWBUTTON;
else
nppgui._tabStatus &= ~TAB_INACTIVETABSHOWBUTTON;

::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWINACTIVETABBARBUTTON, 0, 0);
return TRUE;
}

case IDC_CHECK_DBCLICK2CLOSE :
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TABDBCLK2CLOSE, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/WinControls/Preference/preference_rc.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define IDC_CHECK_LOCK (IDD_PREFERENCE_SUB_GENRAL + 8)
#define IDC_CHECK_DRAWINACTIVE (IDD_PREFERENCE_SUB_GENRAL + 9)
#define IDC_CHECK_ORANGE (IDD_PREFERENCE_SUB_GENRAL + 10)
//#define IDC_CHECK_SHOWSTATUSBAR (IDD_PREFERENCE_SUB_GENRAL + 11)
#define IDC_CHECK_INACTTABDRAWBUTTON (IDD_PREFERENCE_SUB_GENRAL + 11)
#define IDC_CHECK_ENABLETABCLOSE (IDD_PREFERENCE_SUB_GENRAL + 12)
#define IDC_CHECK_DBCLICK2CLOSE (IDD_PREFERENCE_SUB_GENRAL + 13)
#define IDC_CHECK_ENABLEDOCSWITCHER (IDD_PREFERENCE_SUB_GENRAL + 14)
Expand Down
31 changes: 27 additions & 4 deletions PowerEditor/src/WinControls/TabBar/TabBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,27 @@ void TabBarPlus::setCloseBtnImageList()
int iconSize = 0;
std::vector<int> ids;

NppParameters& nppParam = NppParameters::getInstance();
bool showInactiveTabButtons = nppParam.getNppGUI()._tabStatus & TAB_INACTIVETABSHOWBUTTON;

if (NppDarkMode::isEnabled())
{
iconSize = g_TabCloseBtnSize_DM;
ids = { IDR_CLOSETAB_DM, IDR_CLOSETAB_INACT_DM, IDR_CLOSETAB_HOVERIN_DM, IDR_CLOSETAB_HOVERONTAB_DM, IDR_CLOSETAB_PUSH_DM };

if (showInactiveTabButtons)
ids = { IDR_CLOSETAB_DM, IDR_CLOSETAB_INACT_DM, IDR_CLOSETAB_HOVERIN_DM, IDR_CLOSETAB_HOVERONTAB_DM, IDR_CLOSETAB_PUSH_DM };
else
ids = { IDR_CLOSETAB_DM, IDR_CLOSETAB_INACT_EMPTY_DM, IDR_CLOSETAB_HOVERIN_DM, IDR_CLOSETAB_HOVERONTAB_DM, IDR_CLOSETAB_PUSH_DM };
}
else
{
iconSize = g_TabCloseBtnSize;
ids = { IDR_CLOSETAB, IDR_CLOSETAB_INACT, IDR_CLOSETAB_HOVERIN, IDR_CLOSETAB_HOVERONTAB, IDR_CLOSETAB_PUSH };

if (showInactiveTabButtons)
ids = { IDR_CLOSETAB, IDR_CLOSETAB_INACT, IDR_CLOSETAB_HOVERIN, IDR_CLOSETAB_HOVERONTAB, IDR_CLOSETAB_PUSH };
else
ids = { IDR_CLOSETAB, IDR_CLOSETAB_INACT_EMPTY, IDR_CLOSETAB_HOVERIN, IDR_CLOSETAB_HOVERONTAB, IDR_CLOSETAB_PUSH };

}

if (_hCloseBtnImgLst != nullptr)
Expand Down Expand Up @@ -560,15 +572,26 @@ void TabBarPlus::setPinBtnImageList()
int iconSize = 0;
std::vector<int> ids;

NppParameters& nppParam = NppParameters::getInstance();
bool showInactiveTabButtons = nppParam.getNppGUI()._tabStatus & TAB_INACTIVETABSHOWBUTTON;

if (NppDarkMode::isEnabled())
{
iconSize = g_TabPinBtnSize_DM;
ids = { IDR_PINTAB_DM, IDR_PINTAB_INACT_DM, IDR_PINTAB_HOVERIN_DM, IDR_PINTAB_HOVERONTAB_DM, IDR_PINTAB_PINNED_DM, IDR_PINTAB_PINNEDHOVERIN_DM };

if (showInactiveTabButtons)
ids = { IDR_PINTAB_DM, IDR_PINTAB_INACT_DM, IDR_PINTAB_HOVERIN_DM, IDR_PINTAB_HOVERONTAB_DM, IDR_PINTAB_PINNED_DM, IDR_PINTAB_PINNEDHOVERIN_DM };
else
ids = { IDR_PINTAB_DM, IDR_PINTAB_INACT_EMPTY_DM, IDR_PINTAB_HOVERIN_DM, IDR_PINTAB_HOVERONTAB_DM, IDR_PINTAB_PINNED_DM, IDR_PINTAB_PINNEDHOVERIN_DM };
}
else
{
iconSize = g_TabPinBtnSize;
ids = { IDR_PINTAB, IDR_PINTAB_INACT, IDR_PINTAB_HOVERIN, IDR_PINTAB_HOVERONTAB, IDR_PINTAB_PINNED, IDR_PINTAB_PINNEDHOVERIN };

if (showInactiveTabButtons)
ids = { IDR_PINTAB, IDR_PINTAB_INACT, IDR_PINTAB_HOVERIN, IDR_PINTAB_HOVERONTAB, IDR_PINTAB_PINNED, IDR_PINTAB_PINNEDHOVERIN };
else
ids = { IDR_PINTAB, IDR_PINTAB_INACT_EMPTY, IDR_PINTAB_HOVERIN, IDR_PINTAB_HOVERONTAB, IDR_PINTAB_PINNED, IDR_PINTAB_PINNEDHOVERIN };
}

if (_hPinBtnImgLst != nullptr)
Expand Down
Loading

0 comments on commit 8fde4bd

Please sign in to comment.