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,5 +1,28 @@ #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) { @@ -21,5 +44,5 @@ bool FontControl::ChangeFont(QString& n, int tgt) for (it = sizes.begin(); it != sizes.end(); it++) { -#ifdef OPIE +#if defined(OPIE) || !defined(USEQPE) m_fontsizes[i] = (*it); #else @@ -32,5 +55,5 @@ bool FontControl::ChangeFont(QString& n, int tgt) i++; } - m_size = best; + g_size = m_size = best; } return true; |