Skip to content

Commit

Permalink
Added View/Auto Frame.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Feb 28, 2024
1 parent 9dd8fe4 commit 29626fd
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ v1.0.7
- Saving of .otio files as movies when the first clip did not start at 0 now
works properly.
- Upgraded to RtAudio v5.2.0 on all platforms.
- Added a View/Auto Frame to turn off auto framing of the view when changing
from one clip to another.


v1.0.6
Expand Down
2 changes: 2 additions & 0 deletions mrv2/lib/mrvCore/mrvHotkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ namespace mrv
Hotkey kFitAll(false, false, false, false, 0);
Hotkey kMinifyTextureFiltering(false, false, false, false, 0);
Hotkey kMagnifyTextureFiltering(false, false, false, true, 'f');
Hotkey kFrameView(false, false, false, false, 0);
Hotkey kSafeAreas(false, false, false, false, 's');
Hotkey kIgnoreDisplayWindow(false, false, false, false, 0);
Hotkey kDisplayWindow(true, false, false, false, 'd');
Expand Down Expand Up @@ -357,6 +358,7 @@ namespace mrv
_("Toggle Minify Texture Filtering"), &kMinifyTextureFiltering),
HotkeyEntry(
_("Toggle Magnify Texture Filtering"), &kMagnifyTextureFiltering),
HotkeyEntry(_("Auto Frame View"), &kFrameView),
HotkeyEntry(_("Safe Areas"), &kSafeAreas),
HotkeyEntry(_("Ignore Display Window"), &kIgnoreDisplayWindow),
HotkeyEntry(_("Display Window"), &kDisplayWindow),
Expand Down
1 change: 1 addition & 0 deletions mrv2/lib/mrvCore/mrvHotkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ namespace mrv

extern Hotkey kToggleShowAnnotations;

extern Hotkey kFrameView;
extern Hotkey kSafeAreas;

extern Hotkey kIgnoreDisplayWindow;
Expand Down
7 changes: 7 additions & 0 deletions mrv2/lib/mrvFl/mrvCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,13 @@ namespace mrv
}
}

void frame_view_cb(Fl_Menu_* m, ViewerUI* ui)
{
Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(m->mvalue());
ui->uiView->setFrameView(item->checked());
ui->uiMain->fill_menu(ui->uiMenuBar);
}

void safe_areas_cb(Fl_Menu_* m, ViewerUI* ui)
{
Fl_Menu_Item* item = const_cast< Fl_Menu_Item* >(m->mvalue());
Expand Down
5 changes: 4 additions & 1 deletion mrv2/lib/mrvFl/mrvCallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ namespace mrv
void window_cb(Fl_Menu_* w, ViewerUI* ui);
void show_window_cb(const std::string& label, ViewerUI* ui);

//! Auto Frame view callback
void frame_view_cb(Fl_Menu_* w, ViewerUI* ui);

//! Safe Areas callback
void safe_areas_cb(Fl_Menu_* w, ViewerUI* ui);

Expand All @@ -95,7 +98,7 @@ namespace mrv

//! Display Window callback
void display_window_cb(Fl_Menu_* w, ViewerUI* ui);

//! Ignore Display Window callback
void ignore_display_window_cb(Fl_Menu_* w, ViewerUI* ui);

Expand Down
7 changes: 7 additions & 0 deletions mrv2/lib/mrvUI/mrvMenus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ namespace mrv
mode = FL_MENU_TOGGLE;
if (numFiles == 0)
mode |= FL_MENU_INACTIVE;
idx = menu->add(
_("View/Auto Frame"), kFrameView.hotkey(),
(Fl_Callback*)frame_view_cb, ui, mode);
item = (Fl_Menu_Item*)&(menu->menu()[idx]);
if (ui->uiView->hasFrameView())
item->set();

idx = menu->add(
_("View/Safe Areas"), kSafeAreas.hotkey(),
(Fl_Callback*)safe_areas_cb, ui, mode);
Expand Down
2 changes: 1 addition & 1 deletion tlRender

0 comments on commit 29626fd

Please sign in to comment.