From 6667852d928fbb64d1660c0b3eb464cf0ab093d8 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 2 Feb 2022 12:42:51 +0100 Subject: [PATCH] DiffPresetsDialog: Added info line for truncated option values. Related to #7852 - Compare Filament Dialog: Values are truncated --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 002287ded..ef1a025af 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -656,6 +656,7 @@ void DiffViewCtrl::Clear() { model->Clear(); m_items_map.clear(); + m_has_long_strings = false; } wxString DiffViewCtrl::get_short_string(wxString full_string) @@ -1523,8 +1524,8 @@ DiffPresetDialog::DiffPresetDialog(MainFrame* mainframe) topSizer->Add(m_top_info_line, 0, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, 2 * border); topSizer->Add(presets_sizer, 0, wxEXPAND | wxLEFT | wxTOP | wxRIGHT, border); topSizer->Add(m_show_all_presets, 0, wxEXPAND | wxALL, border); - topSizer->Add(m_bottom_info_line, 0, wxEXPAND | wxALL, 2 * border); topSizer->Add(m_tree, 1, wxEXPAND | wxALL, border); + topSizer->Add(m_bottom_info_line, 0, wxEXPAND | wxALL, 2 * border); this->SetMinSize(wxSize(80 * em, 30 * em)); this->SetSizer(topSizer); @@ -1689,12 +1690,17 @@ void DiffPresetDialog::update_tree() left_val, right_val, category_icon_map.at(option.category)); } } + + if (m_tree->has_long_strings()) + bottom_info = _L("Some fields are too long to fit. Right mouse click reveals the full text."); bool tree_was_shown = m_tree->IsShown(); m_tree->Show(show_tree); - if (!show_tree) + + bool show_bottom_info = !show_tree || m_tree->has_long_strings(); + if (show_bottom_info) m_bottom_info_line->SetLabel(bottom_info); - m_bottom_info_line->Show(!show_tree); + m_bottom_info_line->Show(show_bottom_info); if (tree_was_shown == m_tree->IsShown()) Layout();