From e17e162d0d61a3320b7d69e1a505eed3732c1a6d Mon Sep 17 00:00:00 2001
From: Jan Holesovsky <kendy@collabora.com>
Date: Wed, 3 Dec 2014 11:07:18 +0100
Subject: [PATCH] rulers: Make the numbers a bit smaller, and always with odd
size.
Change-Id: Id27bb0435d00f2026ff8c82ed246ca67947e9e42
---
svtools/source/control/ruler.cxx | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 29655de..c9727cb 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -992,6 +992,15 @@ void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom )
}
}
+static int adjustSize(int nOrig)
+{
+ if (nOrig <= 0)
+ return 0;
+
+ // make sure we return an odd number, that looks better in the ruler
+ return ( (3*nOrig) / 8) * 2 + 1;
+}
+
void Ruler::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -1000,6 +1009,11 @@ void Ruler::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
Font aFont;
aFont = rStyleSettings.GetToolFont();
+
+ // make the font a bit smaller than default
+ Size aSize(adjustSize(aFont.GetSize().Width()), adjustSize(aFont.GetSize().Height()));
+ aFont.SetSize(aSize);
+
if ( IsControlFont() )
aFont.Merge( GetControlFont() );
SetZoomedPointFont( aFont );
--
2.4.0