From 5cf772469882c4a36eeb1afb78293f759a0648b6 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 10 Oct 2009 15:21:26 +0000 Subject: [PATCH] Disable zoom controls when video is detached as the zoom is ignored with detached video. Originally committed to SVN as r3676. --- aegisub/src/frame_main.cpp | 7 ++++--- aegisub/src/frame_main_events.cpp | 21 +++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/aegisub/src/frame_main.cpp b/aegisub/src/frame_main.cpp index 77220c7d1..fa8e855e8 100644 --- a/aegisub/src/frame_main.cpp +++ b/aegisub/src/frame_main.cpp @@ -676,9 +676,9 @@ void FrameMain::UpdateToolbar() { // Update wxToolBar* toolbar = GetToolBar(); toolbar->FindById(Menu_Video_JumpTo)->Enable(isVideo); - toolbar->FindById(Menu_Video_Zoom_In)->Enable(isVideo); - toolbar->FindById(Menu_Video_Zoom_Out)->Enable(isVideo); - ZoomBox->Enable(isVideo); + toolbar->FindById(Menu_Video_Zoom_In)->Enable(isVideo && !detachedVideo); + toolbar->FindById(Menu_Video_Zoom_Out)->Enable(isVideo && !detachedVideo); + ZoomBox->Enable(isVideo && !detachedVideo); toolbar->FindById(Menu_Subs_Snap_Start_To_Video)->Enable(isVideo && selRows > 0); toolbar->FindById(Menu_Subs_Snap_End_To_Video)->Enable(isVideo && selRows > 0); toolbar->FindById(Menu_Subs_Snap_Video_To_Start)->Enable(isVideo && selRows == 1); @@ -1310,6 +1310,7 @@ void FrameMain::DetachVideo(bool detach) { detachedVideo = NULL; } } + UpdateToolbar(); } diff --git a/aegisub/src/frame_main_events.cpp b/aegisub/src/frame_main_events.cpp index ccd9134c8..84143d598 100644 --- a/aegisub/src/frame_main_events.cpp +++ b/aegisub/src/frame_main_events.cpp @@ -312,22 +312,23 @@ void FrameMain::OnMenuOpen (wxMenuEvent &event) { // Video menu else if (curMenu == videoMenu) { bool state = VideoContext::Get()->IsLoaded(); + bool attached = state && !detachedVideo; // Set states MenuBar->Enable(Menu_Video_JumpTo,state); MenuBar->Enable(Menu_Subs_Snap_Video_To_Start,state); MenuBar->Enable(Menu_Subs_Snap_Video_To_End,state); - MenuBar->Enable(Menu_View_Zoom,state); - MenuBar->Enable(Menu_View_Zoom_50,state); - MenuBar->Enable(Menu_View_Zoom_100,state); - MenuBar->Enable(Menu_View_Zoom_200,state); + MenuBar->Enable(Menu_View_Zoom,attached); + MenuBar->Enable(Menu_View_Zoom_50,attached); + MenuBar->Enable(Menu_View_Zoom_100,attached); + MenuBar->Enable(Menu_View_Zoom_200,attached); MenuBar->Enable(Menu_File_Close_Video,state); - MenuBar->Enable(Menu_Video_AR,state); - MenuBar->Enable(Menu_Video_AR_Default,state); - MenuBar->Enable(Menu_Video_AR_Full,state); - MenuBar->Enable(Menu_Video_AR_Wide,state); - MenuBar->Enable(Menu_Video_AR_235,state); - MenuBar->Enable(Menu_Video_AR_Custom,state); + MenuBar->Enable(Menu_Video_AR,attached); + MenuBar->Enable(Menu_Video_AR_Default,attached); + MenuBar->Enable(Menu_Video_AR_Full,attached); + MenuBar->Enable(Menu_Video_AR_Wide,attached); + MenuBar->Enable(Menu_Video_AR_235,attached); + MenuBar->Enable(Menu_Video_AR_Custom,attached); MenuBar->Enable(Menu_Video_Detach,state && !detachedVideo); MenuBar->Enable(Menu_File_Save_VFR,VFR_Output.GetFrameRateType() == VFR); MenuBar->Enable(Menu_File_Close_VFR,VFR_Output.GetFrameRateType() == VFR);