Add display type context menu to RationalSlider

This commit is contained in:
Thomas Wilshaw
2021-04-09 10:52:07 +01:00
parent 2cea45268f
commit 4d8233e7ac
3 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ void MenuShared::AddItemsForClipEditMenu(Menu *m)
void MenuShared::AddItemsForTimeRulerMenu(Menu *m, const rational& timebase)
{
// If menu is already created (such as the view menu) we need to remove the instance
// If a menu is already created (such as the view menu) we need to remove the instance
// of dropfram or non-dropframe timecode that is already there to avoid double displays
if (m->actions().contains(view_timecode_view_dropframe_item_)) {
+8 -1
View File
@@ -17,6 +17,8 @@
#include "common/timecodefunctions.h"
#include "core.h"
#include "widget/menu/menu.h"
#include "widget/menu/menushared.h"
namespace olive {
@@ -189,7 +191,12 @@ void RationalSlider::changeDisplayType()
{
if (!LockDisplayType()) {
// Loop through the display types
SetDisplayType(static_cast<RationalSlider::DisplayType>(((int)(display_type_) + 1) % 4));
//SetDisplayType(static_cast<RationalSlider::DisplayType>(((int)(display_type_) + 1) % 4));
Menu m(this);
MenuShared::instance()->AddItemsForTimeRulerMenu(&m, timebase_);
MenuShared::instance()->AboutToShowTimeRulerActions();
m.exec(QCursor::pos());
ForceLabelUpdate();
}
}
+2 -2
View File
@@ -54,11 +54,11 @@ void SliderLabel::mousePressEvent(QMouseEvent *e)
if (e->button() == Qt::LeftButton) {
if (e->modifiers() & Qt::AltModifier) {
emit RequestReset();
} else if (e->modifiers() & Qt::ControlModifier) {
emit ChangeSliderType();
} else {
emit LabelPressed();
}
} else if (e->button() == Qt::RightButton) {
emit ChangeSliderType();
}
}