]> git.lyx.org Git - features.git/commitdiff
* TabWorkArea: rename 'close tab' button to 'close buffer' and add a 'close tab'...
authorAbdelrazak Younes <younes@lyx.org>
Thu, 21 Feb 2008 12:29:26 +0000 (12:29 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 21 Feb 2008 12:29:26 +0000 (12:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23088 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWorkArea.cpp
src/frontends/qt4/GuiWorkArea.h

index 17edb2f5cf890546ccde0f1305d7629fdba6139f..4a51b6922bc33e82a001a8f6f46f3e9c82bf5f74 100644 (file)
@@ -1036,21 +1036,35 @@ TabWorkArea::TabWorkArea(QWidget * parent) : QTabWidget(parent)
        pal.setColor(QPalette::Inactive, QPalette::Button,
                pal.color(QPalette::Inactive, QPalette::Window));
 
+       QObject::connect(this, SIGNAL(currentChanged(int)),
+               this, SLOT(on_currentTabChanged(int)));
+
+       QToolButton * closeBufferButton = new QToolButton(this);
+    closeBufferButton->setPalette(pal);
+       // FIXME: rename the icon to closebuffer.png
+       closeBufferButton->setIcon(QIcon(":/images/closetab.png"));
+       closeBufferButton->setText("Close Buffer");
+       closeBufferButton->setAutoRaise(true);
+       closeBufferButton->setCursor(Qt::ArrowCursor);
+       closeBufferButton->setToolTip(tr("Close Buffer"));
+       closeBufferButton->setEnabled(true);
+       QObject::connect(closeBufferButton, SIGNAL(clicked()),
+               this, SLOT(closeCurrentBuffer()));
+       setCornerWidget(closeBufferButton, Qt::TopRightCorner);
+
        QToolButton * closeTabButton = new QToolButton(this);
     closeTabButton->setPalette(pal);
+       // FIXME: we need another icon for this.
        closeTabButton->setIcon(QIcon(":/images/closetab.png"));
-       closeTabButton->setText("Close");
+       closeTabButton->setText("Minimize Buffer");
        closeTabButton->setAutoRaise(true);
        closeTabButton->setCursor(Qt::ArrowCursor);
        closeTabButton->setToolTip(tr("Close tab"));
        closeTabButton->setEnabled(true);
-
-       QObject::connect(this, SIGNAL(currentChanged(int)),
-               this, SLOT(on_currentTabChanged(int)));
        QObject::connect(closeTabButton, SIGNAL(clicked()),
                this, SLOT(closeCurrentTab()));
+       setCornerWidget(closeTabButton, Qt::TopLeftCorner);
 
-       setCornerWidget(closeTabButton);
        setUsesScrollButtons(true);
 }
 
@@ -1182,12 +1196,18 @@ void TabWorkArea::on_currentTabChanged(int i)
 }
 
 
-void TabWorkArea::closeCurrentTab()
+void TabWorkArea::closeCurrentBuffer()
 {
        lyx::dispatch(FuncRequest(LFUN_BUFFER_CLOSE));
 }
 
 
+void TabWorkArea::closeCurrentTab()
+{
+       removeWorkArea(currentWorkArea());
+}
+
+
 void TabWorkArea::updateTabText(GuiWorkArea * wa)
 {
        int const i = indexOf(wa);
index 0da12f8e3c4184d3c25f3c32e73bde3010eb98b0..b528bb478efee30d2349a87bfdb7a862f8171682 100644 (file)
@@ -257,6 +257,8 @@ public Q_SLOTS:
        ///
        void on_currentTabChanged(int index);
        ///
+       void closeCurrentBuffer();
+       ///
        void closeCurrentTab();
        ///
        void updateTabText(GuiWorkArea *);