bool clickable_inset_;
/// shape of the caret
frontend::CaretGeometry caret_geometry_;
+ ///
+ bool mouse_selecting_ = false;
};
int BufferView::rightMargin() const
{
- // The additional test for the case the outliner is opened.
- if (full_screen_ && lyxrc.full_screen_limit)
- return max(defaultMargin(), (width_ - lyxrc.full_screen_width) / 2);
+ const int screen_width = inPixels(lyxrc.screen_width);
- return defaultMargin();
+ // The additional test for the case the outliner is opened.
+ if (!lyxrc.screen_limit || width_ < screen_width + 2 * defaultMargin()) {
+ return defaultMargin();
+ } else {
+ return (width_ - screen_width) / 2;
+ }
}
void BufferView::updateDocumentClass(DocumentClassConstPtr olddc)
{
- message(_("Converting document to new document class..."));
-
StableDocIterator backcur(d->cursor_);
ErrorList & el = buffer_.errorList("Class Switch");
cap::switchBetweenClasses(
}
if (cur.selection())
pattern = cur.selectionAsString(false);
+ else if (!cur.inTexted())
+ break; // not suitable for selectWord at cursor
else {
pos_type spos = cur.pos();
cur.innerText()->selectWord(cur, WHOLE_WORD);
message += _("One word");
message += "\n";
if (chars_blanks != 1)
- message += bformat(_("%1$d characters (including blanks)"),
- chars_blanks);
+ message += bformat(_("%1$d characters"), chars_blanks);
else
- message += _("One character (including blanks)");
+ message += _("One character");
message += "\n";
if (chars != 1)
- message += bformat(_("%1$d characters (excluding blanks)"),
- chars);
+ message += bformat(_("%1$d characters (no blanks)"), chars);
else
- message += _("One character (excluding blanks)");
+ message += _("One character (no blanks)");
Alert::information(_("Statistics"), message);
}
}
+bool BufferView::mouseSelecting() const
+{
+ return d->mouse_selecting_;
+}
+
+
void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
{
//lyxerr << "[ cmd0 " << cmd0 << "]" << endl;
d->mouse_position_cache_.x_ = cmd.x();
d->mouse_position_cache_.y_ = cmd.y();
+ d->mouse_selecting_ =
+ cmd.action() == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::button1;
+
if (cmd.action() == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none) {
updateHoveredInset();
return;