Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Aug 19, 2024
1 parent d13e6c4 commit bff2f35
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
13 changes: 6 additions & 7 deletions tests/app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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 @@ -521,8 +521,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 @@ -532,11 +531,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
6 changes: 3 additions & 3 deletions tests/book/src/cube_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class cube_widget : public ruis::widget, public ruis::updateable{
};
}

cube_page::cube_page(const utki::shared_ref<ruis::context>& c) :
widget(c, tml::forest()),
cube_page::cube_page(utki::shared_ref<ruis::context> c) :
widget(std::move(c), tml::forest()),
page(this->context, tml::forest()),
container(this->context, tml::read(R"qwertyuiop(
layout{pile}
Expand Down Expand Up @@ -142,7 +142,7 @@ cube_page::cube_page(const utki::shared_ref<ruis::context>& c) :
}

void cube_page::on_show(){
this->context.get().updater.get().start(this->cube, 0);
this->context.get().updater.get().start(utki::shared_ref(this->cube), 0);
}

void cube_page::on_hide()noexcept{
Expand Down
2 changes: 1 addition & 1 deletion tests/book/src/cube_page.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class cube_page :
{
std::shared_ptr<ruis::updateable> cube;
public:
cube_page(const utki::shared_ref<ruis::context>& c);
cube_page(utki::shared_ref<ruis::context> c);

cube_page(const cube_page&) = delete;
cube_page& operator=(const cube_page&) = delete;
Expand Down

0 comments on commit bff2f35

Please sign in to comment.