any comments before commit?
pavel
diff --git a/src/frontends/qt4/GuiWorkArea.cpp 
b/src/frontends/qt4/GuiWorkArea.cpp
index b0eb1e3..37c9db7 100644
--- a/src/frontends/qt4/GuiWorkArea.cpp
+++ b/src/frontends/qt4/GuiWorkArea.cpp
@@ -1334,6 +1334,10 @@ TabWorkArea::TabWorkArea(QWidget * parent)
        tb->setContextMenuPolicy(Qt::CustomContextMenu);
        connect(tb, SIGNAL(customContextMenuRequested(const QPoint &)),
                this, SLOT(showContextMenu(const QPoint &)));
+#if QT_VERSION >= 0x040500
+       connect(tb, SIGNAL(tabCloseRequested(int)),
+               tb, SLOT(on_tabCloseRequested(int)));
+#endif
 
        setUsesScrollButtons(true);
 }
@@ -1741,6 +1745,16 @@ DragTabBar::DragTabBar(QWidget* parent)
        : QTabBar(parent)
 {
        setAcceptDrops(true);
+#if QT_VERSION >= 0x040500
+       setTabsClosable(true);
+#endif
+}
+
+
+void DragTabBar::on_tabCloseRequested(int index)
+{
+       setCurrentIndex(index);
+       lyx::dispatch(FuncRequest(LFUN_BUFFER_CLOSE));
 }
 
 
diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h
index 3eb757a..3dc7e6c 100644
--- a/src/frontends/qt4/GuiWorkArea.h
+++ b/src/frontends/qt4/GuiWorkArea.h
@@ -368,6 +368,10 @@ private:
 Q_SIGNALS:
        ///
        void tabMoveRequested(int fromIndex, int toIndex);
+
+private Q_SLOTS:
+       ///
+       void on_tabCloseRequested(int index);
 };
 
 } // namespace frontend

<<attachment: screen.jpg>>

Reply via email to