author | groucho <groucho> | 2003-05-07 09:01:39 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-05-07 09:01:39 (UTC) |
commit | 118d03d815a7615b9c53363218a7ac45b3f4c514 (patch) (unidiff) | |
tree | 356953e2413cddcec0f35bd47bb6439767da7051 /noncore/apps/opie-reader/FontControl.cpp | |
parent | 00894537decf01c5a5cdc565b2740b5e67a2e90f (diff) | |
download | opie-118d03d815a7615b9c53363218a7ac45b3f4c514.zip opie-118d03d815a7615b9c53363218a7ac45b3f4c514.tar.gz opie-118d03d815a7615b9c53363218a7ac45b3f4c514.tar.bz2 |
Incorporated TimWs current source tree and make it compile
Diffstat (limited to 'noncore/apps/opie-reader/FontControl.cpp') (more/less context) (show 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,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 | ||
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 | { |
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 | } |