mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 11:35:56 +08:00
GizmoEmboss: Fixed localization
+ Deleted redundant separator from TextVolume context menu
This commit is contained in:
parent
1627e30aaf
commit
ea8ce87caa
@ -1034,7 +1034,7 @@ void MenuFactory::create_text_part_menu()
|
|||||||
append_menu_item_edit_text(menu);
|
append_menu_item_edit_text(menu);
|
||||||
menu->AppendSeparator();
|
menu->AppendSeparator();
|
||||||
append_menu_item_delete(menu);
|
append_menu_item_delete(menu);
|
||||||
menu->AppendSeparator();
|
// menu->AppendSeparator();
|
||||||
|
|
||||||
append_immutable_part_menu_items(menu);
|
append_immutable_part_menu_items(menu);
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ bool GLGizmoEmboss::on_init()
|
|||||||
|
|
||||||
std::string GLGizmoEmboss::on_get_name() const
|
std::string GLGizmoEmboss::on_get_name() const
|
||||||
{
|
{
|
||||||
return (_L("Emboss")).ToUTF8().data();
|
return _u8L("Emboss");
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLGizmoEmboss::on_render() {}
|
void GLGizmoEmboss::on_render() {}
|
||||||
@ -500,22 +500,22 @@ void GLGizmoEmboss::draw_window()
|
|||||||
#endif // ALLOW_DEBUG_MODE
|
#endif // ALLOW_DEBUG_MODE
|
||||||
|
|
||||||
if (!m_font.has_value()) {
|
if (!m_font.has_value()) {
|
||||||
ImGui::Text(_L("Warning: No font is selected. Select correct one.").c_str());
|
ImGui::Text(_u8L("Warning: No font is selected. Select correct one.").c_str());
|
||||||
}
|
}
|
||||||
draw_font_list();
|
draw_font_list();
|
||||||
draw_text_input();
|
draw_text_input();
|
||||||
|
|
||||||
static bool advanced = false;
|
static bool advanced = false;
|
||||||
ImGui::Checkbox(_L("Advance").c_str(), &advanced);
|
ImGui::Checkbox(_u8L("Advance").c_str(), &advanced);
|
||||||
if (advanced) draw_advanced();
|
if (advanced) draw_advanced();
|
||||||
|
|
||||||
if (ImGui::Button(_L("Close").c_str())) close();
|
if (ImGui::Button(_u8L("Close").c_str())) close();
|
||||||
|
|
||||||
// Option to create text volume when reselecting volumes
|
// Option to create text volume when reselecting volumes
|
||||||
m_imgui->disabled_begin(!m_font.has_value());
|
m_imgui->disabled_begin(!m_font.has_value());
|
||||||
if (m_volume == nullptr) {
|
if (m_volume == nullptr) {
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(_L("Generate preview").c_str())) process();
|
if (ImGui::Button(_u8L("Generate preview").c_str())) process();
|
||||||
}
|
}
|
||||||
m_imgui->disabled_end();
|
m_imgui->disabled_end();
|
||||||
}
|
}
|
||||||
@ -529,18 +529,18 @@ void GLGizmoEmboss::draw_font_list()
|
|||||||
if (ImGui::BeginCombo("##font_selector", current_name.c_str())) {
|
if (ImGui::BeginCombo("##font_selector", current_name.c_str())) {
|
||||||
// first line
|
// first line
|
||||||
#ifdef USE_FONT_DIALOG
|
#ifdef USE_FONT_DIALOG
|
||||||
if (ImGui::Button(_L("Choose font").c_str())) {
|
if (ImGui::Button(_u8L("Choose font").c_str())) {
|
||||||
choose_font_by_wxdialog();
|
choose_font_by_wxdialog();
|
||||||
store_font_list();
|
store_font_list();
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
} else if (ImGui::IsItemHovered()) ImGui::SetTooltip(_L("Choose from installed font in dialog.").c_str());
|
} else if (ImGui::IsItemHovered()) ImGui::SetTooltip(_u8L("Choose from installed font in dialog.").c_str());
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
#endif // USE_FONT_DIALOG
|
#endif // USE_FONT_DIALOG
|
||||||
if (ImGui::Button(_L("Add File").c_str())) {
|
if (ImGui::Button(_u8L("Add File").c_str())) {
|
||||||
choose_true_type_file();
|
choose_true_type_file();
|
||||||
store_font_list();
|
store_font_list();
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
} else if (ImGui::IsItemHovered()) ImGui::SetTooltip(_L("add file with font(.ttf, .ttc)").c_str());
|
} else if (ImGui::IsItemHovered()) ImGui::SetTooltip(_u8L("add file with font(.ttf, .ttc)").c_str());
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
@ -626,24 +626,24 @@ void GLGizmoEmboss::draw_text_input()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GLGizmoEmboss::draw_advanced() {
|
void GLGizmoEmboss::draw_advanced() {
|
||||||
if (ImGui::InputFloat(_L("Size[in mm]").c_str(), &m_font_prop.size_in_mm)) {
|
if (ImGui::InputFloat(_u8L("Size[in mm]").c_str(), &m_font_prop.size_in_mm)) {
|
||||||
if (m_font_prop.size_in_mm < 0.1) m_font_prop.size_in_mm = 10;
|
if (m_font_prop.size_in_mm < 0.1) m_font_prop.size_in_mm = 10;
|
||||||
load_imgui_font();
|
load_imgui_font();
|
||||||
process();
|
process();
|
||||||
}
|
}
|
||||||
if (ImGui::InputFloat(_L("Emboss[in mm]").c_str(), &m_font_prop.emboss)) process();
|
if (ImGui::InputFloat(_u8L("Emboss[in mm]").c_str(), &m_font_prop.emboss)) process();
|
||||||
if (ImGui::InputFloat(_L("Flatness").c_str(), &m_font_prop.flatness)) {
|
if (ImGui::InputFloat(_u8L("Flatness").c_str(), &m_font_prop.flatness)) {
|
||||||
if (m_font.has_value()) m_font->cache.clear();
|
if (m_font.has_value()) m_font->cache.clear();
|
||||||
process();
|
process();
|
||||||
}
|
}
|
||||||
if (ImGui::InputInt(_L("CharGap[in font points]").c_str(), &m_font_prop.char_gap))
|
if (ImGui::InputInt(_u8L("CharGap[in font points]").c_str(), &m_font_prop.char_gap))
|
||||||
process();
|
process();
|
||||||
if (ImGui::InputInt(_L("LineGap[in font points]").c_str(), &m_font_prop.line_gap))
|
if (ImGui::InputInt(_u8L("LineGap[in font points]").c_str(), &m_font_prop.line_gap))
|
||||||
process();
|
process();
|
||||||
|
|
||||||
// when more collection add selector
|
// when more collection add selector
|
||||||
if (m_font.has_value() && m_font->count > 1) {
|
if (m_font.has_value() && m_font->count > 1) {
|
||||||
if (ImGui::BeginCombo(_L("Font collection").c_str(),
|
if (ImGui::BeginCombo(_u8L("Font collection").c_str(),
|
||||||
std::to_string(m_font->index).c_str())) {
|
std::to_string(m_font->index).c_str())) {
|
||||||
for (unsigned int i = 0; i < m_font->count; ++i) {
|
for (unsigned int i = 0; i < m_font->count; ++i) {
|
||||||
ImGui::PushID(1 << 10 + i);
|
ImGui::PushID(1 << 10 + i);
|
||||||
@ -1102,7 +1102,7 @@ bool GLGizmoEmboss::draw_button(IconType icon, bool disable)
|
|||||||
if (disable) {
|
if (disable) {
|
||||||
draw_icon(icon, IconState::disabled);
|
draw_icon(icon, IconState::disabled);
|
||||||
if (ImGui::IsItemHovered() && icon == IconType::erase)
|
if (ImGui::IsItemHovered() && icon == IconType::erase)
|
||||||
ImGui::SetTooltip(_L("Active font can't be removed").c_str());
|
ImGui::SetTooltip(_u8L("Active font can't be removed").c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1112,8 +1112,8 @@ bool GLGizmoEmboss::draw_button(IconType icon, bool disable)
|
|||||||
if (ImGui::IsItemClicked()) return true;
|
if (ImGui::IsItemClicked()) return true;
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
switch (icon) {
|
switch (icon) {
|
||||||
case IconType::rename: ImGui::SetTooltip(_L("rename").c_str()); break;
|
case IconType::rename: ImGui::SetTooltip(_u8L("rename").c_str()); break;
|
||||||
case IconType::erase: ImGui::SetTooltip(_L("delete").c_str()); break;
|
case IconType::erase: ImGui::SetTooltip(_u8L("delete").c_str()); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
// redraw image over previous
|
// redraw image over previous
|
||||||
|
Loading…
x
Reference in New Issue
Block a user