Route preference reads through adapter

This commit is contained in:
2026-06-12 17:30:27 +02:00
parent 14a3721e0d
commit 59dd010b5a
8 changed files with 74 additions and 20 deletions

View File

@@ -1108,7 +1108,7 @@ 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);
cb->set_value(pp::panopainter::legacy_boolean_preference_or("auto-timelapse", true), false);
btn->on_click = [this, btn](Node* b)
{
@@ -1128,7 +1128,7 @@ void App::init_menu_tools()
if (auto mode = popup_time->find<NodeComboBox>("tools-show-cursor"))
{
mode->set_index(Settings::value_or<Serializer::Integer>("show-cursor", 0));
mode->set_index(pp::panopainter::legacy_integer_preference_or("show-cursor", 0));
mode->on_select = [mode](Node* target, int index)
{
@@ -1614,16 +1614,16 @@ void App::ui_save()
void App::ui_restore()
{
if (Settings::has("ui-rtl"))
set_ui_rtl(Settings::value<Serializer::Integer>("ui-rtl"));
if (pp::panopainter::has_legacy_preference("ui-rtl"))
set_ui_rtl(pp::panopainter::legacy_integer_preference("ui-rtl"));
if (!Settings::has("ui"))
if (!pp::panopainter::has_legacy_preference("ui"))
return;
auto floatings = layout[main_id]->find_ref("floatings");
auto drop_left = layout[main_id]->find_ref("drop-left");
auto drop_right = layout[main_id]->find_ref("drop-right");
auto d = Settings::get<Serializer::Descriptor>("ui");
auto d = pp::panopainter::get_legacy_descriptor_preference("ui");
for (auto const& l : d->get<Serializer::List>("floatings")->items)
{
auto ld = std::static_pointer_cast<Serializer::Descriptor>(l);