From: Jean-Marc Lasgouttes Date: Thu, 3 Dec 2015 09:07:52 +0000 (+0100) Subject: Make text margin size dependent on zoom and dpi X-Git-Tag: 2.2.0beta1~402 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9c43747cc9d50a4ccb8d3ada651596b71a2862c9;p=features.git Make text margin size dependent on zoom and dpi The default hardcoded value of 10 corresponds to 2.5mm at 100dpi, but does not make much sense on a HiDpi screen. --- diff --git a/src/BufferView.cpp b/src/BufferView.cpp index e237a635eb..15dcb92682 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -351,11 +351,12 @@ 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 additional test for the case the outliner is opened. - if (!full_screen_ || - !lyxrc.full_screen_limit || - width_ < lyxrc.full_screen_width + 20) - return 10; + if (!full_screen_ || !lyxrc.full_screen_limit + || width_ < lyxrc.full_screen_width + 2 * default_margin) + return default_margin; return (width_ - lyxrc.full_screen_width) / 2; }