Blame SOURCES/0001-rulers-Make-the-numbers-a-bit-smaller-and-always-wit.patch

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