aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/scroll_control.hpp
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2018-12-06 21:32:58 +0800
committerGitHub <noreply@github.com>2018-12-06 21:32:58 +0800
commitb028e74a48de181ca078ad3bf4ababf4fa146cd3 (patch)
tree5b15e3f97c67e81ad99fb531f30681300a79b5a9 /src/ui/controls/scroll_control.hpp
parentf0e2b2d3763dd100a5e9d6cda566724d2b7da965 (diff)
parentde5d84f64ba7673a5155aab67244fedc04753b94 (diff)
downloadcru-b028e74a48de181ca078ad3bf4ababf4fa146cd3.tar.gz
cru-b028e74a48de181ca078ad3bf4ababf4fa146cd3.tar.bz2
cru-b028e74a48de181ca078ad3bf4ababf4fa146cd3.zip
Merge pull request #36 from crupest/tree
Enhance tree.
Diffstat (limited to 'src/ui/controls/scroll_control.hpp')
-rw-r--r--src/ui/controls/scroll_control.hpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ui/controls/scroll_control.hpp b/src/ui/controls/scroll_control.hpp
index db29b141..7138add6 100644
--- a/src/ui/controls/scroll_control.hpp
+++ b/src/ui/controls/scroll_control.hpp
@@ -17,7 +17,7 @@ namespace cru::ui::controls
// Done: API
// Done: ScrollBar
// Done: MouseEvent
- class ScrollControl : public Control
+ class ScrollControl : public SingleChildControl
{
private:
struct ScrollBarInfo
@@ -40,11 +40,10 @@ namespace cru::ui::controls
Always
};
- static ScrollControl* Create(const std::initializer_list<Control*>& children = std::initializer_list<Control*>{})
+ static ScrollControl* Create(Control* child = nullptr)
{
const auto control = new ScrollControl(true);
- for (auto child : children)
- control->AddChild(child);
+ control->SetChild(child);
return control;
}