MCPcopy Create free account
hub / github.com/audacity/audacity / MacShowUndockedToolbars

Method MacShowUndockedToolbars

src/ProjectWindow.cpp:979–1009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

977}
978
979void ProjectWindow::MacShowUndockedToolbars(bool show)
980{
981 (void)show;//compiler food
982#ifdef __WXMAC__
983 // Save the focus so we can restore it to whatever had it before since
984 // showing a previously hidden toolbar will cause the focus to be set to
985 // its frame. If this is not done it will appear that activation events
986 // aren't being sent to the project window since they are actually being
987 // delivered to the last tool frame shown.
988 wxWindow *focused = FindFocus();
989
990 // Find all the floating toolbars, and show or hide them
991 const auto &children = GetChildren();
992 for(const auto &child : children) {
993 if (auto frame = dynamic_cast<ToolFrame*>(child)) {
994 if (!show) {
995 frame->Hide();
996 }
997 else if (frame->GetBar() &&
998 frame->GetBar()->IsVisible() ) {
999 frame->Show();
1000 }
1001 }
1002 }
1003
1004 // Restore the focus if needed
1005 if (focused) {
1006 focused->SetFocus();
1007 }
1008#endif
1009}
1010
1011void ProjectWindow::OnIconize(wxIconizeEvent &event)
1012{

Callers

nothing calls this directly

Calls 6

FindFocusFunction · 0.85
GetBarMethod · 0.80
HideMethod · 0.45
IsVisibleMethod · 0.45
ShowMethod · 0.45
SetFocusMethod · 0.45

Tested by

no test coverage detected