mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 01:15:55 +08:00
Remove debug buttons
move use surface into advance
This commit is contained in:
parent
dbae2f6305
commit
a8b283bcf7
@ -54,13 +54,13 @@
|
|||||||
#define ALLOW_REVERT_ALL_STYLES
|
#define ALLOW_REVERT_ALL_STYLES
|
||||||
#endif // ALLOW_DEBUG_MODE
|
#endif // ALLOW_DEBUG_MODE
|
||||||
|
|
||||||
#define SHOW_WX_FONT_DESCRIPTOR
|
//#define SHOW_WX_FONT_DESCRIPTOR
|
||||||
#define SHOW_FONT_FILE_PROPERTY
|
//#define SHOW_FONT_FILE_PROPERTY
|
||||||
#define SHOW_FONT_COUNT
|
//#define SHOW_FONT_COUNT
|
||||||
#define SHOW_CONTAIN_3MF_FIX
|
#define SHOW_CONTAIN_3MF_FIX
|
||||||
#define ALLOW_ADD_FONT_BY_FILE
|
//#define ALLOW_ADD_FONT_BY_FILE
|
||||||
#define ALLOW_ADD_FONT_BY_OS_SELECTOR
|
//#define ALLOW_ADD_FONT_BY_OS_SELECTOR
|
||||||
#define ALLOW_REVERT_ALL_STYLES
|
//#define ALLOW_REVERT_ALL_STYLES
|
||||||
|
|
||||||
using namespace Slic3r;
|
using namespace Slic3r;
|
||||||
using namespace Slic3r::GUI;
|
using namespace Slic3r::GUI;
|
||||||
@ -646,16 +646,15 @@ void GLGizmoEmboss::initialize()
|
|||||||
tr.font = _u8L("Font");
|
tr.font = _u8L("Font");
|
||||||
tr.size = _u8L("Height");
|
tr.size = _u8L("Height");
|
||||||
tr.depth = _u8L("Depth");
|
tr.depth = _u8L("Depth");
|
||||||
tr.use_surface = _u8L("Use surface");
|
float max_edit_text_width = std::max({
|
||||||
float max_edit_text_width = std::max(
|
ImGui::CalcTextSize(tr.font.c_str()).x,
|
||||||
{ImGui::CalcTextSize(tr.font.c_str()).x,
|
ImGui::CalcTextSize(tr.size.c_str()).x,
|
||||||
ImGui::CalcTextSize(tr.size.c_str()).x,
|
ImGui::CalcTextSize(tr.depth.c_str()).x });
|
||||||
ImGui::CalcTextSize(tr.depth.c_str()).x,
|
|
||||||
ImGui::CalcTextSize(tr.use_surface.c_str()).x });
|
|
||||||
cfg.edit_input_offset =
|
cfg.edit_input_offset =
|
||||||
3 * space + ImGui::GetTreeNodeToLabelSpacing() +
|
3 * space + ImGui::GetTreeNodeToLabelSpacing() +
|
||||||
max_edit_text_width;
|
max_edit_text_width;
|
||||||
|
|
||||||
|
tr.use_surface = _u8L("Use surface");
|
||||||
tr.char_gap = _u8L("Char gap");
|
tr.char_gap = _u8L("Char gap");
|
||||||
tr.line_gap = _u8L("Line gap");
|
tr.line_gap = _u8L("Line gap");
|
||||||
tr.boldness = _u8L("Boldness");
|
tr.boldness = _u8L("Boldness");
|
||||||
@ -663,14 +662,15 @@ void GLGizmoEmboss::initialize()
|
|||||||
tr.surface_distance = _u8L("Z-move");
|
tr.surface_distance = _u8L("Z-move");
|
||||||
tr.angle = _u8L("Z-rot");
|
tr.angle = _u8L("Z-rot");
|
||||||
tr.collection = _u8L("Collection");
|
tr.collection = _u8L("Collection");
|
||||||
float max_advanced_text_width = std::max(
|
float max_advanced_text_width = std::max({
|
||||||
{ImGui::CalcTextSize(tr.char_gap.c_str()).x,
|
ImGui::CalcTextSize(tr.use_surface.c_str()).x,
|
||||||
ImGui::CalcTextSize(tr.line_gap.c_str()).x,
|
ImGui::CalcTextSize(tr.char_gap.c_str()).x,
|
||||||
ImGui::CalcTextSize(tr.boldness.c_str()).x,
|
ImGui::CalcTextSize(tr.line_gap.c_str()).x,
|
||||||
ImGui::CalcTextSize(tr.italic.c_str()).x,
|
ImGui::CalcTextSize(tr.boldness.c_str()).x,
|
||||||
ImGui::CalcTextSize(tr.surface_distance.c_str()).x,
|
ImGui::CalcTextSize(tr.italic.c_str()).x,
|
||||||
ImGui::CalcTextSize(tr.angle.c_str()).x,
|
ImGui::CalcTextSize(tr.surface_distance.c_str()).x,
|
||||||
ImGui::CalcTextSize(tr.collection.c_str()).x });
|
ImGui::CalcTextSize(tr.angle.c_str()).x,
|
||||||
|
ImGui::CalcTextSize(tr.collection.c_str()).x });
|
||||||
cfg.advanced_input_offset =
|
cfg.advanced_input_offset =
|
||||||
3 * space + 2* ImGui::GetTreeNodeToLabelSpacing() + max_advanced_text_width;
|
3 * space + 2* ImGui::GetTreeNodeToLabelSpacing() + max_advanced_text_width;
|
||||||
|
|
||||||
@ -688,13 +688,13 @@ void GLGizmoEmboss::initialize()
|
|||||||
float window_width = cfg.style_combobox_width + style.WindowPadding.x * 2;
|
float window_width = cfg.style_combobox_width + style.WindowPadding.x * 2;
|
||||||
cfg.minimal_window_size = ImVec2(window_width, window_height);
|
cfg.minimal_window_size = ImVec2(window_width, window_height);
|
||||||
|
|
||||||
float addition_edit_height = input_height * 4 + tree_header;
|
float addition_edit_height = input_height * 3 + tree_header;
|
||||||
cfg.minimal_window_size_with_edit = ImVec2(cfg.minimal_window_size.x,
|
cfg.minimal_window_size_with_edit = ImVec2(cfg.minimal_window_size.x,
|
||||||
cfg.minimal_window_size.y +
|
cfg.minimal_window_size.y +
|
||||||
addition_edit_height);
|
addition_edit_height);
|
||||||
// 6 = charGap, LineGap, Bold, italic, surfDist, angle
|
// 6 = charGap, LineGap, Bold, italic, surfDist, angle
|
||||||
// 4 = 1px for fix each edit image of drag float
|
// 4 = 1px for fix each edit image of drag float
|
||||||
float advance_height = input_height * 6 + 8;
|
float advance_height = input_height * 7 + 8;
|
||||||
cfg.minimal_window_size_with_advance =
|
cfg.minimal_window_size_with_advance =
|
||||||
ImVec2(cfg.minimal_window_size_with_edit.x,
|
ImVec2(cfg.minimal_window_size_with_edit.x,
|
||||||
cfg.minimal_window_size_with_edit.y + advance_height);
|
cfg.minimal_window_size_with_edit.y + advance_height);
|
||||||
@ -1786,8 +1786,7 @@ bool GLGizmoEmboss::rev_checkbox(const std::string &name,
|
|||||||
{
|
{
|
||||||
// draw offseted input
|
// draw offseted input
|
||||||
auto draw_offseted_input = [&]() -> bool {
|
auto draw_offseted_input = [&]() -> bool {
|
||||||
float input_offset = m_gui_cfg->edit_input_offset;
|
ImGui::SameLine(m_gui_cfg->advanced_input_offset);
|
||||||
ImGui::SameLine(input_offset);
|
|
||||||
return ImGui::Checkbox(("##" + name).c_str(), &value);
|
return ImGui::Checkbox(("##" + name).c_str(), &value);
|
||||||
};
|
};
|
||||||
float undo_offset = ImGui::GetStyle().FramePadding.x;
|
float undo_offset = ImGui::GetStyle().FramePadding.x;
|
||||||
@ -1898,18 +1897,6 @@ void GLGizmoEmboss::draw_style_edit() {
|
|||||||
process();
|
process();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool *def_use_surface = m_stored_font_item.has_value() ?
|
|
||||||
&m_stored_font_item->prop.use_surface : nullptr;
|
|
||||||
if (rev_checkbox(tr.use_surface, font_prop.use_surface, def_use_surface,
|
|
||||||
_u8L("Revert using of model surface."))) {
|
|
||||||
if (font_prop.use_surface) {
|
|
||||||
font_prop.distance.reset();
|
|
||||||
if (font_prop.emboss < 0.1)
|
|
||||||
font_prop.emboss = 1;
|
|
||||||
}
|
|
||||||
process();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui::TreeNode(_u8L("advanced").c_str())) {
|
if (ImGui::TreeNode(_u8L("advanced").c_str())) {
|
||||||
if (!m_is_advanced_edit_style) {
|
if (!m_is_advanced_edit_style) {
|
||||||
set_minimal_window_size(true, true);
|
set_minimal_window_size(true, true);
|
||||||
@ -2058,9 +2045,21 @@ void GLGizmoEmboss::draw_advanced()
|
|||||||
m_imgui->text_colored(ImGuiWrapper::COL_GREY_DARK, ff_property);
|
m_imgui->text_colored(ImGuiWrapper::COL_GREY_DARK, ff_property);
|
||||||
#endif // SHOW_FONT_FILE_PROPERTY
|
#endif // SHOW_FONT_FILE_PROPERTY
|
||||||
|
|
||||||
bool exist_change = false;
|
bool exist_change = false;
|
||||||
|
|
||||||
auto &tr = m_gui_cfg->translations;
|
auto &tr = m_gui_cfg->translations;
|
||||||
|
|
||||||
|
bool *def_use_surface = m_stored_font_item.has_value() ?
|
||||||
|
&m_stored_font_item->prop.use_surface : nullptr;
|
||||||
|
if (rev_checkbox(tr.use_surface, font_prop.use_surface, def_use_surface,
|
||||||
|
_u8L("Revert using of model surface."))) {
|
||||||
|
if (font_prop.use_surface) {
|
||||||
|
font_prop.distance.reset();
|
||||||
|
if (font_prop.emboss < 0.1)
|
||||||
|
font_prop.emboss = 1;
|
||||||
|
}
|
||||||
|
process();
|
||||||
|
}
|
||||||
|
|
||||||
std::string units = _u8L("font points");
|
std::string units = _u8L("font points");
|
||||||
std::string units_fmt = "%.0f " + units;
|
std::string units_fmt = "%.0f " + units;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user