From cb407e46e5d833d5e286d4e7e2f092fb3f19e6ec Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 11 Aug 2020 10:37:08 +0200 Subject: [PATCH] Fixed color update under GTK + FullCompareDialog : Use SetStile instead of SetForegroundColour for the wxTextCtrls --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index dcd1d760a..9f9ec3d9f 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -150,7 +150,7 @@ ModelNode::ModelNode(ModelNode* parent, const wxString& text, const wxString& ol void ModelNode::UpdateEnabling() { -#if defined(SUPPORTS_MARKUP) && defined(wxHAS_GENERIC_DATAVIEWCTRL) +#if defined(SUPPORTS_MARKUP) && !defined(__APPLE__) auto change_text_color = [](wxString& str, const std::string& clr_from, const std::string& clr_to) { std::string old_val = into_u8(str); @@ -876,9 +876,10 @@ FullCompareDialog::FullCompareDialog(const wxString& option_name, const wxString }; auto add_value = [grid_sizer, border, this](wxString label, bool is_colored = false) { - wxTextCtrl* text = new wxTextCtrl(this, wxID_ANY, label, wxDefaultPosition, wxSize(300, -1), wxTE_MULTILINE | wxTE_READONLY | wxBORDER_NONE); + wxTextCtrl* text = new wxTextCtrl(this, wxID_ANY, label, wxDefaultPosition, wxSize(300, -1), wxTE_MULTILINE | wxTE_READONLY | wxBORDER_NONE | wxTE_RICH); if (is_colored) - text->SetForegroundColour(wxColour(orange)); +// text->SetForegroundColour(wxColour(orange)); + text->SetStyle(0, label.Len(), wxTextAttr(wxColour(orange))); grid_sizer->Add(text, 1, wxALL | wxEXPAND, border); };