From 0ccea3bed915c1c02f39081e337271f0561112bc Mon Sep 17 00:00:00 2001 From: David Kocik Date: Wed, 15 Feb 2023 16:47:16 +0100 Subject: [PATCH] Archive dialog - size of left column --- src/slic3r/GUI/FileArchiveDialog.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/FileArchiveDialog.cpp b/src/slic3r/GUI/FileArchiveDialog.cpp index e26e152c59..7337258cb9 100644 --- a/src/slic3r/GUI/FileArchiveDialog.cpp +++ b/src/slic3r/GUI/FileArchiveDialog.cpp @@ -182,8 +182,8 @@ FileArchiveDialog::FileArchiveDialog(wxWindow* parent_window, mz_zip_archive* ar wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL); - m_avc = new ArchiveViewCtrl(this, wxSize(60 * em, 30 * em)); - m_avc->AppendToggleColumn(L"\u2714", 0, wxDATAVIEW_CELL_ACTIVATABLE, 6 * em); + m_avc = new ArchiveViewCtrl(this, wxSize(45 * em, 30 * em)); + wxDataViewColumn* toggle_column = m_avc->AppendToggleColumn(L"\u2714", 0, wxDATAVIEW_CELL_ACTIVATABLE, 6 * em); m_avc->AppendTextColumn("filename", 1); std::vector> stack; @@ -238,11 +238,12 @@ FileArchiveDialog::FileArchiveDialog(wxWindow* parent_window, mz_zip_archive* ar // sorting files will help adjust_stack function to not create multiple same folders std::sort(filtered_entries.begin(), filtered_entries.end(), [](const boost::filesystem::path& p1, const boost::filesystem::path& p2){ return p1.string() > p2.string(); }); size_t entry_count = 0; + size_t depth = 1; for (const boost::filesystem::path& path : filtered_entries) { std::shared_ptr parent(nullptr); - adjust_stack(path, stack); + depth = std::max(depth, adjust_stack(path, stack)); if (!stack.empty()) parent = stack.back(); if (std::regex_match(path.extension().string(), pattern_drop)) { // this leaves out non-compatible files @@ -253,6 +254,8 @@ FileArchiveDialog::FileArchiveDialog(wxWindow* parent_window, mz_zip_archive* ar if (entry_count == 1) on_all_button(); + toggle_column->SetWidth((4 + depth) * em); + wxBoxSizer* btn_sizer = new wxBoxSizer(wxHORIZONTAL); wxButton* btn_all = new wxButton(this, wxID_ANY, _L("All"));