author | groucho <groucho> | 2003-05-07 09:01:39 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-05-07 09:01:39 (UTC) |
commit | 118d03d815a7615b9c53363218a7ac45b3f4c514 (patch) (side-by-side diff) | |
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) (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,7 +1,30 @@ #include "opie.h" +#include "useqpe.h" #include "FontControl.h" +int FontControl::gzoom() +{ + int ret; + if (m_size == g_size) + { + ret = m_fontsizes[m_size]*m_basesize; + } + else if (g_size < 0) + { + int f = -g_size; + ret = (m_fontsizes[0]*m_basesize) >> (f/2); + if (f%2) ret = (2*ret/3); + } + else + { + int f = g_size - m_maxsize + 1; + ret = (m_fontsizes[m_maxsize-1]*m_basesize) << (f/2); + if (f%2) ret = (3*ret/2); + } + return ret; +} + bool FontControl::ChangeFont(QString& n, int tgt) { QValueList<int>::Iterator it; QFontDatabase fdb; @@ -19,9 +42,9 @@ bool FontControl::ChangeFont(QString& n, int tgt) uint i = 0; uint best = 0; for (it = sizes.begin(); it != sizes.end(); it++) { -#ifdef OPIE +#if defined(OPIE) || !defined(USEQPE) m_fontsizes[i] = (*it); #else m_fontsizes[i] = (*it)/10; #endif @@ -30,8 +53,8 @@ bool FontControl::ChangeFont(QString& n, int tgt) best = i; } i++; } - m_size = best; + g_size = m_size = best; } return true; } |