Thumbnails feature revamp. (#5555)

* Thumbnails feature revamp.
Support generating different size/format combinations
* misc fix

Co-authored-by: Lukas Matena <lukasmatena@seznam.cz>
This commit is contained in:
SoftFever 2024-06-03 21:30:38 +08:00 committed by GitHub
parent 50d00a1d54
commit c083541e0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 1145 additions and 854 deletions

View file

@ -692,8 +692,9 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config,
opt_key == "printable_area" || opt_key == "compatible_printers" || opt_key == "compatible_prints" ||
opt_key == "thumbnails" || opt_key == "bed_custom_texture" || opt_key == "bed_custom_model") {
value = get_config_value(config, opt_key);
this->change_opt_value(opt_key, value);
OptionsGroup::on_change_OG(opt_key, value);
set_value(opt_key, value);
this->change_opt_value(opt_key, get_value(opt_key));
OptionsGroup::on_change_OG(opt_key, get_value(opt_key));
return;
} else {
auto opt_id = m_opt_map.find(opt_key)->first;
@ -1072,8 +1073,6 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
if (opt_key == "printable_area")
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
else if (opt_key == "bed_exclude_area")
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
else if (opt_key == "thumbnails")
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
else
ret = config.option<ConfigOptionPoints>(opt_key)->get_at(idx);
@ -1188,8 +1187,6 @@ boost::any ConfigOptionsGroup::get_config_value2(const DynamicPrintConfig& confi
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
else if (opt_key == "bed_exclude_area")
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
else if (opt_key == "thumbnails")
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
else
ret = config.option<ConfigOptionPoints>(opt_key)->get_at(idx);
break;