this, SLOT(showContextMenu(const QPoint &)));
#if QT_VERSION >= 0x040500
connect(tb, SIGNAL(tabCloseRequested(int)),
- tb, SLOT(on_tabCloseRequested(int)));
+ this, SLOT(closeTab(int)));
#endif
setUsesScrollButtons(true);
wa->view().hideWorkArea(wa);
}
+
+void TabWorkArea::closeTab(int index)
+{
+ on_currentTabChanged(index);
+ GuiWorkArea * wa;
+ if (index == -1)
+ wa = currentWorkArea();
+ else {
+ wa = dynamic_cast<GuiWorkArea *>(widget(index));
+ LASSERT(wa, /**/);
+ }
+ wa->view().hideWorkArea(wa);
+}
+
+
///
class DisplayPath {
public:
}
-void DragTabBar::on_tabCloseRequested(int index)
-{
- setCurrentIndex(index);
- lyx::dispatch(FuncRequest(LFUN_BUFFER_CLOSE));
-}
-
-
#if QT_VERSION < 0x040300
int DragTabBar::tabAt(QPoint const & position) const
{
void closeCurrentBuffer();
/// close current tab, or the one given by \c clicked_tab_
void closeCurrentTab();
+ /// close the tab given by \c index
+ void closeTab(int index);
///
void updateTabTexts();
Q_SIGNALS:
///
void tabMoveRequested(int fromIndex, int toIndex);
-
-private Q_SLOTS:
- ///
- void on_tabCloseRequested(int index);
};
} // namespace frontend