diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-01 14:07:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-01 14:07:38 +0300 |
commit | 7afb9df4a8fdecc0d6b93a7dbd7044e0f6a358f3 (patch) | |
tree | 2aa557aac271eb15b1f70bbfb7842e593e90b791 /src | |
parent | 1b2001d45ea6ee99490d4b1c374b1a03d73bbc86 (diff) | |
download | plus-7afb9df4a8fdecc0d6b93a7dbd7044e0f6a358f3.tar.gz plus-7afb9df4a8fdecc0d6b93a7dbd7044e0f6a358f3.tar.bz2 plus-7afb9df4a8fdecc0d6b93a7dbd7044e0f6a358f3.tar.xz plus-7afb9df4a8fdecc0d6b93a7dbd7044e0f6a358f3.zip |
Add strong typed bool enum donotalign.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/enums/simpletypes/donotalign.h | 28 | ||||
-rw-r--r-- | src/gui/widgets/setupitem.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/setupitem.h | 7 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_audio.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_visual.cpp | 2 |
7 files changed, 39 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7a42d758b..75ff6fe9b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1103,6 +1103,7 @@ SET(SRCS enums/simpletypes/beingtypeid.h enums/simpletypes/booldefines.h enums/simpletypes/damaged.h + enums/simpletypes/donotalign.h enums/simpletypes/enable.h enums/simpletypes/enumdefines.h enums/simpletypes/equipm.h diff --git a/src/Makefile.am b/src/Makefile.am index a436642f5..7b1e9cffb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -566,6 +566,7 @@ SRC += events/actionevent.h \ enums/simpletypes/beingtypeid.h \ enums/simpletypes/booldefines.h \ enums/simpletypes/damaged.h \ + enums/simpletypes/donotalign.h \ enums/simpletypes/enable.h \ enums/simpletypes/enumdefines.h \ enums/simpletypes/equipm.h \ diff --git a/src/enums/simpletypes/donotalign.h b/src/enums/simpletypes/donotalign.h new file mode 100644 index 000000000..95948a571 --- /dev/null +++ b/src/enums/simpletypes/donotalign.h @@ -0,0 +1,28 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ENUMS_SIMPLETYPES_DONOTALIGN_H +#define ENUMS_SIMPLETYPES_DONOTALIGN_H + +#include "enums/simpletypes/booldefines.h" + +defBoolEnum(DoNotAlign); + +#endif // ENUMS_SIMPLETYPES_DONOTALIGN_H diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index be26265c3..2f5b2090c 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -848,7 +848,7 @@ SetupItemSlider2::SetupItemSlider2(const std::string &restrict text, SetupItemNames *restrict const values, const OnTheFly onTheFly, const MainConfig mainConfig, - const bool doNotAlign) : + const DoNotAlign doNotAlign) : SetupItem(text, description, keyName, parent, eventName, mainConfig), mHorizont(nullptr), mLabel(nullptr), @@ -879,7 +879,7 @@ SetupItemSlider2::SetupItemSlider2(const std::string &restrict text, const std::string &restrict def, const OnTheFly onTheFly, const MainConfig mainConfig, - const bool doNotAlign) : + const DoNotAlign doNotAlign) : SetupItem(text, description, keyName, parent, eventName, def, mainConfig), mHorizont(nullptr), mLabel(nullptr), @@ -926,7 +926,7 @@ void SetupItemSlider2::createControls() mWidget = mSlider; mSlider->setWidth(150); mSlider->setHeight(40); - if (!mDoNotAlign) + if (mDoNotAlign == DoNotAlign_false) fixFirstItemSize(mLabel); mHorizont->add(mLabel); mHorizont->add(mSlider, -10); diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index 2bfa9e04c..cc7a04044 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -21,6 +21,7 @@ #ifndef GUI_WIDGETS_SETUPITEM_H #define GUI_WIDGETS_SETUPITEM_H +#include "enums/simpletypes/donotalign.h" #include "enums/simpletypes/mainconfig.h" #include "enums/simpletypes/onthefly.h" #include "enums/simpletypes/usebase64.h" @@ -418,7 +419,7 @@ class SetupItemSlider2 final : public SetupItem SetupItemNames *restrict const values, const OnTheFly onTheFly, const MainConfig mainConfig, - const bool doNotAlign); + const DoNotAlign doNotAlign); SetupItemSlider2(const std::string &restrict text, const std::string &restrict description, @@ -430,7 +431,7 @@ class SetupItemSlider2 final : public SetupItem const std::string &restrict def, const OnTheFly onTheFly, const MainConfig mainConfig, - const bool doNotAlign); + const DoNotAlign doNotAlign); A_DELETE_COPY(SetupItemSlider2) @@ -464,7 +465,7 @@ class SetupItemSlider2 final : public SetupItem int mInvertValue; bool mInvert; OnTheFly mOnTheFly; - bool mDoNotAlign; + DoNotAlign mDoNotAlign; }; class SetupItemSliderList notfinal : public SetupItem diff --git a/src/gui/widgets/tabs/setup_audio.cpp b/src/gui/widgets/tabs/setup_audio.cpp index 0aa824813..d47816fa0 100644 --- a/src/gui/widgets/tabs/setup_audio.cpp +++ b/src/gui/widgets/tabs/setup_audio.cpp @@ -105,7 +105,7 @@ Setup_Audio::Setup_Audio(const Widget2 *const widget) : "audioChannels", 1, 4, 1, mChannelsList, OnTheFly_false, MainConfig_true, - false); + DoNotAlign_false); // TRANSLATORS: settings group diff --git a/src/gui/widgets/tabs/setup_visual.cpp b/src/gui/widgets/tabs/setup_visual.cpp index f33a9a5d3..161ea4870 100644 --- a/src/gui/widgets/tabs/setup_visual.cpp +++ b/src/gui/widgets/tabs/setup_visual.cpp @@ -175,7 +175,7 @@ Setup_Visual::Setup_Visual(const Widget2 *const widget) : this, "particleEmitterSkipEvent", 0, 3, 1, mParticleList, OnTheFly_true, MainConfig_true, - false))->setInvertValue(3); + DoNotAlign_false))->setInvertValue(3); mParticleTypeList->fillFromArray(&particleTypeList[0], particleTypeListSize); |