mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-14 01:22:33 +00:00
Backport
http://www.lyx.org/trac/changeset/29491 http://www.lyx.org/trac/changeset/29492 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@29494 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b718b70e32
commit
d308eb6906
@ -1210,6 +1210,7 @@ TabWorkArea::TabWorkArea(QWidget * parent)
|
|||||||
QObject::connect(this, SIGNAL(currentChanged(int)),
|
QObject::connect(this, SIGNAL(currentChanged(int)),
|
||||||
this, SLOT(on_currentTabChanged(int)));
|
this, SLOT(on_currentTabChanged(int)));
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x040500
|
||||||
closeBufferButton = new QToolButton(this);
|
closeBufferButton = new QToolButton(this);
|
||||||
closeBufferButton->setPalette(pal);
|
closeBufferButton->setPalette(pal);
|
||||||
// FIXME: rename the icon to closebuffer.png
|
// FIXME: rename the icon to closebuffer.png
|
||||||
@ -1222,6 +1223,7 @@ TabWorkArea::TabWorkArea(QWidget * parent)
|
|||||||
QObject::connect(closeBufferButton, SIGNAL(clicked()),
|
QObject::connect(closeBufferButton, SIGNAL(clicked()),
|
||||||
this, SLOT(closeCurrentBuffer()));
|
this, SLOT(closeCurrentBuffer()));
|
||||||
setCornerWidget(closeBufferButton, Qt::TopRightCorner);
|
setCornerWidget(closeBufferButton, Qt::TopRightCorner);
|
||||||
|
#endif
|
||||||
|
|
||||||
// setup drag'n'drop
|
// setup drag'n'drop
|
||||||
QTabBar* tb = new DragTabBar;
|
QTabBar* tb = new DragTabBar;
|
||||||
@ -1234,6 +1236,10 @@ TabWorkArea::TabWorkArea(QWidget * parent)
|
|||||||
tb->setContextMenuPolicy(Qt::CustomContextMenu);
|
tb->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(tb, SIGNAL(customContextMenuRequested(const QPoint &)),
|
connect(tb, SIGNAL(customContextMenuRequested(const QPoint &)),
|
||||||
this, SLOT(showContextMenu(const QPoint &)));
|
this, SLOT(showContextMenu(const QPoint &)));
|
||||||
|
#if QT_VERSION >= 0x040500
|
||||||
|
connect(tb, SIGNAL(tabCloseRequested(int)),
|
||||||
|
tb, SLOT(on_tabCloseRequested(int)));
|
||||||
|
#endif
|
||||||
|
|
||||||
setUsesScrollButtons(true);
|
setUsesScrollButtons(true);
|
||||||
}
|
}
|
||||||
@ -1255,7 +1261,9 @@ void TabWorkArea::showBar(bool show)
|
|||||||
{
|
{
|
||||||
tabBar()->setEnabled(show);
|
tabBar()->setEnabled(show);
|
||||||
tabBar()->setVisible(show);
|
tabBar()->setVisible(show);
|
||||||
|
#if QT_VERSION < 0x040500
|
||||||
closeBufferButton->setVisible(show);
|
closeBufferButton->setVisible(show);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1642,6 +1650,16 @@ DragTabBar::DragTabBar(QWidget* parent)
|
|||||||
: QTabBar(parent)
|
: QTabBar(parent)
|
||||||
{
|
{
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
#if QT_VERSION >= 0x040500
|
||||||
|
setTabsClosable(true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DragTabBar::on_tabCloseRequested(int index)
|
||||||
|
{
|
||||||
|
setCurrentIndex(index);
|
||||||
|
lyx::dispatch(FuncRequest(LFUN_BUFFER_CLOSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -285,8 +285,10 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
int clicked_tab_;
|
int clicked_tab_;
|
||||||
|
#if QT_VERSION < 0x040500
|
||||||
///
|
///
|
||||||
QToolButton * closeBufferButton;
|
QToolButton * closeBufferButton;
|
||||||
|
#endif
|
||||||
}; // TabWorkArea
|
}; // TabWorkArea
|
||||||
|
|
||||||
|
|
||||||
@ -321,6 +323,10 @@ private:
|
|||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
///
|
///
|
||||||
void tabMoveRequested(int fromIndex, int toIndex);
|
void tabMoveRequested(int fromIndex, int toIndex);
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
///
|
||||||
|
void on_tabCloseRequested(int index);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace frontend
|
} // namespace frontend
|
||||||
|
@ -112,6 +112,8 @@ What's new
|
|||||||
|
|
||||||
- Support the optional argument of \chapter* in the memoir class.
|
- Support the optional argument of \chapter* in the memoir class.
|
||||||
|
|
||||||
|
- Move the buffer-close button into each tabbar for Qt 4.5 (bug 3724).
|
||||||
|
|
||||||
|
|
||||||
* WINDOWS INSTALLER
|
* WINDOWS INSTALLER
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user