From e7c285e3423ddd660447f6a6fc6bbae25f99f386 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 26 Jan 2024 16:21:43 +0100 Subject: Apply C++11 fixits modernize-loop-convert modernize-deprecated-headers --- src/resources/theme.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/resources/theme.cpp') 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) -- cgit v1.2.3-70-g09d2