diff --git a/resources/profiles/PrusaResearch.idx b/resources/profiles/PrusaResearch.idx index 9ee9035631..d63336c2ef 100644 --- a/resources/profiles/PrusaResearch.idx +++ b/resources/profiles/PrusaResearch.idx @@ -1,4 +1,5 @@ min_slic3r_version = 2.4.0-rc +1.4.4 Added multiple Fiberlogy filament profiles. Updated Extrudr filament profiles. 1.4.3 Added new filament profiles and SLA materials. 1.4.2 Added SLA material profiles. 1.4.1 Updated firmware version. diff --git a/resources/profiles/PrusaResearch.ini b/resources/profiles/PrusaResearch.ini index 3182eba6bb..4af1e35ed1 100644 --- a/resources/profiles/PrusaResearch.ini +++ b/resources/profiles/PrusaResearch.ini @@ -5,7 +5,7 @@ name = Prusa Research # Configuration version of this file. Config file will only be installed, if the config_version differs. # This means, the server may force the PrusaSlicer configuration to be downgraded. -config_version = 1.4.3 +config_version = 1.4.4 # Where to get the updates from? config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/PrusaResearch/ changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1% @@ -2050,7 +2050,7 @@ compatible_printers_condition = nozzle_diameter[0]!=0.8 and printer_model!="MK2S inherits = Fillamentum ASA filament_vendor = Extrudr bed_temperature = 90 -filament_cost = 25.98 +filament_cost = 34.64 filament_density = 1.05 filament_notes = "https://www.extrudr.com/en/products/catalogue/?material=120" first_layer_bed_temperature = 90 @@ -2083,8 +2083,8 @@ filament_vendor = Extrudr [filament:Extrudr XPETG CF] inherits = Extrudr PETG -filament_cost = 49.99 -filament_density = 1.41 +filament_cost = 62.49 +filament_density = 1.29 filament_notes = "https://www.extrudr.com/en/products/catalogue/?material=198" first_layer_temperature = 235 temperature = 235 @@ -2125,7 +2125,7 @@ filament_spool_weight = 230 [filament:Extrudr Flax] inherits = *PLA* filament_vendor = Extrudr -filament_cost = 56.23 +filament_cost = 50.91 filament_density = 1.45 filament_notes = "High Performance Filament for decorative parts.\nPrints as easily as PLA with much higher strength and temperature resistance.\nFully biodegradable with a nice matt finish.\n\nhttps://www.extrudr.com/en/products/catalogue/?material=131" first_layer_temperature = 190 @@ -2140,13 +2140,13 @@ filament_spool_weight = 262 [filament:Extrudr GreenTEC] inherits = *PLA* filament_vendor = Extrudr -filament_cost = 56 +filament_cost = 50.91 filament_density = 1.3 -filament_notes = "https://www.extrudr.com/en/products/catalogue/?material=106" +filament_notes = "https://www.extrudr.com/en/products/catalogue/?ignorechildren=1&material=106" first_layer_temperature = 208 temperature = 208 slowdown_below_layer_time = 20 -filament_spool_weight = 230 +filament_spool_weight = 262 [filament:Extrudr GreenTEC Pro] inherits = *PLA* @@ -2164,7 +2164,7 @@ filament_spool_weight = 230 [filament:Extrudr GreenTEC Pro Carbon] inherits = *PLA* filament_vendor = Extrudr -filament_cost = 56.23 +filament_cost = 62.49 filament_density = 1.2 filament_notes = "High Performance Filament for technical parts.\nPrints as easily as PLA with much higher stregnth and temperature resistance.\nFully biodegradable with a nice matt finish.\n\nhttps://www.extrudr.com/en/products/catalogue/?material=138" first_layer_temperature = 225 @@ -2221,8 +2221,8 @@ extrusion_multiplier = 1.2 filament_cost = 39.98 filament_density = 1.19 filament_deretract_speed = nil -filament_max_volumetric_speed = 2 -filament_notes = "https://www.extrudr.com/en/products/catalogue/?material=115" +filament_max_volumetric_speed = 3 +filament_notes = "https://www.extrudr.com/en/products/catalogue/?material=117" filament_retract_length = 0.4 filament_wipe = nil filament_spool_weight = 230 @@ -2236,8 +2236,8 @@ extrusion_multiplier = 1.2 filament_cost = 39.98 filament_density = 1.18 filament_deretract_speed = nil -filament_max_volumetric_speed = 1.2 -filament_notes = "https://www.extrudr.com/en/products/catalogue/?material=115" +filament_max_volumetric_speed = 1.8 +filament_notes = "https://www.extrudr.com/en/products/catalogue/?material=116" filament_retract_length = 0.4 filament_wipe = nil filament_spool_weight = 230 @@ -3511,13 +3511,6 @@ filament_density = 1.27 filament_spool_weight = 235 compatible_printers_condition = nozzle_diameter[0]!=0.6 and printer_model!="MK2SMM" and printer_model!="MINI" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material) -[filament:Fiberlogy PETG] -inherits = *PET* -filament_vendor = Fiberlogy -filament_cost = 21.50 -filament_density = 1.27 -compatible_printers_condition = nozzle_diameter[0]!=0.6 and printer_model!="MK2SMM" and printer_model!="MINI" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material) - [filament:Prusament PETG] inherits = *PET* filament_vendor = Prusa Polymers @@ -3580,8 +3573,9 @@ filament_density = 1.27 filament_spool_weight = 235 filament_type = PETG -[filament:Fiberlogy PETG @0.6 nozzle] +[filament:Fiberlogy Easy PET-G @0.6 nozzle] inherits = *PET06* +renamed_from = Fiberlogy PETG @0.6 nozzle filament_vendor = Fiberlogy first_layer_temperature = 230 temperature = 240 @@ -3673,11 +3667,297 @@ filament_density = 1.24 filament_spool_weight = 230 compatible_printers_condition = nozzle_diameter[0]!=0.8 and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material) -[filament:Fiberlogy PLA] +[filament:Fiberlogy Easy PLA] inherits = *PLA* +renamed_from = Fiberlogy PLA filament_vendor = Fiberlogy -filament_cost = 25.4 +filament_cost = 20 filament_density = 1.24 +first_layer_temperature = 220 +temperature = 220 +filament_spool_weight = 330 + +[filament:Fiberlogy Easy PET-G] +inherits = *PET* +renamed_from = Fiberlogy PETG +filament_vendor = Fiberlogy +filament_spool_weight = 330 +filament_cost = 20 +filament_density = 1.27 +compatible_printers_condition = nozzle_diameter[0]!=0.6 and printer_model!="MK2SMM" and printer_model!="MINI" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material) +first_layer_bed_temperature = 80 +bed_temperature = 80 +first_layer_temperature = 235 +temperature = 235 +min_fan_speed = 15 +max_fan_speed = 30 +bridge_fan_speed = 60 +disable_fan_first_layers = 5 +full_fan_speed_layer = 5 +slowdown_below_layer_time = 15 + +[filament:Fiberlogy ASA] +inherits = *ABS* +filament_vendor = Fiberlogy +filament_cost = 33 +filament_density = 1.07 +filament_spool_weight = 330 +fan_always_on = 0 +cooling = 1 +min_fan_speed = 10 +max_fan_speed = 15 +bridge_fan_speed = 30 +min_print_speed = 15 +slowdown_below_layer_time = 15 +first_layer_temperature = 260 +temperature = 260 +first_layer_bed_temperature = 105 +bed_temperature = 110 +filament_type = ASA +fan_below_layer_time = 30 +disable_fan_first_layers = 5 + +[filament:Fiberlogy ASA @MINI] +inherits = Fiberlogy ASA; *ABSMINI* + +[filament:Fiberlogy Easy ABS] +inherits = Fiberlogy ASA +filament_cost = 22.67 +filament_density = 1.09 +fan_always_on = 0 +cooling = 1 +min_fan_speed = 10 +max_fan_speed = 15 +min_print_speed = 15 +slowdown_below_layer_time = 15 +first_layer_temperature = 250 +temperature = 250 +first_layer_bed_temperature = 100 +bed_temperature = 100 +filament_type = ABS +fan_below_layer_time = 25 +disable_fan_first_layers = 5 + +[filament:Fiberlogy Easy ABS @MINI] +inherits = Fiberlogy Easy ABS; *ABSMINI* + +[filament:Fiberlogy CPE HT] +inherits = *PET* +filament_vendor = Fiberlogy +filament_cost = 42.67 +filament_density = 1.18 +extrusion_multiplier = 0.98 +filament_spool_weight = 330 +fan_always_on = 1 +cooling = 1 +min_fan_speed = 0 +max_fan_speed = 0 +bridge_fan_speed = 50 +min_print_speed = 15 +first_layer_temperature = 275 +temperature = 275 +first_layer_bed_temperature = 105 +bed_temperature = 110 +filament_type = CPE +fan_below_layer_time = 20 +slowdown_below_layer_time = 15 +disable_fan_first_layers = 5 + +[filament:Fiberlogy PCTG] +inherits = Fiberlogy CPE HT +filament_vendor = Fiberlogy +filament_cost = 29.41 +filament_density = 1.23 +extrusion_multiplier = 0.98 +min_fan_speed = 10 +max_fan_speed = 15 +bridge_fan_speed = 50 +min_print_speed = 15 +first_layer_temperature = 265 +temperature = 265 +first_layer_bed_temperature = 90 +bed_temperature = 90 +filament_type = CPE +fan_below_layer_time = 20 +slowdown_below_layer_time = 15 +disable_fan_first_layers = 5 + +[filament:Fiberlogy FiberFlex 40D] +inherits = *FLEX* +filament_vendor = Fiberlogy +fan_always_on = 1 +filament_max_volumetric_speed = 1.5 +extrusion_multiplier = 1.12 +first_layer_temperature = 230 +first_layer_bed_temperature = 60 +temperature = 230 +bed_temperature = 60 +bridge_fan_speed = 75 +min_fan_speed = 25 +max_fan_speed = 75 +filament_retract_before_travel = 2 +filament_cost = 39.41 +filament_density = 1.16 +filament_retract_length = 1.2 +filament_retract_speed = nil +filament_deretract_speed = 20 +filament_retract_lift = 0 +filament_wipe = 0 +disable_fan_first_layers = 5 +full_fan_speed_layer = 5 +min_print_speed = 15 +cooling = 1 +filament_spool_weight = 330 + +[filament:Fiberlogy FiberFlex 40D @MINI] +inherits = *FLEXMINI* +filament_vendor = Fiberlogy +filament_max_volumetric_speed = 1.5 +fan_always_on = 1 +first_layer_temperature = 240 +first_layer_bed_temperature = 60 +temperature = 240 +bed_temperature = 60 +filament_retract_length = 4 +filament_retract_before_travel = 5 +bridge_fan_speed = 80 +min_fan_speed = 25 +max_fan_speed = 60 +min_print_speed = 15 +slowdown_below_layer_time = 10 +cooling = 1 +filament_cost = 84.68 + +[filament:Fiberlogy MattFlex 40D] +inherits = Fiberlogy FiberFlex 40D +filament_vendor = Fiberlogy +fan_always_on = 1 +filament_max_volumetric_speed = 1.35 +extrusion_multiplier = 1.1 +filament_retract_before_travel = 2 +filament_cost = 49.11 +filament_retract_length = 1.2 + +[filament:Fiberlogy FiberFlex 30D] +inherits = Fiberlogy FiberFlex 40D +filament_max_volumetric_speed = 1.2 +extrusion_multiplier = 1.15 +first_layer_temperature = 240 +temperature = 240 +min_fan_speed = 25 +max_fan_speed = 60 +filament_density = 1.07 +filament_retract_length = 1.2 + +[filament:Fiberlogy FiberSatin] +inherits = Fiberlogy Easy PLA +first_layer_temperature = 215 +temperature = 215 +extrusion_multiplier = 1.03 +filament_density = 1.2 +filament_cost = 32.35 + +[filament:Fiberlogy FiberSilk] +inherits = Fiberlogy FiberSatin +first_layer_temperature = 230 +temperature = 230 +extrusion_multiplier = 0.97 +filament_density = 1.22 +filament_cost = 32.35 + +[filament:Fiberlogy FiberWood] +inherits = Fiberlogy Easy PLA +first_layer_temperature = 185 +temperature = 185 +extrusion_multiplier = 1 +filament_density = 1.23 +filament_cost = 38.66 +filament_max_volumetric_speed = 8 + +[filament:Fiberlogy HD PLA] +inherits = Fiberlogy Easy PLA +first_layer_temperature = 230 +temperature = 230 +extrusion_multiplier = 1 +filament_density = 1.24 +filament_cost = 30.59 + +[filament:Fiberlogy PLA Mineral] +inherits = Fiberlogy Easy PLA +first_layer_temperature = 195 +temperature = 190 +extrusion_multiplier = 0.98 +filament_density = 1.38 +filament_cost = 37.64 +filament_max_volumetric_speed = 10 + +[filament:Fiberlogy Impact PLA] +inherits = Fiberlogy HD PLA +filament_density = 1.22 +filament_cost = 27.65 + +[filament:Fiberlogy Nylon PA12] +inherits = Fiberlogy ASA +filament_type = NYLON +filament_density = 1.01 +filament_cost = 48 +first_layer_bed_temperature = 105 +bed_temperature = 110 +first_layer_temperature = 265 +temperature = 265 +min_fan_speed = 10 +max_fan_speed = 15 +fan_below_layer_time = 20 +bridge_fan_speed = 30 +fan_always_on = 0 +filament_retract_lift = 0.2 +filament_max_volumetric_speed = 6 +start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.8}0.06{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif nozzle_diameter[0]==0.8}0.02{elsif nozzle_diameter[0]==0.6}0.04{else}0.08{endif} ; Filament gcode LA 1.5\n{if printer_notes=~/.*PRINTER_MODEL_MINI.*/};{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}M900 K200{elsif nozzle_diameter[0]==0.6}M900 K26{elsif nozzle_diameter[0]==0.8};{else}M900 K45{endif} ; Filament gcode LA 1.0" + +[filament:Fiberlogy Nylon PA12+CF15] +inherits = Fiberlogy Nylon PA12 +extrusion_multiplier = 0.97 +filament_density = 1.07 +filament_cost = 87.5 +first_layer_bed_temperature = 105 +bed_temperature = 110 +first_layer_temperature = 265 +temperature = 265 +min_fan_speed = 10 +max_fan_speed = 15 +fan_below_layer_time = 20 +bridge_fan_speed = 30 +fan_always_on = 0 +filament_max_volumetric_speed = 8 +compatible_printers_condition = nozzle_diameter[0]>=0.4 and printer_model!="MK2SMM" and printer_model!="MINI" and ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material) + +[filament:Fiberlogy Nylon PA12+GF15] +inherits = Fiberlogy Nylon PA12+CF15 +filament_density = 1.13 +filament_max_volumetric_speed = 8 + +[filament:Fiberlogy PP] +inherits = *ABS* +filament_vendor = Fiberlogy +filament_cost = 36.67 +filament_density = 1.05 +extrusion_multiplier = 1.05 +filament_spool_weight = 330 +fan_always_on = 1 +cooling = 1 +min_fan_speed = 0 +max_fan_speed = 25 +bridge_fan_speed = 70 +min_print_speed = 15 +slowdown_below_layer_time = 15 +first_layer_temperature = 245 +temperature = 245 +first_layer_bed_temperature = 0 +bed_temperature = 0 +filament_type = PP +fan_below_layer_time = 100 +disable_fan_first_layers = 5 +filament_max_volumetric_speed = 5 [filament:Filament PM PLA] inherits = *PLA* @@ -3736,7 +4016,7 @@ filament_density = 1.24 inherits = *PLA* filament_vendor = Prusa Polymers temperature = 215 -filament_cost = 30.24 +filament_cost = 36.29 filament_density = 1.24 filament_spool_weight = 201 filament_notes = "Affordable filament for everyday printing in premium quality manufactured in-house by Josef Prusa" @@ -3790,7 +4070,7 @@ filament_spool_weight = 230 [filament:Prusament PLA @MMU2] inherits = *PLA MMU2* filament_vendor = Prusa Polymers -filament_cost = 30.24 +filament_cost = 36.29 filament_density = 1.24 filament_spool_weight = 201 @@ -4124,8 +4404,9 @@ renamed_from = "Plasty Mladec PETG @MMU1" [filament:Verbatim PETG @MMU1] inherits = Verbatim PETG; *PETMMU1* -[filament:Fiberlogy PETG @MMU1] -inherits = Fiberlogy PETG; *PETMMU1* +[filament:Fiberlogy Easy PET-G @MMU1] +inherits = Fiberlogy Easy PET-G; *PETMMU1* +renamed_from = Fiberlogy PETG @MMU1 [filament:Prusa PETG @MMU1] inherits = Prusa PETG; *PETMMU1* @@ -4215,8 +4496,9 @@ compatible_printers_condition = printer_model=="MINI" and nozzle_diameter[0]!=0. inherits = Verbatim PETG; *PETMINI* compatible_printers_condition = printer_model=="MINI" and nozzle_diameter[0]!=0.6 -[filament:Fiberlogy PETG @MINI] -inherits = Fiberlogy PETG; *PETMINI* +[filament:Fiberlogy Easy PET-G @MINI] +inherits = Fiberlogy Easy PET-G; *PETMINI* +renamed_from = Fiberlogy PETG @MINI compatible_printers_condition = printer_model=="MINI" and nozzle_diameter[0]!=0.6 [filament:Generic ABS @MINI] @@ -4303,8 +4585,9 @@ renamed_from = "Plasty Mladec PETG @0.6 nozzle MINI" [filament:Verbatim PETG @0.6 nozzle MINI] inherits = Verbatim PETG; *PETMINI06* -[filament:Fiberlogy PETG @0.6 nozzle MINI] -inherits = Fiberlogy PETG; *PETMINI06* +[filament:Fiberlogy Easy PET-G @0.6 nozzle MINI] +inherits = Fiberlogy Easy PET-G; *PETMINI06* +renamed_from = Fiberlogy PETG @0.6 nozzle MINI [filament:Prusament ASA @MINI] inherits = Prusament ASA; *ABSMINI* diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 04685e7cc3..f332a55585 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -830,7 +830,7 @@ void ObjectList::paste_objects_into_list(const std::vector& object_idxs) wxDataViewItemArray items; for (const size_t object : object_idxs) { - add_object_to_list(object); + add_object_to_list(object, false); items.Add(m_objects_model->GetItemById(object)); } diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index 405c493bb5..04bb196556 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -324,7 +324,8 @@ void NotificationManager::PopNotification::count_lines() } m_lines_count++; } - // hypertext calculation + // original hypertext calculation (when there was no text2) + /* if (!m_hypertext.empty()) { int prev_end = m_endlines.size() > 1 ? m_endlines[m_endlines.size() - 2] : 0; // m_endlines.size() - 2 because we are fitting hypertext instead of last endline if (ImGui::CalcTextSize((escape_string_cstyle(text.substr(prev_end, last_end - prev_end)) + m_hypertext).c_str()).x > m_window_width - m_window_width_offset) { @@ -332,9 +333,84 @@ void NotificationManager::PopNotification::count_lines() m_lines_count++; } } + */ + int prev_end = m_endlines.size() > 1 ? m_endlines[m_endlines.size() - 2] : 0; + int size_of_last_line = ImGui::CalcTextSize(text.substr(prev_end, last_end - prev_end).c_str()).x; + // hypertext calculation + if (!m_hypertext.empty()) { + if (size_of_last_line + ImGui::CalcTextSize(m_hypertext.c_str()).x > m_window_width - m_window_width_offset) { + // hypertext on new line + size_of_last_line = ImGui::CalcTextSize((m_hypertext + " ").c_str()).x; + m_endlines.push_back(last_end); + m_lines_count++; + } + else { + size_of_last_line += ImGui::CalcTextSize((m_hypertext + " ").c_str()).x; + } + } + // text after hypertext calculation + if (!m_text2.empty()) { + text = m_text2; + last_end = 0; + m_endlines2.clear(); + // if size_of_last_line too large to fit anything + size_t first_end = std::min(text.find_first_of('\n'), text.find_first_of(' ')); + if (size_of_last_line >= m_window_width - m_window_width_offset - ImGui::CalcTextSize(text.substr(0, first_end).c_str()).x) { + m_endlines2.push_back(0); + size_of_last_line = 0; + } + while (last_end < text.length() - 1) + { + size_t next_hard_end = text.find_first_of('\n', last_end); + if (next_hard_end != std::string::npos && ImGui::CalcTextSize(text.substr(last_end, next_hard_end - last_end).c_str()).x < m_window_width - m_window_width_offset - size_of_last_line) { + //next line is ended by '/n' + m_endlines2.push_back(next_hard_end); + last_end = next_hard_end + 1; + } + else { + // find next suitable endline + if (ImGui::CalcTextSize(text.substr(last_end).c_str()).x >= m_window_width - m_window_width_offset - size_of_last_line) { + // more than one line till end + size_t next_space = text.find_first_of(' ', last_end); + if (next_space > 0) { + size_t next_space_candidate = text.find_first_of(' ', next_space + 1); + while (next_space_candidate > 0 && ImGui::CalcTextSize(text.substr(last_end, next_space_candidate - last_end).c_str()).x < m_window_width - m_window_width_offset - size_of_last_line) { + next_space = next_space_candidate; + next_space_candidate = text.find_first_of(' ', next_space + 1); + } + } + else { + next_space = text.length(); + } + // when one word longer than line. + if (ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x > m_window_width - m_window_width_offset - size_of_last_line || + ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x + size_of_last_line < (m_window_width - m_window_width_offset) / 5 * 3 + ) { + float width_of_a = ImGui::CalcTextSize("a").x; + int letter_count = (int)((m_window_width - m_window_width_offset - size_of_last_line) / width_of_a); + while (last_end + letter_count < text.size() && ImGui::CalcTextSize(text.substr(last_end, letter_count).c_str()).x < m_window_width - m_window_width_offset - size_of_last_line) { + letter_count += get_utf8_sequence_length(text, last_end + letter_count); + } + m_endlines2.push_back(last_end + letter_count); + last_end += letter_count; + } + else { + m_endlines2.push_back(next_space); + last_end = next_space + 1; + } + } + else { + m_endlines2.push_back(text.length()); + last_end = text.length(); + } - // m_text_2 (text after hypertext) is not used for regular notifications right now. - // its caluculation is in HintNotification::count_lines() + } + if (size_of_last_line == 0) // if first line is continuation of previous text, do not add to line count. + m_lines_count++; + size_of_last_line = 0; // should countain value only for first line (with hypertext) + + } + } } void NotificationManager::PopNotification::init() @@ -400,8 +476,29 @@ void NotificationManager::PopNotification::render_text(ImGuiWrapper& imgui, cons render_hypertext(imgui, x_offset + ImGui::CalcTextSize((line + (line.empty() ? "" : " ")).c_str()).x, starting_y + (m_endlines.size() - 1) * shift_y, m_hypertext); } - // text2 (text after hypertext) is not rendered for regular notifications - // its rendering is in HintNotification::render_text + // text2 + if (!m_text2.empty() && (m_multiline|| m_lines_count <= 2)) { + starting_y += (m_endlines.size() - 1) * shift_y; + last_end = 0; + for (size_t i = 0; i < (m_multiline ? m_endlines2.size() : 2); i++) { + if (i == 0) //first line X is shifted by hypertext + ImGui::SetCursorPosX(x_offset + ImGui::CalcTextSize((line + m_hypertext + (line.empty() ? " " : " ")).c_str()).x); + else + ImGui::SetCursorPosX(x_offset); + + ImGui::SetCursorPosY(starting_y + i * shift_y); + line.clear(); + if (m_endlines2.size() > i && m_text2.size() >= m_endlines2[i]) { + + // regular line + line = m_text2.substr(last_end, m_endlines2[i] - last_end); + last_end = m_endlines2[i]; + if (m_text2.size() > m_endlines2[i]) + last_end += (m_text2[m_endlines2[i]] == '\n' || m_text2[m_endlines2[i]] == ' ' ? 1 : 0); + imgui.text(line.c_str()); + } + } + } } void NotificationManager::PopNotification::render_hypertext(ImGuiWrapper& imgui, const float text_x, const float text_y, const std::string text, bool more) @@ -1547,10 +1644,11 @@ void NotificationManager::push_notification(NotificationType type, const std::string& text, const std::string& hypertext, std::function callback, + const std::string& text_after, int timestamp) { int duration = get_standard_duration(level); - push_notification_data({ type, level, duration, text, hypertext, callback }, timestamp); + push_notification_data({ type, level, duration, text, hypertext, callback, text_after }, timestamp); } void NotificationManager::push_delayed_notification(const NotificationType type, std::function condition_callback, int64_t initial_delay, int64_t delay_interval) diff --git a/src/slic3r/GUI/NotificationManager.hpp b/src/slic3r/GUI/NotificationManager.hpp index 0fd32ff8b9..d9e9619118 100644 --- a/src/slic3r/GUI/NotificationManager.hpp +++ b/src/slic3r/GUI/NotificationManager.hpp @@ -156,7 +156,7 @@ public: // Push a NotificationType::CustomNotification with provided notification level and 10s for RegularNotificationLevel. // ErrorNotificationLevel are never faded out. void push_notification(NotificationType type, NotificationLevel level, const std::string& text, const std::string& hypertext = "", - std::function callback = std::function(), int timestamp = 0); + std::function callback = std::function(), const std::string& text_after = "", int timestamp = 0); // Pushes basic_notification with delay. See push_delayed_notification_data. void push_delayed_notification(const NotificationType type, std::function condition_callback, int64_t initial_delay, int64_t delay_interval); // Removes all notifications of type from m_waiting_notifications diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 0f39b6279b..2a51f9ef5d 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2225,7 +2225,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) bool is_collapsed = wxGetApp().app_config->get("collapsed_sidebar") == "1"; sidebar->collapse(is_collapsed); } -} + } Plater::priv::~priv() {