Clear column width cache after updating grid style

Fixes arch1t3cht/Aegisub#11
This commit is contained in:
arch1t3cht 2022-11-08 00:49:42 +01:00
parent 399042e9e9
commit c8ff1bc960
2 changed files with 4 additions and 0 deletions

View file

@ -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();

View file

@ -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);