mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	[launcher] add more places for finger scrolling
This commit is contained in:
		
				
					committed by
					
						 Andrey Filipenkov
						Andrey Filipenkov
					
				
			
			
				
	
			
			
			
						parent
						
							59b40c7871
						
					
				
				
					commit
					ed6ab19818
				
			| @@ -19,6 +19,7 @@ | ||||
| #include "../../lib/Languages.h" | ||||
| #include "../../lib/VCMIDirs.h" | ||||
| #include "../../lib/filesystem/Filesystem.h" | ||||
| #include "../helper.h" | ||||
| #include "../languages.h" | ||||
|  | ||||
| #ifdef ENABLE_INNOEXTRACT | ||||
| @@ -37,6 +38,8 @@ FirstLaunchView::FirstLaunchView(QWidget * parent) | ||||
| 	ui->lineEditDataSystem->setText(pathToQString(boost::filesystem::absolute(VCMIDirs::get().dataPaths().front()))); | ||||
| 	ui->lineEditDataUser->setText(pathToQString(boost::filesystem::absolute(VCMIDirs::get().userDataPath()))); | ||||
|  | ||||
| 	Helper::enableScrollBySwiping(ui->listWidgetLanguage); | ||||
|  | ||||
| #ifndef ENABLE_INNOEXTRACT | ||||
| 	ui->pushButtonGogInstall->hide(); | ||||
| #endif | ||||
|   | ||||
| @@ -12,7 +12,20 @@ | ||||
|  | ||||
| #include "../lib/CConfigHandler.h" | ||||
|  | ||||
| void Helper::loadSettings() | ||||
| #include <QObject> | ||||
| #include <QScroller> | ||||
|  | ||||
| namespace Helper | ||||
| { | ||||
| void loadSettings() | ||||
| { | ||||
| 	settings.init("config/settings.json", "vcmi:settings"); | ||||
| } | ||||
|  | ||||
| void enableScrollBySwiping(QObject * scrollTarget) | ||||
| { | ||||
| #ifdef VCMI_MOBILE | ||||
| 	QScroller::grabGesture(scrollTarget, QScroller::LeftMouseButtonGesture); | ||||
| #endif | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -9,7 +9,10 @@ | ||||
|  */ | ||||
| #pragma once | ||||
|  | ||||
| class QObject; | ||||
|  | ||||
| namespace Helper | ||||
| { | ||||
| void loadSettings(); | ||||
| void enableScrollBySwiping(QObject * scrollTarget); | ||||
| } | ||||
|   | ||||
| @@ -151,13 +151,14 @@ CModListView::CModListView(QWidget * parent) | ||||
| 	{ | ||||
| 		manager->resetRepositories(); | ||||
| 	} | ||||
| 	 | ||||
| #ifdef Q_OS_IOS | ||||
|  | ||||
| #ifdef VCMI_MOBILE | ||||
| 	for(auto * scrollWidget : { | ||||
| 		(QAbstractItemView*)ui->allModsView, | ||||
| 		(QAbstractItemView*)ui->screenshotsList}) | ||||
| 	{ | ||||
| 		QScroller::grabGesture(scrollWidget, QScroller::LeftMouseButtonGesture); | ||||
| 		Helper::enableScrollBySwiping(scrollWidget); | ||||
|  | ||||
| 		scrollWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); | ||||
| 		scrollWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | ||||
| 	} | ||||
| @@ -405,6 +406,9 @@ void CModListView::selectMod(const QModelIndex & index) | ||||
| 		ui->modInfoBrowser->setHtml(genModInfoText(mod)); | ||||
| 		ui->changelogBrowser->setHtml(genChangelogText(mod)); | ||||
|  | ||||
| 		Helper::enableScrollBySwiping(ui->modInfoBrowser); | ||||
| 		Helper::enableScrollBySwiping(ui->changelogBrowser); | ||||
|  | ||||
| 		bool hasInvalidDeps = !findInvalidDependencies(modName).empty(); | ||||
| 		bool hasBlockingMods = !findBlockingMods(modName).empty(); | ||||
| 		bool hasDependentMods = !findDependentMods(modName, true).empty(); | ||||
|   | ||||
| @@ -14,6 +14,7 @@ | ||||
| #include "mainwindow_moc.h" | ||||
|  | ||||
| #include "../modManager/cmodlistview_moc.h" | ||||
| #include "../helper.h" | ||||
| #include "../jsonutils.h" | ||||
| #include "../languages.h" | ||||
| #include "../launcherdirs.h" | ||||
| @@ -284,6 +285,7 @@ CSettingsView::CSettingsView(QWidget * parent) | ||||
| 	: QWidget(parent), ui(new Ui::CSettingsView) | ||||
| { | ||||
| 	ui->setupUi(this); | ||||
| 	Helper::enableScrollBySwiping(ui->settingsScrollArea); | ||||
|  | ||||
| 	loadSettings(); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user