Skip to content

Commit 5ba8864

Browse files
committed
Clear column width cache after updating grid style
Fixes arch1t3cht#11
1 parent 0fd6b99 commit 5ba8864

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/base_grid.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ void BaseGrid::UpdateStyle() {
186186
row_colors.SelectedComment.SetColour(to_wx(OPT_GET("Colour/Subtitle Grid/Background/Selected Comment")->GetColor()));
187187
row_colors.LeftCol.SetColour(to_wx(OPT_GET("Colour/Subtitle Grid/Left Column")->GetColor()));
188188

189+
if (width_helper)
190+
width_helper->ClearCache();
191+
189192
SetColumnWidths();
190193

191194
AdjustScrollbar();

src/grid_column.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class WidthHelper {
4141
public:
4242
void SetDC(wxDC *dc) { this->dc = dc; }
4343
void Age();
44+
void ClearCache() { widths.clear(); };
4445

4546
int operator()(boost::flyweight<std::string> const& str);
4647
int operator()(std::string const& str);

0 commit comments

Comments
 (0)