Add display type context menu to RationalSlider
This commit is contained in:
@@ -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_)) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user