// cursor is at the top or bottom edge of the viewport. One scroll per 0.2 s
SyntheticMouseEvent::SyntheticMouseEvent()
: timeout(200), restart_timeout(true),
- x_old(-1), y_old(-1), min_scrollbar_old(-1.0), max_scrollbar_old(-1.0)
+ x_old(-1), y_old(-1), min_scrollbar_old(-1), max_scrollbar_old(-1)
{}
void TabWorkArea::closeCurrentBuffer()
{
- if (clicked_tab_ != -1)
- setCurrentIndex(clicked_tab_);
- else
- // Before dispatching the LFUN we should be sure this
- // is the current workarea.
- currentWorkAreaChanged(currentWorkArea());
-
- lyx::dispatch(FuncRequest(LFUN_BUFFER_CLOSE));
+ GuiWorkArea * wa;
+ if (clicked_tab_ == -1)
+ wa = currentWorkArea();
+ else {
+ wa = dynamic_cast<GuiWorkArea *>(widget(clicked_tab_));
+ LASSERT(wa, /**/);
+ }
+ wa->view().closeWorkArea(wa);
}
void TabWorkArea::closeCurrentTab()
{
+ GuiWorkArea * wa;
if (clicked_tab_ == -1)
- removeWorkArea(currentWorkArea());
+ wa = currentWorkArea();
else {
- GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(widget(clicked_tab_));
+ wa = dynamic_cast<GuiWorkArea *>(widget(clicked_tab_));
LASSERT(wa, /**/);
- removeWorkArea(wa);
}
+ wa->view().hideWorkArea(wa);
}
///
DisplayPath(int tab, FileName const & filename)
: tab_(tab)
{
- filename_ = toqstr(filename.onlyFileNameWithoutExt());
+ filename_ = (filename.extension() == "lyx") ?
+ toqstr(filename.onlyFileNameWithoutExt())
+ : toqstr(filename.onlyFileName());
postfix_ = toqstr(filename.absoluteFilePath()).
split("/", QString::SkipEmptyParts);
postfix_.pop_back();