mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
Use Qt native close button on tabbar.
Fixes http://www.lyx.org/trac/ticket/3724 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29491 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e032cd934d
commit
3da9c20456
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
@ -368,6 +368,10 @@ private:
|
||||
Q_SIGNALS:
|
||||
///
|
||||
void tabMoveRequested(int fromIndex, int toIndex);
|
||||
|
||||
private Q_SLOTS:
|
||||
///
|
||||
void on_tabCloseRequested(int index);
|
||||
};
|
||||
|
||||
} // namespace frontend
|
||||
|
Loading…
Reference in New Issue
Block a user