Skip to content

Commit

Permalink
Clear column width cache after updating grid style
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
arch1t3cht committed Nov 7, 2022
1 parent 399042e commit c8ff1bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/base_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ void BaseGrid::UpdateStyle() {
row_colors.SelectedComment.SetColour(to_wx(OPT_GET("Colour/Subtitle Grid/Background/Selected Comment")->GetColor()));
row_colors.LeftCol.SetColour(to_wx(OPT_GET("Colour/Subtitle Grid/Left Column")->GetColor()));

if (width_helper)
width_helper->ClearCache();

SetColumnWidths();

AdjustScrollbar();
Expand Down
1 change: 1 addition & 0 deletions src/grid_column.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class WidthHelper {
public:
void SetDC(wxDC *dc) { this->dc = dc; }
void Age();
void ClearCache() { widths.clear(); };

int operator()(boost::flyweight<std::string> const& str);
int operator()(std::string const& str);
Expand Down

0 comments on commit c8ff1bc

Please # to comment.