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.
This commit is contained in:
Jean-Marc Lasgouttes 2015-12-03 10:07:52 +01:00
parent 2ee880ff21
commit 9c43747cc9

View File

@ -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;
}