mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-20 18:33:38 -04:00
TabBar::setNewTabButton() receives the action explicitly
This commit is contained in:
parent
9aa8cb4286
commit
837619cb55
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user