1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Small redesign of Settings tab in Launcher

This commit is contained in:
Ivan Savenko 2023-01-26 00:30:51 +02:00
parent 07dc2e1c48
commit 8cdc9985d2
3 changed files with 646 additions and 630 deletions

View File

@ -202,7 +202,7 @@ CSettingsView::CSettingsView(QWidget * parent)
{
ui->setupUi(this);
ui->labelBuildVersion->setText(QString::fromStdString(GameConstants::VCMI_VERSION));
ui->lineEditBuildVersion->setText(QString::fromStdString(GameConstants::VCMI_VERSION));
loadSettings();
}
@ -359,3 +359,24 @@ void CSettingsView::on_comboBoxCursorType_currentIndexChanged(int index)
node->String() = cursorTypesList[index];
}
void CSettingsView::on_listWidgetSettings_currentRowChanged(int currentRow)
{
QVector<QWidget*> targetWidgets = {
ui->labelGeneral,
ui->labelVideo,
ui->labelArtificialIntelligence,
ui->labelDataDirs,
ui->labelRepositories
};
QWidget * currentTarget = targetWidgets[currentRow];
// We want to scroll in a way that will put target widget in topmost visible position
// To show not just header, but all settings in this group as well
// In order to do that, let's scroll to the very bottom and the scroll back up until target widget is visible
int maxPosition = ui->settingsScrollArea->verticalScrollBar()->maximum();
ui->settingsScrollArea->verticalScrollBar()->setValue(maxPosition);
ui->settingsScrollArea->ensureWidgetVisible(currentTarget, 5, 5);
}

View File

@ -73,6 +73,8 @@ private slots:
void on_comboBoxCursorType_currentIndexChanged(int index);
void on_listWidgetSettings_currentRowChanged(int currentRow);
private:
Ui::CSettingsView * ui;

File diff suppressed because it is too large Load Diff