mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
Merge pull request #4113 from IvanSavenko/launcher_mod_list_tweaks
Launcher mod list tweaks
This commit is contained in:
commit
af7357a938
@ -162,7 +162,10 @@ void FirstLaunchView::activateTabHeroesData()
|
||||
ui->buttonTabModPreset->setChecked(false);
|
||||
|
||||
if(heroesDataUpdate())
|
||||
{
|
||||
activateTabModPreset();
|
||||
return;
|
||||
}
|
||||
|
||||
QString installPath = getHeroesInstallDir();
|
||||
if(!installPath.isEmpty())
|
||||
|
@ -15,6 +15,19 @@
|
||||
#include <QObject>
|
||||
#include <QScroller>
|
||||
|
||||
#ifdef VCMI_MOBILE
|
||||
static QScrollerProperties generateScrollerProperties()
|
||||
{
|
||||
QScrollerProperties result;
|
||||
|
||||
result.setScrollMetric(QScrollerProperties::OvershootDragResistanceFactor, 0.25);
|
||||
result.setScrollMetric(QScrollerProperties::OvershootDragDistanceFactor, 0.25);
|
||||
result.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff);
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace Helper
|
||||
{
|
||||
void loadSettings()
|
||||
@ -26,6 +39,8 @@ void enableScrollBySwiping(QObject * scrollTarget)
|
||||
{
|
||||
#ifdef VCMI_MOBILE
|
||||
QScroller::grabGesture(scrollTarget, QScroller::LeftMouseButtonGesture);
|
||||
QScroller * scroller = QScroller::scroller(scrollTarget);
|
||||
scroller->setScrollerProperties(generateScrollerProperties());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -82,9 +82,6 @@ QVariant CModListModel::getValue(const CModEntry & mod, int field) const
|
||||
case ModFields::NAME:
|
||||
return mod.getValue("name");
|
||||
|
||||
case ModFields::VERSION:
|
||||
return mod.getValue("version");
|
||||
|
||||
case ModFields::TYPE:
|
||||
return modTypeName(mod.getValue("modType").toString());
|
||||
|
||||
@ -173,7 +170,6 @@ QVariant CModListModel::headerData(int section, Qt::Orientation orientation, int
|
||||
QT_TRANSLATE_NOOP("ModFields", ""), // status icon
|
||||
QT_TRANSLATE_NOOP("ModFields", ""), // status icon
|
||||
QT_TRANSLATE_NOOP("ModFields", "Type"),
|
||||
QT_TRANSLATE_NOOP("ModFields", "Version"),
|
||||
};
|
||||
|
||||
if(role == Qt::DisplayRole && orientation == Qt::Horizontal)
|
||||
|
@ -22,7 +22,6 @@ enum EModFields
|
||||
STATUS_ENABLED,
|
||||
STATUS_UPDATE,
|
||||
TYPE,
|
||||
VERSION,
|
||||
COUNT
|
||||
};
|
||||
}
|
||||
|
@ -102,9 +102,8 @@ void CModListView::setupModsView()
|
||||
}
|
||||
else //default //TODO: default high-DPI scaling
|
||||
{
|
||||
ui->allModsView->setColumnWidth(ModFields::NAME, 185);
|
||||
ui->allModsView->setColumnWidth(ModFields::NAME, 220);
|
||||
ui->allModsView->setColumnWidth(ModFields::TYPE, 75);
|
||||
ui->allModsView->setColumnWidth(ModFields::VERSION, 60);
|
||||
}
|
||||
|
||||
ui->allModsView->resizeColumnToContents(ModFields::STATUS_ENABLED);
|
||||
|
@ -15,7 +15,7 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="1,0,0">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="sizePolicy">
|
||||
@ -102,7 +102,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Download && refresh repositories</string>
|
||||
<string>Reload repositories</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user