Skip to content

Commit

Permalink
重构一小部分代码
Browse files Browse the repository at this point in the history
  • Loading branch information
cathaysia committed May 23, 2021
1 parent 90e5666 commit 909199b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0)

project(digikamflowplugin
VERSION 0.0.1
VERSION 0.0.2
DESCRIPTION "a plugin add a Flow View to digikam"
HOMEPAGE_URL https://github.com/cathaysia/digikamflowplugin)

Expand Down
8 changes: 2 additions & 6 deletions src/FlowLayout/flowlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,8 @@ void FlowLayout::doMonoLayout() {
}
}
// 设置父组件的尺寸
int maxHeight = 0;
std::for_each(yFlags->begin(), yFlags->end(), [&maxHeight](int val) {
if(val > maxHeight) maxHeight = val;
});
this->parentWidget()->resize(this->geometry().width(), maxHeight);
inner_height_ = maxHeight;
inner_height_ = *(std::max_element(yFlags->begin(), yFlags->end()));
this->parentWidget()->resize(this->geometry().width(), inner_height_);
}

} // namespace Z

0 comments on commit 909199b

Please sign in to comment.