mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Fix for #6903 - Compare presets window titles inaccurate...
This commit is contained in:
parent
771a892776
commit
af20419ed4
2 changed files with 13 additions and 6 deletions
|
@ -696,7 +696,12 @@ void DiffViewCtrl::context_menu(wxDataViewEvent& event)
|
||||||
auto it = m_items_map.find(item);
|
auto it = m_items_map.find(item);
|
||||||
if (it == m_items_map.end() || !it->second.is_long)
|
if (it == m_items_map.end() || !it->second.is_long)
|
||||||
return;
|
return;
|
||||||
FullCompareDialog(it->second.opt_name, it->second.old_val, it->second.new_val).ShowModal();
|
|
||||||
|
size_t column_cnt = this->GetColumnCount();
|
||||||
|
const wxString old_value_header = this->GetColumn(column_cnt - 2)->GetTitle();
|
||||||
|
const wxString new_value_header = this->GetColumn(column_cnt - 1)->GetTitle();
|
||||||
|
FullCompareDialog(it->second.opt_name, it->second.old_val, it->second.new_val,
|
||||||
|
old_value_header, new_value_header).ShowModal();
|
||||||
|
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
wxWindow* parent = this->GetParent();
|
wxWindow* parent = this->GetParent();
|
||||||
|
@ -1281,7 +1286,8 @@ void UnsavedChangesDialog::on_sys_color_changed()
|
||||||
// FullCompareDialog
|
// FullCompareDialog
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
|
|
||||||
FullCompareDialog::FullCompareDialog(const wxString& option_name, const wxString& old_value, const wxString& new_value)
|
FullCompareDialog::FullCompareDialog(const wxString& option_name, const wxString& old_value, const wxString& new_value,
|
||||||
|
const wxString& old_value_header, const wxString& new_value_header)
|
||||||
: wxDialog(nullptr, wxID_ANY, option_name, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
: wxDialog(nullptr, wxID_ANY, option_name, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||||
{
|
{
|
||||||
wxGetApp().UpdateDarkUI(this);
|
wxGetApp().UpdateDarkUI(this);
|
||||||
|
@ -1302,8 +1308,8 @@ FullCompareDialog::FullCompareDialog(const wxString& option_name, const wxString
|
||||||
grid_sizer->Add(text, 0, wxALL, border);
|
grid_sizer->Add(text, 0, wxALL, border);
|
||||||
};
|
};
|
||||||
|
|
||||||
add_header(_L("Old value"));
|
add_header(old_value_header);
|
||||||
add_header(_L("New value"));
|
add_header(new_value_header);
|
||||||
|
|
||||||
auto get_set_from_val = [](wxString str) {
|
auto get_set_from_val = [](wxString str) {
|
||||||
if (str.Find("\n") == wxNOT_FOUND)
|
if (str.Find("\n") == wxNOT_FOUND)
|
||||||
|
@ -1327,7 +1333,7 @@ FullCompareDialog::FullCompareDialog(const wxString& option_name, const wxString
|
||||||
std::set_difference(new_set.begin(), new_set.end(), old_set.begin(), old_set.end(), std::inserter(new_old_diff_set, new_old_diff_set.begin()));
|
std::set_difference(new_set.begin(), new_set.end(), old_set.begin(), old_set.end(), std::inserter(new_old_diff_set, new_old_diff_set.begin()));
|
||||||
|
|
||||||
auto add_value = [grid_sizer, border, this](wxString label, const std::set<wxString>& diff_set, bool is_colored = false) {
|
auto add_value = [grid_sizer, border, this](wxString label, const std::set<wxString>& diff_set, bool is_colored = false) {
|
||||||
wxTextCtrl* text = new wxTextCtrl(this, wxID_ANY, label, wxDefaultPosition, wxSize(400, 400), wxTE_MULTILINE | wxTE_READONLY | wxBORDER_SIMPLE | wxTE_RICH);
|
wxTextCtrl* text = new wxTextCtrl(this, wxID_ANY, label, wxDefaultPosition, wxSize(400, 400), wxTE_MULTILINE | wxTE_READONLY | wxBORDER_DEFAULT | wxTE_RICH);
|
||||||
wxGetApp().UpdateDarkUI(text);
|
wxGetApp().UpdateDarkUI(text);
|
||||||
text->SetStyle(0, label.Len(), wxTextAttr(is_colored ? wxColour(orange) : wxNullColour, wxNullColour, this->GetFont()));
|
text->SetStyle(0, label.Len(), wxTextAttr(is_colored ? wxColour(orange) : wxNullColour, wxNullColour, this->GetFont()));
|
||||||
|
|
||||||
|
|
|
@ -299,7 +299,8 @@ protected:
|
||||||
class FullCompareDialog : public wxDialog
|
class FullCompareDialog : public wxDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FullCompareDialog(const wxString& option_name, const wxString& old_value, const wxString& new_value);
|
FullCompareDialog(const wxString& option_name, const wxString& old_value, const wxString& new_value,
|
||||||
|
const wxString& old_value_header, const wxString& new_value_header);
|
||||||
~FullCompareDialog() {}
|
~FullCompareDialog() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue