From 99fb1c7b799e6be3032bc73e9a07b085c631e60f Mon Sep 17 00:00:00 2001 From: Eran Ifrah Date: Wed, 15 May 2024 07:35:28 +0300 Subject: [PATCH] Fixed: (MSW / Mac) tabs are not marked as modified --- Plugin/clTabRendererMinimal.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Plugin/clTabRendererMinimal.cpp b/Plugin/clTabRendererMinimal.cpp index 4498c56b47..a66e614da9 100644 --- a/Plugin/clTabRendererMinimal.cpp +++ b/Plugin/clTabRendererMinimal.cpp @@ -194,9 +194,15 @@ wxRect clTabRendererMinimal::DoDraw(wxWindow* parent, wxDC& dc, wxDC& fontDC, co wxColour text_colour = is_dark ? (tabInfo.IsActive() ? *wxWHITE : bgColour.ChangeLightness(170)) : bgColour.ChangeLightness(30); + bool is_modified = false; + if (tabInfo.GetWindow()) { + wxStyledTextCtrl* stc = dynamic_cast(tabInfo.GetWindow()); + is_modified = stc && stc->GetModify(); + } + // use distinct colour to mark modified tabs bool has_close_button = (style & kNotebook_CloseButtonOnActiveTab); - if (!has_close_button && tabInfo.IsModified()) { + if (is_modified) { // no close button, and a modified tab: use different colour for drawing // the tab label text_colour = is_dark ? "PINK" : "RED";