parent
17686b4814
commit
3a93277531
@ -117,13 +117,6 @@ int CLI::run(int argc, char **argv)
|
||||
// On Unix systems, the prusa-slicer binary may be symlinked to give the application a different meaning.
|
||||
boost::algorithm::iends_with(boost::filesystem::path(argv[0]).filename().string(), "gcodeviewer");
|
||||
#endif // _WIN32
|
||||
bool start_as_medical =
|
||||
boost::algorithm::iends_with(boost::filesystem::path(argv[0]).filename().string(),
|
||||
#ifdef _WIN32
|
||||
"-medical.exe");
|
||||
#else
|
||||
"-medical");
|
||||
#endif // _WIN32
|
||||
|
||||
const std::vector<std::string> &load_configs = m_config.option<ConfigOptionStrings>("load", true)->values;
|
||||
const ForwardCompatibilitySubstitutionRule config_substitution_rule = m_config.option<ConfigOptionEnum<ForwardCompatibilitySubstitutionRule>>("config_compatibility", true)->value;
|
||||
@ -609,7 +602,6 @@ int CLI::run(int argc, char **argv)
|
||||
params.extra_config = std::move(m_extra_config);
|
||||
params.input_files = std::move(m_input_files);
|
||||
params.start_as_gcodeviewer = start_as_gcodeviewer;
|
||||
params.start_as_medical = start_as_medical;
|
||||
return Slic3r::GUI::GUI_Run(params);
|
||||
#else // SLIC3R_GUI
|
||||
// No GUI support. Just print out a help.
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
BitmapCache::BitmapCache(bool medical) : m_medical(medical)
|
||||
BitmapCache::BitmapCache()
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
// Note: win->GetContentScaleFactor() is not used anymore here because it tends to
|
||||
@ -280,9 +280,7 @@ wxBitmap* BitmapCache::load_svg(const std::string &bitmap_name, unsigned target_
|
||||
if (dark_mode)
|
||||
replaces["#808080"] = "#FFFFFF";
|
||||
if (!new_color.empty())
|
||||
replaces[m_medical ? "#5EA796" : "#ED6B21"] = new_color;
|
||||
if (m_medical)
|
||||
replaces["#ED6B21"] = "#5EA796";
|
||||
replaces["#ED6B21"] = new_color;
|
||||
|
||||
NSVGimage *image = ::nsvgParseFromFileWithReplace(Slic3r::var(bitmap_name + ".svg").c_str(), "px", 96.0f, replaces);
|
||||
if (image == nullptr)
|
||||
|
@ -14,7 +14,7 @@ namespace Slic3r { namespace GUI {
|
||||
class BitmapCache
|
||||
{
|
||||
public:
|
||||
BitmapCache(bool medical);
|
||||
BitmapCache();
|
||||
~BitmapCache() { clear(); }
|
||||
void clear();
|
||||
double scale() { return m_scale; }
|
||||
@ -42,7 +42,6 @@ public:
|
||||
static bool parse_color(const std::string& scolor, unsigned char* rgb_out);
|
||||
|
||||
private:
|
||||
bool m_medical;
|
||||
std::map<std::string, wxBitmap*> m_map;
|
||||
double m_gs = 0.2; // value, used for image.ConvertToGreyscale(m_gs, m_gs, m_gs)
|
||||
double m_scale = 1.0; // value, used for correct scaling of SVG icons on Retina display
|
||||
|
@ -195,7 +195,7 @@ public:
|
||||
int width = lround(bmp.GetWidth() * 0.4);
|
||||
|
||||
// load bitmap for logo
|
||||
BitmapCache bmp_cache { wxGetApp().is_medical() };
|
||||
BitmapCache bmp_cache;
|
||||
int logo_size = lround(width * 0.25);
|
||||
wxBitmap logo_bmp = *bmp_cache.load_svg(wxGetApp().logo_name(), logo_size, logo_size);
|
||||
|
||||
@ -758,10 +758,9 @@ void GUI_App::post_init()
|
||||
|
||||
IMPLEMENT_APP(GUI_App)
|
||||
|
||||
GUI_App::GUI_App(EAppMode mode, bool medical)
|
||||
GUI_App::GUI_App(EAppMode mode)
|
||||
: wxApp()
|
||||
, m_app_mode(mode)
|
||||
, m_medical(medical)
|
||||
, m_em_unit(10)
|
||||
, m_imgui(new ImGuiWrapper())
|
||||
, m_removable_drive_manager(std::make_unique<RemovableDriveManager>())
|
||||
|
@ -113,7 +113,6 @@ private:
|
||||
bool m_initialized { false };
|
||||
bool m_app_conf_exists{ false };
|
||||
EAppMode m_app_mode{ EAppMode::Editor };
|
||||
bool m_medical { false };
|
||||
bool m_is_recreating_gui{ false };
|
||||
#ifdef __linux__
|
||||
bool m_opengl_initialized{ false };
|
||||
@ -160,13 +159,12 @@ public:
|
||||
bool OnInit() override;
|
||||
bool initialized() const { return m_initialized; }
|
||||
|
||||
explicit GUI_App(EAppMode mode = EAppMode::Editor, bool medical = false);
|
||||
explicit GUI_App(EAppMode mode = EAppMode::Editor);
|
||||
~GUI_App() override;
|
||||
|
||||
EAppMode get_app_mode() const { return m_app_mode; }
|
||||
bool is_editor() const { return m_app_mode == EAppMode::Editor; }
|
||||
bool is_gcode_viewer() const { return m_app_mode == EAppMode::GCodeViewer; }
|
||||
bool is_medical() const { return m_medical; }
|
||||
bool is_recreating_gui() const { return m_is_recreating_gui; }
|
||||
std::string logo_name() const { return is_editor() ? "PrusaSlicer" : "PrusaSlicer-gcodeviewer"; }
|
||||
|
||||
|
@ -37,7 +37,7 @@ int GUI_Run(GUI_InitParams ¶ms)
|
||||
#endif // __APPLE__
|
||||
|
||||
try {
|
||||
GUI::GUI_App* gui = new GUI::GUI_App(params.start_as_gcodeviewer ? GUI::GUI_App::EAppMode::GCodeViewer : GUI::GUI_App::EAppMode::Editor, params.start_as_medical);
|
||||
GUI::GUI_App* gui = new GUI::GUI_App(params.start_as_gcodeviewer ? GUI::GUI_App::EAppMode::GCodeViewer : GUI::GUI_App::EAppMode::Editor);
|
||||
if (gui->get_app_mode() != GUI::GUI_App::EAppMode::GCodeViewer) {
|
||||
// G-code viewer is currently not performing instance check, a new G-code viewer is started every time.
|
||||
bool gui_single_instance_setting = gui->app_config->get("single_instance") == "1";
|
||||
|
@ -21,7 +21,6 @@ struct GUI_InitParams
|
||||
std::vector<std::string> input_files;
|
||||
|
||||
bool start_as_gcodeviewer;
|
||||
bool start_as_medical;
|
||||
};
|
||||
|
||||
int GUI_Run(GUI_InitParams ¶ms);
|
||||
|
@ -644,8 +644,6 @@ void MainFrame::update_title()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (wxGetApp().is_medical())
|
||||
boost::replace_first(build_id, "PrusaSlicer", "PrusaSlicer-medical");
|
||||
|
||||
title += wxString(build_id);
|
||||
if (wxGetApp().is_editor())
|
||||
|
@ -322,7 +322,7 @@ static int get_root_idx(ObjectDataViewModelNode *parent_node, const ItemType roo
|
||||
|
||||
ObjectDataViewModel::ObjectDataViewModel()
|
||||
{
|
||||
m_bitmap_cache = new Slic3r::GUI::BitmapCache { wxGetApp().is_medical() };
|
||||
m_bitmap_cache = new Slic3r::GUI::BitmapCache;
|
||||
|
||||
m_volume_bmps = MenuFactory::get_volume_bitmaps();
|
||||
m_warning_bmp = create_scaled_bitmap(WarningIcon);
|
||||
|
@ -150,7 +150,7 @@ PresetComboBox::~PresetComboBox()
|
||||
|
||||
BitmapCache& PresetComboBox::bitmap_cache()
|
||||
{
|
||||
static BitmapCache bmps { wxGetApp().is_medical() };
|
||||
static BitmapCache bmps;
|
||||
return bmps;
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ wxBitmap ModelNode::get_bitmap(const wxString& color)
|
||||
const int icon_width = lround(6.4 * em);
|
||||
const int icon_height = lround(1.6 * em);
|
||||
|
||||
BitmapCache bmp_cache { wxGetApp().is_medical() };
|
||||
BitmapCache bmp_cache;
|
||||
unsigned char rgb[3];
|
||||
BitmapCache::parse_color(into_u8(color), rgb);
|
||||
// there is no need to scale created solid bitmap
|
||||
|
@ -432,7 +432,7 @@ wxBitmap create_scaled_bitmap( const std::string& bmp_name_in,
|
||||
const std::string& new_color/* = std::string()*/, // color witch will used instead of orange
|
||||
const bool menu_bitmap/* = false*/)
|
||||
{
|
||||
static Slic3r::GUI::BitmapCache cache { Slic3r::GUI::wxGetApp().is_medical() };
|
||||
static Slic3r::GUI::BitmapCache cache;
|
||||
|
||||
unsigned int width = 0;
|
||||
unsigned int height = (unsigned int)(em_unit(win) * px_cnt * 0.1f + 0.5f);
|
||||
@ -462,7 +462,7 @@ wxBitmap create_scaled_bitmap( const std::string& bmp_name_in,
|
||||
|
||||
std::vector<wxBitmap*> get_extruder_color_icons(bool thin_icon/* = false*/)
|
||||
{
|
||||
static Slic3r::GUI::BitmapCache bmp_cache { Slic3r::GUI::wxGetApp().is_medical() };
|
||||
static Slic3r::GUI::BitmapCache bmp_cache;
|
||||
|
||||
// Create the bitmap with color bars.
|
||||
std::vector<wxBitmap*> bmps;
|
||||
|
Loading…
Reference in New Issue
Block a user