* TabWorkArea: rename 'close tab' button to 'close buffer' and add a 'close tab' button.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23088 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-21 12:29:26 +00:00
parent c607940f5b
commit f9744033b3
2 changed files with 28 additions and 6 deletions

View 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);

View File

@ -257,6 +257,8 @@ public Q_SLOTS:
///
void on_currentTabChanged(int index);
///
void closeCurrentBuffer();
///
void closeCurrentTab();
///
void updateTabText(GuiWorkArea *);