delete d;
}
-// Put this user variable in lyxrc or pass it through setFullScreen()
-static int const max_row_width = 700;
int BufferView::rightMargin() const
{
- if (!full_screen_ || width_ < max_row_width + 20)
- return 10;
+ // The additional test for the case the outliner is opened.
+ if (!full_screen_ ||
+ !lyxrc.full_screen_limit ||
+ width_ < lyxrc.full_screen_width + 20)
+ return 10;
- return (width_ - max_row_width) / 2;
+ return (width_ - lyxrc.full_screen_width) / 2;
}
case LFUN_LAYOUT:
case LFUN_LAYOUT_PARAGRAPH:
- flag.enabled(cur.inset().forceDefaultParagraphs(cur.idx()));
+ flag.enabled(cur.inset().allowParagraphCustomization(cur.idx()));
break;
case LFUN_INSET_SETTINGS: {
DocIterator dit = b->getParFromID(id);
if (dit.atEnd()) {
LYXERR(Debug::INFO, "No matching paragraph found! [" << id << "].");
+ ++i;
+ continue;
+ }
+ LYXERR(Debug::INFO, "Paragraph " << dit.paragraph().id()
+ << " found in buffer `"
+ << b->absFileName() << "'.");
+
+ if (b == &buffer_) {
+ // Set the cursor
+ setCursor(dit);
+ processUpdateFlags(Update::Force | Update::FitCursor);
} else {
- LYXERR(Debug::INFO, "Paragraph " << dit.paragraph().id()
- << " found in buffer `"
- << b->absFileName() << "'.");
-
- if (b == &buffer_) {
- // Set the cursor
- setCursor(dit);
- showCursor();
- } else {
- // Switch to other buffer view and resend cmd
- theLyXFunc().dispatch(FuncRequest(
- LFUN_BUFFER_SWITCH, b->absFileName()));
- theLyXFunc().dispatch(cmd);
- }
- break;
+ // Switch to other buffer view and resend cmd
+ theLyXFunc().dispatch(FuncRequest(
+ LFUN_BUFFER_SWITCH, b->absFileName()));
+ theLyXFunc().dispatch(cmd);
}
- ++i;
+ break;
}
break;
}
void BufferView::resize(int width, int height)
{
- bool initialResize = (height_ == 0);
-
// Update from work area
width_ = width;
height_ = height;
// Clear the paragraph height cache.
d->par_height_.clear();
-
+ // Redo the metrics.
updateMetrics();
-
- // view got his initial size, make sure that
- // the cursor has a proper position
- if (initialResize) {
- updateScrollbar();
- showCursor();
- }
}
} else
d->cursor_.setSelection(d->cursor_, length);
}
+ // Ensure a redraw happens in any case because the new selection could
+ // possibly be on the same screen as the previous selection.
+ processUpdateFlags(Update::Force | Update::FitCursor);
}