mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
* 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:
parent
c607940f5b
commit
f9744033b3
@ -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);
|
||||
|
@ -257,6 +257,8 @@ public Q_SLOTS:
|
||||
///
|
||||
void on_currentTabChanged(int index);
|
||||
///
|
||||
void closeCurrentBuffer();
|
||||
///
|
||||
void closeCurrentTab();
|
||||
///
|
||||
void updateTabText(GuiWorkArea *);
|
||||
|
Loading…
Reference in New Issue
Block a user