| 1043 | } |
| 1044 | |
| 1045 | void ReloadEffectsList() |
| 1046 | { |
| 1047 | wxWindowUpdateLocker freeze(this); |
| 1048 | |
| 1049 | //delete items that were added to the sizer |
| 1050 | mEffectListContainer->Hide(); |
| 1051 | mEffectListContainer->GetSizer()->Clear(true); |
| 1052 | |
| 1053 | |
| 1054 | if(!mDelegate || mDelegate->GetEffectList().GetStatesCount() == 0) |
| 1055 | mEffectListContainer->Hide(); |
| 1056 | |
| 1057 | auto isEmpty{true}; |
| 1058 | if(mDelegate) |
| 1059 | { |
| 1060 | auto& effects = mDelegate->GetEffectList(); |
| 1061 | isEmpty = effects.GetStatesCount() == 0; |
| 1062 | for(size_t i = 0, count = effects.GetStatesCount(); i < count; ++i) |
| 1063 | InsertEffectRow(i, effects.GetStateAt(i)); |
| 1064 | } |
| 1065 | mAddEffect->SetEnabled(!!mDelegate); |
| 1066 | //Workaround for GTK: Underlying GTK widget does not update |
| 1067 | //its size when wxWindow size is set to zero |
| 1068 | mEffectListContainer->Show(!isEmpty); |
| 1069 | if(mFooter != nullptr) |
| 1070 | mFooter->Show(isEmpty); |
| 1071 | |
| 1072 | SendSizeEventToParent(); |
| 1073 | } |
| 1074 | |
| 1075 | void OnAddEffectClicked(const wxCommandEvent& event) |
| 1076 | { |
nothing calls this directly
no test coverage detected