mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Support save / load for the Animation Speed on the Preferences
User can now fine-tune the animation speed on the preferences, a value of zero disables it completely. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9f37bac07a
commit
751c76a578
3 changed files with 128 additions and 51 deletions
|
@ -105,6 +105,11 @@ void PreferencesDialog::setUiFromPrefs()
|
|||
QModelIndexList languages = m->match(m->index(0, 0), Qt::UserRole, s.value("UiLanguage").toString());
|
||||
if (languages.count())
|
||||
ui.languageView->setCurrentIndex(languages.first());
|
||||
|
||||
s.endGroup();
|
||||
s.beginGroup("Animations");
|
||||
int animVelocity = s.value("animation_speed",500).toInt();
|
||||
ui.velocitySlider->setValue(animVelocity);
|
||||
}
|
||||
|
||||
void PreferencesDialog::restorePrefs()
|
||||
|
@ -218,6 +223,8 @@ void PreferencesDialog::syncSettings()
|
|||
s.setValue("UiLanguage", ui.languageView->currentIndex().data(Qt::UserRole));
|
||||
s.endGroup();
|
||||
|
||||
s.beginGroup("Animations");
|
||||
s.setValue("animation_speed",ui.velocitySlider->value());
|
||||
loadSettings();
|
||||
emit settingsChanged();
|
||||
}
|
||||
|
@ -289,6 +296,10 @@ void PreferencesDialog::loadSettings()
|
|||
prefs.font_size = defaultFont.pointSizeF();
|
||||
GET_INT("displayinvalid", display_invalid_dives);
|
||||
s.endGroup();
|
||||
|
||||
s.beginGroup("Animations");
|
||||
int animVelocity = s.value("animation_speed",500).toInt();
|
||||
ui.velocitySlider->setValue(animVelocity);
|
||||
}
|
||||
|
||||
void PreferencesDialog::buttonClicked(QAbstractButton *button)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue