mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 22:17:41 +00:00
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:
parent
2ee880ff21
commit
9c43747cc9
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user