summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/FontControl.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/FontControl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/FontControl.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/noncore/apps/opie-reader/FontControl.cpp b/noncore/apps/opie-reader/FontControl.cpp
index f0ed98b..e03bf64 100644
--- a/noncore/apps/opie-reader/FontControl.cpp
+++ b/noncore/apps/opie-reader/FontControl.cpp
@@ -1,6 +1,29 @@
1#include "opie.h" 1#include "opie.h"
2#include "useqpe.h"
2#include "FontControl.h" 3#include "FontControl.h"
3 4
5int FontControl::gzoom()
6{
7 int ret;
8 if (m_size == g_size)
9 {
10 ret = m_fontsizes[m_size]*m_basesize;
11 }
12 else if (g_size < 0)
13 {
14 int f = -g_size;
15 ret = (m_fontsizes[0]*m_basesize) >> (f/2);
16 if (f%2) ret = (2*ret/3);
17 }
18 else
19 {
20 int f = g_size - m_maxsize + 1;
21 ret = (m_fontsizes[m_maxsize-1]*m_basesize) << (f/2);
22 if (f%2) ret = (3*ret/2);
23 }
24 return ret;
25}
26
4bool FontControl::ChangeFont(QString& n, int tgt) 27bool FontControl::ChangeFont(QString& n, int tgt)
5{ 28{
6 QValueList<int>::Iterator it; 29 QValueList<int>::Iterator it;
@@ -20,7 +43,7 @@ bool FontControl::ChangeFont(QString& n, int tgt)
20 uint best = 0; 43 uint best = 0;
21 for (it = sizes.begin(); it != sizes.end(); it++) 44 for (it = sizes.begin(); it != sizes.end(); it++)
22 { 45 {
23#ifdef OPIE 46#if defined(OPIE) || !defined(USEQPE)
24 m_fontsizes[i] = (*it); 47 m_fontsizes[i] = (*it);
25#else 48#else
26 m_fontsizes[i] = (*it)/10; 49 m_fontsizes[i] = (*it)/10;
@@ -31,7 +54,7 @@ bool FontControl::ChangeFont(QString& n, int tgt)
31 } 54 }
32 i++; 55 i++;
33 } 56 }
34 m_size = best; 57 g_size = m_size = best;
35 } 58 }
36 return true; 59 return true;
37} 60}