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,4 +1,27 @@ #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) @@ -22,3 +45,3 @@ bool FontControl::ChangeFont(QString& n, int tgt) { -#ifdef OPIE +#if defined(OPIE) || !defined(USEQPE) m_fontsizes[i] = (*it); @@ -33,3 +56,3 @@ bool FontControl::ChangeFont(QString& n, int tgt) } - m_size = best; + g_size = m_size = best; } |