forked from qt-creator/qt-creator
Added (optional) touch optimized navigation of HTML5 apps
Code provided by the Bostoner Browser team. The HTML5 wizard shows a checkbox "Enable touch optimized navigation" which enables flicking and enlarged click areas. By default, the option is turned off. Task-Number: QTCREATORBUG-3284
This commit is contained in:
@@ -55,6 +55,7 @@ const QString appViewerOriginsSubDir(appViewerBaseName + QLatin1Char('/'));
|
||||
Html5App::Html5App()
|
||||
: AbstractMobileApp()
|
||||
, m_mainHtmlMode(ModeGenerate)
|
||||
, m_touchOptimizedNavigationEnabled(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -74,6 +75,16 @@ Html5App::Mode Html5App::mainHtmlMode() const
|
||||
return m_mainHtmlMode;
|
||||
}
|
||||
|
||||
void Html5App::setTouchOptimizedNavigationEnabled(bool enabled)
|
||||
{
|
||||
m_touchOptimizedNavigationEnabled = enabled;
|
||||
}
|
||||
|
||||
bool Html5App::touchOptimizedNavigationEnabled() const
|
||||
{
|
||||
return m_touchOptimizedNavigationEnabled;
|
||||
}
|
||||
|
||||
QString Html5App::pathExtended(int fileType) const
|
||||
{
|
||||
const QString appViewerTargetSubDir = appViewerOriginsSubDir;
|
||||
@@ -139,9 +150,10 @@ void Html5App::handleCurrentProFileTemplateLine(const QString &line,
|
||||
bool &commentOutNextLine) const
|
||||
{
|
||||
Q_UNUSED(proFile)
|
||||
Q_UNUSED(commentOutNextLine)
|
||||
if (line.contains(QLatin1String("# INCLUDE_DEPLOYMENT_PRI"))) {
|
||||
proFileTemplate.readLine(); // eats 'include(deployment.pri)'
|
||||
} else if (line.contains(QLatin1String("# TOUCH_OPTIMIZED_NAVIGATION"))) {
|
||||
commentOutNextLine = !m_touchOptimizedNavigationEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user