| 1292 | } |
| 1293 | |
| 1294 | void ProjectWindow::OnViewportMessage(const ViewportMessage &message) |
| 1295 | { |
| 1296 | // Activate events can fire during window teardown, so just |
| 1297 | // ignore them. |
| 1298 | if (mIsDeleting) |
| 1299 | return; |
| 1300 | auto pProject = FindProject(); |
| 1301 | if (!pProject) |
| 1302 | return; |
| 1303 | auto &project = *pProject; |
| 1304 | auto &viewInfo = ViewInfo::Get(project); |
| 1305 | auto &trackPanel = GetProjectPanel(project); |
| 1306 | |
| 1307 | auto [rescroll, scrollbarVisibilityChanged, resize] = message; |
| 1308 | |
| 1309 | if (rescroll) |
| 1310 | trackPanel.Refresh(false); |
| 1311 | |
| 1312 | // why? Is there a menu item whose availability depends on scroll position |
| 1313 | // or zoom level? |
| 1314 | CommandManager::Get(project).UpdateMenus(); |
| 1315 | |
| 1316 | if (scrollbarVisibilityChanged || resize) |
| 1317 | UpdateLayout(); |
| 1318 | } |
| 1319 | |
| 1320 | static ToolManager::TopPanelHook::Scope scope { |
| 1321 | []( wxWindow &window ){ |
nothing calls this directly
no test coverage detected