Merge branch 'add_kinematics' of https://github.com/prusa3d/Slic3r into time_estimate

This commit is contained in:
Enrico Turri 2018-06-22 12:57:16 +02:00
commit 00ef0610a5
12 changed files with 256 additions and 51 deletions

View file

@ -56,6 +56,7 @@
#include "../Utils/PresetUpdater.hpp"
#include "../Config/Snapshot.hpp"
#include "3DScene.hpp"
#include "libslic3r/I18N.hpp"
namespace Slic3r { namespace GUI {
@ -109,6 +110,7 @@ wxNotebook *g_wxTabPanel = nullptr;
AppConfig *g_AppConfig = nullptr;
PresetBundle *g_PresetBundle= nullptr;
PresetUpdater *g_PresetUpdater = nullptr;
_3DScene *g_3DScene = nullptr;
wxColour g_color_label_modified;
wxColour g_color_label_sys;
wxColour g_color_label_default;
@ -117,6 +119,9 @@ std::vector<Tab *> g_tabs_list;
wxLocale* g_wxLocale;
wxFont g_small_font;
wxFont g_bold_font;
std::shared_ptr<ConfigOptionsGroup> m_optgroup;
double m_brim_width = 0.0;
wxButton* g_wiping_dialog_button = nullptr;
@ -149,6 +154,16 @@ void update_label_colours_from_appconfig()
}
}
static void init_fonts()
{
g_small_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
g_bold_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Bold();
#ifdef __WXMAC__
g_small_font.SetPointSize(11);
g_bold_font.SetPointSize(13);
#endif /*__WXMAC__*/
}
static std::string libslic3r_translate_callback(const char *s) { return wxGetTranslation(wxString(s, wxConvUTF8)).utf8_str().data(); }
void set_wxapp(wxApp *app)
@ -157,6 +172,7 @@ void set_wxapp(wxApp *app)
// Let the libslic3r know the callback, which will translate messages on demand.
Slic3r::I18N::set_translate_callback(libslic3r_translate_callback);
init_label_colours();
init_fonts();
}
void set_main_frame(wxFrame *main_frame)
@ -184,6 +200,11 @@ void set_preset_updater(PresetUpdater *updater)
g_PresetUpdater = updater;
}
void set_3DScene(_3DScene *scene)
{
g_3DScene = scene;
}
std::vector<Tab *>& get_tabs_list()
{
return g_tabs_list;
@ -382,6 +403,7 @@ void add_config_menu(wxMenuBar *menu, int event_preferences_changed, int event_l
save_language();
show_info(g_wxTabPanel, _(L("Application will be restarted")), _(L("Attention!")));
if (event_language_change > 0) {
g_3DScene->remove_all_canvases();// remove all canvas before recreate GUI
wxCommandEvent event(event_language_change);
g_wxApp->ProcessEvent(event);
}
@ -672,6 +694,14 @@ void set_label_clr_sys(const wxColour& clr) {
g_AppConfig->save();
}
const wxFont& small_font(){
return g_small_font;
}
const wxFont& bold_font(){
return g_bold_font;
}
const wxColour& get_label_clr_default() {
return g_color_label_default;
}