Diffstat (limited to 'noncore/apps/opie-reader/FontControl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/FontControl.cpp | 27 |
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,5 +1,28 @@ | |||
1 | #include "opie.h" | 1 | #include "opie.h" |
2 | #include "useqpe.h" | ||
2 | #include "FontControl.h" | 3 | #include "FontControl.h" |
3 | 4 | ||
5 | int 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 | |||
4 | bool FontControl::ChangeFont(QString& n, int tgt) | 27 | bool FontControl::ChangeFont(QString& n, int tgt) |
5 | { | 28 | { |
@@ -21,5 +44,5 @@ bool FontControl::ChangeFont(QString& n, int tgt) | |||
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 |
@@ -32,5 +55,5 @@ bool FontControl::ChangeFont(QString& n, int tgt) | |||
32 | i++; | 55 | i++; |
33 | } | 56 | } |
34 | m_size = best; | 57 | g_size = m_size = best; |
35 | } | 58 | } |
36 | return true; | 59 | return true; |