manageddisplaywidget: show colorspaces as well as DVL
This commit is contained in:
@@ -72,6 +72,26 @@ const ColorTransform &ManagedDisplayWidget::GetColorTransform() const
|
||||
return color_transform_;
|
||||
}
|
||||
|
||||
Menu *ManagedDisplayWidget::GetColorSpaceMenu(QMenu *parent, bool auto_connect)
|
||||
{
|
||||
QStringList colorspaces = color_manager()->ListAvailableColorspaces();
|
||||
|
||||
Menu* ocio_colorspace_menu = new Menu(tr("Color Space"), parent);
|
||||
|
||||
if (auto_connect) {
|
||||
connect(ocio_colorspace_menu, &Menu::triggered, this, &ManagedDisplayWidget::MenuColorspaceSelect);
|
||||
}
|
||||
|
||||
foreach (const QString& c, colorspaces) {
|
||||
QAction* action = ocio_colorspace_menu->addAction(c);
|
||||
action->setCheckable(true);
|
||||
action->setChecked(color_transform_.output() == c);
|
||||
action->setData(c);
|
||||
}
|
||||
|
||||
return ocio_colorspace_menu;
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::ColorConfigChanged()
|
||||
{
|
||||
if (!color_manager_) {
|
||||
@@ -101,6 +121,8 @@ void ManagedDisplayWidget::ShowDefaultContextMenu()
|
||||
Menu m(this);
|
||||
|
||||
if (color_manager_) {
|
||||
m.addMenu(GetColorSpaceMenu(&m));
|
||||
m.addSeparator();
|
||||
m.addMenu(GetDisplayMenu(&m));
|
||||
m.addMenu(GetViewMenu(&m));
|
||||
m.addMenu(GetLookMenu(&m));
|
||||
@@ -145,6 +167,11 @@ void ManagedDisplayWidget::MenuLookSelect(QAction *action)
|
||||
SetColorTransform(new_transform);
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::MenuColorspaceSelect(QAction *action)
|
||||
{
|
||||
SetColorTransform(color_manager()->GetCompliantColorSpace(ColorTransform(action->data().toString())));
|
||||
}
|
||||
|
||||
void ManagedDisplayWidget::SetColorTransform(const ColorTransform &transform)
|
||||
{
|
||||
makeCurrent();
|
||||
|
||||
@@ -52,6 +52,11 @@ public:
|
||||
*/
|
||||
const ColorTransform& GetColorTransform() const;
|
||||
|
||||
/**
|
||||
* @brief Get menu that can be used to select the colorspace
|
||||
*/
|
||||
Menu* GetColorSpaceMenu(QMenu* parent, bool auto_connect = true);
|
||||
|
||||
/**
|
||||
* @brief Get menu that can be used to select the display transform
|
||||
*/
|
||||
@@ -169,6 +174,11 @@ private slots:
|
||||
*/
|
||||
void MenuLookSelect(QAction* action);
|
||||
|
||||
/**
|
||||
* @brief If GetColorSpaceMenu() is called with `auto_connect` set to true, it will be connected to this
|
||||
*/
|
||||
void MenuColorspaceSelect(QAction* action);
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
Reference in New Issue
Block a user