diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-01 01:08:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-01 01:08:30 +0300 |
commit | 16f6f636aee6acaf52439643502f5ff9cb4ccffc (patch) | |
tree | 9f291e5257e20b0090405d4594553f38a69767ce /src/gui/widgets | |
parent | 3fc7fd8473e545265c705504ee0d5f2a70268282 (diff) | |
download | manaverse-16f6f636aee6acaf52439643502f5ff9cb4ccffc.tar.gz manaverse-16f6f636aee6acaf52439643502f5ff9cb4ccffc.tar.bz2 manaverse-16f6f636aee6acaf52439643502f5ff9cb4ccffc.tar.xz manaverse-16f6f636aee6acaf52439643502f5ff9cb4ccffc.zip |
Convert UserColorId enum into strong typed enum.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/tabs/setup_colors.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp index 1ba6461ea..f7a2dcfd6 100644 --- a/src/gui/widgets/tabs/setup_colors.cpp +++ b/src/gui/widgets/tabs/setup_colors.cpp @@ -250,7 +250,8 @@ void Setup_Colors::valueChanged(const SelectionEvent &event A_UNUSED) return; mSelected = mColorBox->getSelected(); - const int type = userPalette->getColorTypeAt(mSelected); + const UserColorIdT type = static_cast<UserColorIdT>( + userPalette->getColorTypeAt(mSelected)); const Color *col = &userPalette->getColor(type); const GradientTypeT grad = userPalette->getGradientType(type); const int delay = userPalette->getGradientDelay(type); @@ -380,7 +381,8 @@ void Setup_Colors::cancel() return; userPalette->rollback(); - const int type = userPalette->getColorTypeAt(mSelected); + const UserColorIdT type = static_cast<UserColorIdT>( + userPalette->getColorTypeAt(mSelected)); const Color *const col = &userPalette->getColor(type); mGradTypeSlider->setValue(static_cast<int>( userPalette->getGradientType(type))); @@ -397,7 +399,8 @@ void Setup_Colors::updateGradType() return; mSelected = mColorBox->getSelected(); - const int type = userPalette->getColorTypeAt(mSelected); + const UserColorIdT type = static_cast<UserColorIdT>( + userPalette->getColorTypeAt(mSelected)); const GradientTypeT grad = userPalette->getGradientType(type); mGradTypeText->setCaption( @@ -427,7 +430,8 @@ void Setup_Colors::updateColor() if (mSelected == -1 || !userPalette) return; - const int type = userPalette->getColorTypeAt(mSelected); + const UserColorIdT type = static_cast<UserColorIdT>( + userPalette->getColorTypeAt(mSelected)); const GradientTypeT grad = static_cast<GradientTypeT>( static_cast<int>(mGradTypeSlider->getValue())); const int delay = static_cast<int>(mGradDelaySlider->getValue()); |