TabBar::setNewTabButton() receives the action explicitly

This commit is contained in:
Veloman Yunkan 2024-03-12 17:30:21 +04:00
parent 9aa8cb4286
commit 837619cb55
3 changed files with 4 additions and 4 deletions

View File

@ -82,7 +82,7 @@ void KiwixApp::init()
createActions();
mp_mainWindow = new MainWindow;
getTabWidget()->setContentManagerView(mp_manager->getView());
getTabWidget()->setNewTabButton();
getTabWidget()->setNewTabButton(getAction(KiwixApp::NewTabAction));
postInit();
mp_errorDialog = new QErrorMessage(mp_mainWindow);
setActivationWindow(mp_mainWindow);

View File

@ -101,10 +101,10 @@ void TabBar::setContentManagerView(ContentManagerView* view)
setTabButton(idx, RightSide, nullptr);
}
void TabBar::setNewTabButton()
void TabBar::setNewTabButton(QAction* newTabAction)
{
QToolButton *tb = new QToolButton();
tb->setDefaultAction(KiwixApp::instance()->getAction(KiwixApp::NewTabAction));
tb->setDefaultAction(newTabAction);
tb->setIcon(QIcon(":/icons/new-tab-icon.svg"));
int idx = addTab("");
setTabEnabled(idx, false);

View File

@ -24,7 +24,7 @@ public:
void setStackedWidget(QStackedWidget* widget);
void setContentManagerView(ContentManagerView* view);
void setNewTabButton();
void setNewTabButton(QAction* newTabAction);
ZimView* createNewTab(bool setCurrent, bool adjacentToCurrentTab);
ZimView* currentZimView() {