Skip to content
Snippets Groups Projects
Unverified Commit 0137d2a9 authored by Kefu Chai's avatar Kefu Chai Committed by GitHub
Browse files

component/collapsible: drop unused member variable (#360)


Signed-off-by: default avatarKefu Chai <tchaikov@gmail.com>
parent c76612a3
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ Component Collapsible(ConstStringRef label, Component child, Ref<bool> show) { ...@@ -29,7 +29,7 @@ Component Collapsible(ConstStringRef label, Component child, Ref<bool> show) {
class Impl : public ComponentBase { class Impl : public ComponentBase {
public: public:
Impl(ConstStringRef label, Component child, Ref<bool> show) Impl(ConstStringRef label, Component child, Ref<bool> show)
: label_(label), show_(std::move(show)) { : show_(std::move(show)) {
CheckboxOption opt; CheckboxOption opt;
opt.transform = [](EntryState s) { opt.transform = [](EntryState s) {
auto prefix = text(s.state ? "▼ " : "▶ "); auto prefix = text(s.state ? "▼ " : "▶ ");
...@@ -41,11 +41,10 @@ Component Collapsible(ConstStringRef label, Component child, Ref<bool> show) { ...@@ -41,11 +41,10 @@ Component Collapsible(ConstStringRef label, Component child, Ref<bool> show) {
return hbox({prefix, t}); return hbox({prefix, t});
}; };
Add(Container::Vertical({ Add(Container::Vertical({
Checkbox(label_, show_.operator->(), opt), Checkbox(label, show_.operator->(), opt),
Maybe(std::move(child), show_.operator->()), Maybe(std::move(child), show_.operator->()),
})); }));
} }
ConstStringRef label_;
Ref<bool> show_; Ref<bool> show_;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment