Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Add shortcut command to toggle active LUT

Rodney98a2fcffebea
diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp
index 0db405fee..4e91252b5 100644
--- a/toonz/sources/toonz/mainwindow.cpp
+++ b/toonz/sources/toonz/mainwindow.cpp
@@ -29,6 +29,7 @@
#include "toonzqt/viewcommandids.h"
#include "toonzqt/updatechecker.h"
#include "toonzqt/paletteviewer.h"
+#include "toonzqt/lutcalibrator.h"
#include "toonzqt/seethroughwindow.h"
// TnzLib includes
@@ -2617,6 +2618,18 @@ void MainWindow::defineActions() {
// Menu - View
+ menuAct =
+ createToggle(MI_ToggleColorCalibration, QT_TR_NOOP("Toggle Active LUT"),
+ "", Preferences::instance()->isColorCalibrationEnabled(),
+ MenuViewCommandType);
+ connect(menuAct, &QAction::triggered, this, [](bool enabled) {
+ Preferences::instance()->setValue(colorCalibrationEnabled, enabled);
+ LutManager::instance()->update();
+ TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
+ "ColorCalibration");
+ });
+ menuAct->setEnabled(true);
+
createToggle(MI_ViewCamera, QT_TR_NOOP("&Camera Box"), "",
ViewCameraToggleAction ? 1 : 0, MenuViewCommandType);
createToggle(MI_ViewTable, QT_TR_NOOP("&Table"), "",
diff --git a/toonz/sources/toonz/menubarcommandids.h b/toonz/sources/toonz/menubarcommandids.h
index 490dab8ad..1a6ea11ca 100644
--- a/toonz/sources/toonz/menubarcommandids.h
+++ b/toonz/sources/toonz/menubarcommandids.h
@@ -183,6 +183,7 @@
#define MI_ViewColorcard "MI_ViewColorcard"
#define MI_ViewGuide "MI_ViewGuide"
#define MI_ViewRuler "MI_ViewRuler"
+#define MI_ToggleColorCalibration "MI_ToggleColorCalibration"
#define MI_TCheck "MI_TCheck"
#define MI_ICheck "MI_ICheck"
#define MI_Ink1Check "MI_Ink1Check"
diff --git a/toonz/sources/toonz/preferencespopup.cpp b/toonz/sources/toonz/preferencespopup.cpp
index c70775f8a..56d8d6273 100644
--- a/toonz/sources/toonz/preferencespopup.cpp
+++ b/toonz/sources/toonz/preferencespopup.cpp
@@ -666,6 +666,8 @@ void PreferencesPopup::beforeRoomChoiceChanged() {
//-----------------------------------------------------------------------------
void PreferencesPopup::onColorCalibrationChanged() {
+ CommandManager::instance()->setChecked(MI_ToggleColorCalibration,
+ m_pref->isColorCalibrationEnabled());
LutManager::instance()->update();
TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
"ColorCalibration");
@@ -1860,6 +1862,9 @@ QWidget* PreferencesPopup::createInterfacePage() {
QGridLayout* colorCalibLay = insertGroupBoxUI(colorCalibrationEnabled, lay);
{ insertUI(colorCalibrationLutPaths, colorCalibLay); }
+ connect(CommandManager::instance()->getAction(MI_ToggleColorCalibration),
+ &QAction::triggered, getUI<QGroupBox*>(colorCalibrationEnabled),
+ &QGroupBox::setChecked);
insertUI(displayIn30bit, lay);
row = lay->rowCount();
lay->addWidget(check30bitBtn, row - 1, 2, Qt::AlignRight);