Skip to content

Commit

Permalink
Fixed: (MSW / Mac) tabs are not marked as modified
Browse files Browse the repository at this point in the history
  • Loading branch information
eranif committed May 15, 2024
1 parent 587f9ec commit 99fb1c7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Plugin/clTabRendererMinimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<wxStyledTextCtrl*>(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";
Expand Down

0 comments on commit 99fb1c7

Please sign in to comment.