X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView.cpp;h=77ab989d193962f602d96435b8c0fbc1f41e0128;hb=28be7d552f62cc02fa86d7f79201d089bfb2d7b5;hp=d017db0cae115dfcad8ff041461c2607e582a59c;hpb=8aaec85c8cc43d2317b684b0977eb47dd686af96;p=lyx.git diff --git a/src/BufferView.cpp b/src/BufferView.cpp index d017db0cae..77ab989d19 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -351,8 +351,8 @@ BufferView::~BufferView() int BufferView::rightMargin() const { - // The value used to be hardcoded to 10, which is 2.5mm at 100dpi - int const default_margin = Length(2.5, Length::MM).inPixels(0); + // The value used to be hardcoded to 10, which is 0.1in at 100dpi + int const default_margin = Length(0.1, Length::IN).inPixels(0); // The additional test for the case the outliner is opened. if (!full_screen_ || !lyxrc.full_screen_limit || width_ < lyxrc.full_screen_width + 2 * default_margin) @@ -368,6 +368,13 @@ int BufferView::leftMargin() const } +int BufferView::inPixels(Length const & len) const +{ + Font const font = buffer().params().getFont(); + return len.inPixels(workWidth(), theFontMetrics(font).em()); +} + + bool BufferView::isTopScreen() const { return 0 == d->scrollbarParameters_.min; @@ -1028,7 +1035,10 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag) if (buffer_.isReadonly() && !lyxaction.funcHasFlag(act, LyXAction::ReadOnly) && !lyxaction.funcHasFlag(act, LyXAction::NoBuffer)) { - flag.message(from_utf8(N_("Document is read-only"))); + if (buffer_.hasReadonlyFlag()) + flag.message(from_utf8(N_("Document is read-only"))); + else + flag.message(from_utf8(N_("Document has been modified externally"))); flag.setEnabled(false); return true; }