mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 21:05:52 +08:00
Fix typo 'activ_font' to 'active_font'
This commit is contained in:
parent
3c961f3816
commit
9d1204d6f5
@ -315,8 +315,8 @@ bool GLGizmoEmboss::on_mouse_for_rotation(const wxMouseEvent &mouse_event)
|
|||||||
angle_opt.reset();
|
angle_opt.reset();
|
||||||
|
|
||||||
// set into activ style
|
// set into activ style
|
||||||
assert(m_style_manager.is_activ_font());
|
assert(m_style_manager.is_active_font());
|
||||||
if (m_style_manager.is_activ_font())
|
if (m_style_manager.is_active_font())
|
||||||
m_style_manager.get_font_prop().angle = angle_opt;
|
m_style_manager.get_font_prop().angle = angle_opt;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1042,7 +1042,7 @@ bool GLGizmoEmboss::process()
|
|||||||
if (m_text.empty()) return false;
|
if (m_text.empty()) return false;
|
||||||
|
|
||||||
// exist loaded font file?
|
// exist loaded font file?
|
||||||
if (!m_style_manager.is_activ_font()) return false;
|
if (!m_style_manager.is_active_font()) return false;
|
||||||
|
|
||||||
// Cancel previous Job, when it is in process
|
// Cancel previous Job, when it is in process
|
||||||
// Can't use cancel, because I want cancel only previous EmbossUpdateJob no other jobs
|
// Can't use cancel, because I want cancel only previous EmbossUpdateJob no other jobs
|
||||||
@ -1145,8 +1145,8 @@ void GLGizmoEmboss::draw_window()
|
|||||||
if (ImGui::Button("add svg")) choose_svg_file();
|
if (ImGui::Button("add svg")) choose_svg_file();
|
||||||
#endif // ALLOW_DEBUG_MODE
|
#endif // ALLOW_DEBUG_MODE
|
||||||
|
|
||||||
bool is_activ_font = m_style_manager.is_activ_font();
|
bool is_active_font = m_style_manager.is_active_font();
|
||||||
if (!is_activ_font)
|
if (!is_active_font)
|
||||||
m_imgui->text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, _L("Warning: No font is selected. Select correct one."));
|
m_imgui->text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, _L("Warning: No font is selected. Select correct one."));
|
||||||
|
|
||||||
// Disable all except selection of font, when open text from 3mf with unknown font
|
// Disable all except selection of font, when open text from 3mf with unknown font
|
||||||
@ -1158,7 +1158,7 @@ void GLGizmoEmboss::draw_window()
|
|||||||
draw_text_input();
|
draw_text_input();
|
||||||
draw_model_type();
|
draw_model_type();
|
||||||
draw_style_list();
|
draw_style_list();
|
||||||
m_imgui->disabled_begin(!is_activ_font);
|
m_imgui->disabled_begin(!is_active_font);
|
||||||
ImGui::TreePush();
|
ImGui::TreePush();
|
||||||
draw_style_edit();
|
draw_style_edit();
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
@ -1176,7 +1176,7 @@ void GLGizmoEmboss::draw_window()
|
|||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
} else if (m_is_advanced_edit_style)
|
} else if (m_is_advanced_edit_style)
|
||||||
set_minimal_window_size(false);
|
set_minimal_window_size(false);
|
||||||
m_imgui->disabled_end(); // !is_activ_font
|
m_imgui->disabled_end(); // !is_active_font
|
||||||
|
|
||||||
#ifdef SHOW_WX_FONT_DESCRIPTOR
|
#ifdef SHOW_WX_FONT_DESCRIPTOR
|
||||||
if (is_selected_style)
|
if (is_selected_style)
|
||||||
@ -1655,7 +1655,7 @@ void GLGizmoEmboss::draw_font_list()
|
|||||||
{
|
{
|
||||||
// Set partial
|
// Set partial
|
||||||
wxString actual_face_name;
|
wxString actual_face_name;
|
||||||
if (m_style_manager.is_activ_font()) {
|
if (m_style_manager.is_active_font()) {
|
||||||
const std::optional<wxFont> &wx_font_opt = m_style_manager.get_wx_font();
|
const std::optional<wxFont> &wx_font_opt = m_style_manager.get_wx_font();
|
||||||
if (wx_font_opt.has_value())
|
if (wx_font_opt.has_value())
|
||||||
actual_face_name = wx_font_opt->GetFaceName();
|
actual_face_name = wx_font_opt->GetFaceName();
|
||||||
@ -2088,7 +2088,7 @@ void GLGizmoEmboss::fix_transformation(const FontProp &from,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GLGizmoEmboss::draw_style_list() {
|
void GLGizmoEmboss::draw_style_list() {
|
||||||
if (!m_style_manager.is_activ_font()) return;
|
if (!m_style_manager.is_active_font()) return;
|
||||||
|
|
||||||
const EmbossStyle *stored_style = nullptr;
|
const EmbossStyle *stored_style = nullptr;
|
||||||
bool is_stored = m_style_manager.exist_stored_style();
|
bool is_stored = m_style_manager.exist_stored_style();
|
||||||
@ -3255,7 +3255,7 @@ DataBase priv::create_emboss_data_base(const std::string &text, StyleManager& st
|
|||||||
};
|
};
|
||||||
|
|
||||||
auto create_configuration = [&]() -> TextConfiguration {
|
auto create_configuration = [&]() -> TextConfiguration {
|
||||||
if (!style_manager.is_activ_font()) {
|
if (!style_manager.is_active_font()) {
|
||||||
std::string default_text_for_emboss = _u8L("Embossed text");
|
std::string default_text_for_emboss = _u8L("Embossed text");
|
||||||
EmbossStyle es = style_manager.get_style();
|
EmbossStyle es = style_manager.get_style();
|
||||||
TextConfiguration tc{es, default_text_for_emboss};
|
TextConfiguration tc{es, default_text_for_emboss};
|
||||||
|
@ -200,7 +200,7 @@ bool StyleManager::load_style(const EmbossStyle &style, const wxFont &font)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StyleManager::is_activ_font() { return m_style_cache.font_file.has_value(); }
|
bool StyleManager::is_active_font() { return m_style_cache.font_file.has_value(); }
|
||||||
|
|
||||||
bool StyleManager::load_first_valid_font() {
|
bool StyleManager::load_first_valid_font() {
|
||||||
while (!m_style_items.empty()) {
|
while (!m_style_items.empty()) {
|
||||||
@ -228,7 +228,7 @@ void StyleManager::clear_imgui_font() { m_style_cache.atlas.Clear(); }
|
|||||||
|
|
||||||
ImFont *StyleManager::get_imgui_font()
|
ImFont *StyleManager::get_imgui_font()
|
||||||
{
|
{
|
||||||
if (!is_activ_font()) return nullptr;
|
if (!is_active_font()) return nullptr;
|
||||||
|
|
||||||
ImVector<ImFont *> &fonts = m_style_cache.atlas.Fonts;
|
ImVector<ImFont *> &fonts = m_style_cache.atlas.Fonts;
|
||||||
if (fonts.empty()) return nullptr;
|
if (fonts.empty()) return nullptr;
|
||||||
|
@ -185,7 +185,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// check if exist selected font style in manager
|
// check if exist selected font style in manager
|
||||||
bool is_activ_font();
|
bool is_active_font();
|
||||||
|
|
||||||
// Limits for imgui loaded font size
|
// Limits for imgui loaded font size
|
||||||
// Value out of limits is crop
|
// Value out of limits is crop
|
||||||
|
@ -19,7 +19,7 @@ const std::string EmbossStylesSerializable::APP_CONFIG_FONT_COLLECTION = "colle
|
|||||||
const std::string EmbossStylesSerializable::APP_CONFIG_FONT_CHAR_GAP = "char_gap";
|
const std::string EmbossStylesSerializable::APP_CONFIG_FONT_CHAR_GAP = "char_gap";
|
||||||
const std::string EmbossStylesSerializable::APP_CONFIG_FONT_LINE_GAP = "line_gap";
|
const std::string EmbossStylesSerializable::APP_CONFIG_FONT_LINE_GAP = "line_gap";
|
||||||
|
|
||||||
const std::string EmbossStylesSerializable::APP_CONFIG_ACTIVE_FONT = "activ_font";
|
const std::string EmbossStylesSerializable::APP_CONFIG_ACTIVE_FONT = "active_font";
|
||||||
|
|
||||||
std::string EmbossStylesSerializable::create_section_name(unsigned index)
|
std::string EmbossStylesSerializable::create_section_name(unsigned index)
|
||||||
{
|
{
|
||||||
@ -150,8 +150,8 @@ void EmbossStylesSerializable::store_style_index(AppConfig &cfg, unsigned index)
|
|||||||
// store actual font index
|
// store actual font index
|
||||||
cfg.clear_section(AppConfig::SECTION_EMBOSS_STYLE);
|
cfg.clear_section(AppConfig::SECTION_EMBOSS_STYLE);
|
||||||
// activ font first index is +1 to correspond with section name
|
// activ font first index is +1 to correspond with section name
|
||||||
std::string activ_font = std::to_string(index);
|
std::string active_font = std::to_string(index);
|
||||||
cfg.set(AppConfig::SECTION_EMBOSS_STYLE, APP_CONFIG_ACTIVE_FONT, activ_font);
|
cfg.set(AppConfig::SECTION_EMBOSS_STYLE, APP_CONFIG_ACTIVE_FONT, active_font);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<size_t> EmbossStylesSerializable::load_style_index(const AppConfig &cfg)
|
std::optional<size_t> EmbossStylesSerializable::load_style_index(const AppConfig &cfg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user