summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-12-03 11:07:18 +0100
committerJan Holesovsky <kendy@collabora.com>2014-12-03 11:52:29 +0100
commit9f3ce795c2ecf5f8ca41b9b4bd24f001fcad59aa (patch)
treebb9e1e5c7da8acf04819f291415d65205df5266e
parentdacbe43846a729ef9f46138321c1facb5151c17d (diff)
rulers: Make the numbers a bit smaller, and always with odd size.
Change-Id: Id27bb0435d00f2026ff8c82ed246ca67947e9e42
-rw-r--r--svtools/source/control/ruler.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index b49421c3dc05..1656813640d4 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -991,6 +991,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();
@@ -999,6 +1008,11 @@ void Ruler::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
vcl::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 );