Skip to content

Commit

Permalink
Merge branch 'beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Oct 9, 2023
2 parents d8bba94 + bb93887 commit aa68ded
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ v0.8.0
- Fixed a typo in Python's binding to sessios (oepenSession instead of
openSession).
- Made Save Session not save temporary EDLs in the session file.
- Added a __divider__ entry to Plug-in menus to add a divider line between
menu entries.

v0.7.9
======
Expand Down
17 changes: 16 additions & 1 deletion mrv2/lib/mrvUI/mrvMenus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,9 +1132,24 @@ namespace mrv
}

#ifdef MRV2_PYBIND11
idx = -1;
for (const auto& entry : pythonMenus)
{
menu->add(
if (entry == "__divider__")
{
if (idx < 0)
{
LOG_ERROR(
_("__divider__ cannot be the first item in the menu."));
}
else
{
item = (Fl_Menu_Item*)&(menu->menu()[idx]);
item->flags |= FL_MENU_DIVIDER;
}
continue;
}
idx = menu->add(
entry.c_str(), 0, (Fl_Callback*)run_python_method_cb,
(void*)&pythonMenus.at(entry));
}
Expand Down
1 change: 1 addition & 0 deletions mrv2/python/plug-ins/mrv2_hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def play(self):
def menus(self):
menus = {
"Python/Play/Forwards" : self.play, # call a method
"__divider__" : None, # add a divider
"Python/Play/Backwards" : timeline.playBackwards # call a function
}
return menus
Expand Down

0 comments on commit aa68ded

Please sign in to comment.