mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 18:24:48 +00:00
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25323 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f29a8f54a4
commit
ad68145492
@ -220,6 +220,17 @@ void TocWidget::enableControls(bool enable)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Test if synchronized navigation is possible
|
||||||
|
static bool canNavigate(QString const & type)
|
||||||
|
{
|
||||||
|
// It is not possible to have synchronous navigation in a correctl
|
||||||
|
// and efficient way with the label type because Toc::item() do a linear
|
||||||
|
// seatch. Even if fixed, it might even not be desirable to do so if we
|
||||||
|
// want to support drag&drop of labels and references.
|
||||||
|
return type != "label";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TocWidget::updateView()
|
void TocWidget::updateView()
|
||||||
{
|
{
|
||||||
if (!gui_view_.view()) {
|
if (!gui_view_.view()) {
|
||||||
@ -244,6 +255,7 @@ void TocWidget::updateView()
|
|||||||
depthSL->setMaximum(gui_view_.tocModels().depth(current_type_));
|
depthSL->setMaximum(gui_view_.tocModels().depth(current_type_));
|
||||||
depthSL->setValue(depth_);
|
depthSL->setValue(depth_);
|
||||||
setTreeDepth(depth_);
|
setTreeDepth(depth_);
|
||||||
|
if (canNavigate(current_type_))
|
||||||
select(gui_view_.tocModels().currentIndex(current_type_));
|
select(gui_view_.tocModels().currentIndex(current_type_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user