diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:21:43 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-29 14:18:06 +0100 |
commit | e7c285e3423ddd660447f6a6fc6bbae25f99f386 (patch) | |
tree | 1d700f09a5e96a2a0d390af30581097bdec0bf77 /src/resources/theme.cpp | |
parent | e1a7c1d0ca30c2c4a293ffbff6b9c51c881d23e3 (diff) | |
download | mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.gz mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.bz2 mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.xz mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.zip |
Apply C++11 fixits
modernize-loop-convert
modernize-deprecated-headers
Diffstat (limited to 'src/resources/theme.cpp')
-rw-r--r-- | src/resources/theme.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/resources/theme.cpp b/src/resources/theme.cpp index c44b7401..f4ea1902 100644 --- a/src/resources/theme.cpp +++ b/src/resources/theme.cpp @@ -71,8 +71,8 @@ Skin::Skin(ImageRect skin, Image *close, Image *stickyUp, Image *stickyDown, Skin::~Skin() { // Clean up static resources - for (int i = 0; i < 9; i++) - delete mBorder.grid[i]; + for (auto img : mBorder.grid) + delete img; mCloseImage->decRef(); delete mStickyImageUp; @@ -84,8 +84,7 @@ void Skin::updateAlpha(float minimumOpacityAllowed) const float alpha = std::max(minimumOpacityAllowed, config.getFloatValue("guialpha")); - std::for_each(mBorder.grid, mBorder.grid + 9, - [=] (Image *img) { img->setAlpha(alpha); }); + mBorder.setAlpha(alpha); mCloseImage->setAlpha(alpha); mStickyImageUp->setAlpha(alpha); @@ -196,7 +195,8 @@ Skin *Theme::load(const std::string &filename, const std::string &defaultPath) void Theme::setMinimumOpacity(float minimumOpacity) { - if (minimumOpacity > 1.0f) return; + if (minimumOpacity > 1.0f) + return; mMinimumOpacity = minimumOpacity; updateAlpha(); @@ -204,8 +204,8 @@ void Theme::setMinimumOpacity(float minimumOpacity) void Theme::updateAlpha() { - for (auto iter = mSkins.begin(); iter != mSkins.end(); ++iter) - iter->second->updateAlpha(mMinimumOpacity); + for (auto &skin : mSkins) + skin.second->updateAlpha(mMinimumOpacity); } void Theme::event(Event::Channel channel, const Event &event) |