mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-25 15:47:25 +08:00
Removed dependencies of libslic3r on Slic3r GUI library.
This commit is contained in:
parent
02d4f3e14d
commit
ac011aec6d
@ -2,7 +2,12 @@
|
|||||||
#include "PreviewData.hpp"
|
#include "PreviewData.hpp"
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
#include "slic3r/GUI/GUI.hpp"
|
#include <I18N.hpp>
|
||||||
|
|
||||||
|
#include <boost/format.hpp>
|
||||||
|
|
||||||
|
//! macro used to mark string used at localization,
|
||||||
|
#define L(s) (s)
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
@ -405,7 +410,7 @@ GCodePreviewData::LegendItemsList GCodePreviewData::get_legend_items(const std::
|
|||||||
items.reserve(last_valid - first_valid + 1);
|
items.reserve(last_valid - first_valid + 1);
|
||||||
for (unsigned int i = (unsigned int)first_valid; i <= (unsigned int)last_valid; ++i)
|
for (unsigned int i = (unsigned int)first_valid; i <= (unsigned int)last_valid; ++i)
|
||||||
{
|
{
|
||||||
items.emplace_back(_CHB(extrusion.role_names[i].c_str()).data(), extrusion.role_colors[i]);
|
items.emplace_back(Slic3r::I18N::translate(extrusion.role_names[i]), extrusion.role_colors[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -436,13 +441,9 @@ GCodePreviewData::LegendItemsList GCodePreviewData::get_legend_items(const std::
|
|||||||
items.reserve(tools_colors_count);
|
items.reserve(tools_colors_count);
|
||||||
for (unsigned int i = 0; i < tools_colors_count; ++i)
|
for (unsigned int i = 0; i < tools_colors_count; ++i)
|
||||||
{
|
{
|
||||||
char buf[MIN_BUF_LENGTH_FOR_L];
|
|
||||||
sprintf(buf, _CHB(L("Extruder %d")), i + 1);
|
|
||||||
|
|
||||||
GCodePreviewData::Color color;
|
GCodePreviewData::Color color;
|
||||||
::memcpy((void*)color.rgba, (const void*)(tool_colors.data() + i * 4), 4 * sizeof(float));
|
::memcpy((void*)color.rgba, (const void*)(tool_colors.data() + i * 4), 4 * sizeof(float));
|
||||||
|
items.emplace_back((boost::format(Slic3r::I18N::translate(L("Extruder %d"))) % (i + 1)).str(), color);
|
||||||
items.emplace_back(buf, color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
//! macro used to mark string used at localization,
|
//! macro used to mark string used at localization,
|
||||||
//! return same string
|
//! return same string
|
||||||
#define L(s) translate(s)
|
#define L(s) Slic3r::I18N::translate(s)
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user