summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/FontControl.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/FontControl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/FontControl.cpp27
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 @@
#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;
@@ -20,7 +43,7 @@ bool FontControl::ChangeFont(QString& n, int tgt)
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;
@@ -31,7 +54,7 @@ bool FontControl::ChangeFont(QString& n, int tgt)
}
i++;
}
- m_size = best;
+ g_size = m_size = best;
}
return true;
}