Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Aug 19, 2024
1 parent 601352d commit 8caa79e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class simple_widget :
this->context.get().updater.get().stop(*this);
}else{
this->context.get().updater.get().start(
utki::make_shared_from(*this).to_shared_ptr(),
utki::make_shared_from(*this),
0
);
}
Expand Down Expand Up @@ -524,8 +524,7 @@ class application : public ruisapp::application{

// cube click_proxy
{
auto cube = c.get().try_get_widget_as<cube_widget>("cube_widget");
ASSERT(cube)
auto& cube = c.get().get_widget_as<cube_widget>("cube_widget");

auto& cp = c.get().get_widget_as<ruis::click_proxy>("cube_click_proxy");
auto& bg = c.get().get_widget_as<ruis::color>("cube_bg_color");
Expand All @@ -535,11 +534,11 @@ class application : public ruisapp::application{
return true;
};
cp.pressed_change_handler(cp); // set initial color
cp.click_handler = [cube](ruis::click_proxy&) -> bool {
if(cube->is_updating()){
cube->context.get().updater.get().stop(*cube);
cp.click_handler = [cube = utki::make_shared_from(cube)](ruis::click_proxy&) -> bool {
if(cube.get().is_updating()){
cube.get().context.get().updater.get().stop(cube.get());
}else{
cube->context.get().updater.get().start(cube, 0);
cube.get().context.get().updater.get().start(cube, 0);
}
return true;
};
Expand Down

0 comments on commit 8caa79e

Please sign in to comment.