add auto-timelapse option
This commit is contained in:
@@ -994,6 +994,28 @@ void App::init_menu_tools()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (auto btn = popup_time->find<NodeButtonCustom>("tools-timelapse"))
|
||||
{
|
||||
NodeCheckBox* cb = btn->find<NodeCheckBox>("tools-timelapse-check");
|
||||
cb->set_value(Settings::value_or<Serializer::Boolean>("auto-timelapse", true), false);
|
||||
|
||||
btn->on_click = [this, btn](Node* b)
|
||||
{
|
||||
NodeCheckBox* cb = btn->find<NodeCheckBox>("tools-timelapse-check");
|
||||
cb->set_value(!cb->checked, true);
|
||||
};
|
||||
|
||||
btn->find<NodeCheckBox>("tools-timelapse-check")->on_value_changed = [this, main](Node*, bool checked)
|
||||
{
|
||||
if (!checked && App::I->rec_running)
|
||||
App::I->rec_stop();
|
||||
else if (checked && !App::I->rec_running)
|
||||
App::I->rec_start();
|
||||
Settings::set("auto-timelapse", Serializer::Boolean(checked));
|
||||
Settings::save();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
popup_exp->find<NodeButtonCustom>("clear-grids")->on_click = [this, popup_exp](Node*) {
|
||||
@@ -1250,7 +1272,6 @@ void App::initLayout()
|
||||
{
|
||||
layers->add_layer("Default", false, true);
|
||||
Canvas::I->m_unsaved = false;
|
||||
Canvas::I->timelapse_reset_encoder();
|
||||
}
|
||||
|
||||
init_toolbar_draw();
|
||||
|
||||
Reference in New Issue
Block a user