From 8b468e7840adc9b04c02e003086681569cd643c4 Mon Sep 17 00:00:00 2001 From: Be Date: Thu, 14 Oct 2021 13:15:10 -0500 Subject: [PATCH] create [Master], maximize_library in C++ This prevents a race condition between this ControlObject getting created by loading a skin and a controller script getting loaded. --- src/library/librarycontrol.cpp | 4 ++++ src/library/librarycontrol.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/library/librarycontrol.cpp b/src/library/librarycontrol.cpp index 630fe34d9ed7..9006188fe7eb 100644 --- a/src/library/librarycontrol.cpp +++ b/src/library/librarycontrol.cpp @@ -70,6 +70,10 @@ LibraryControl::LibraryControl(Library* pLibrary) m_numSamplers.connectValueChanged(this, &LibraryControl::slotNumSamplersChanged); m_numPreviewDecks.connectValueChanged(this, &LibraryControl::slotNumPreviewDecksChanged); + // There is no C++ code interacting with this, but it needs to be created before + // controller scripts are initialized. + m_pMaximize = std::make_unique(ConfigKey("[Master]", "maximize_library")); + // Controls to navigate vertically within currently focused widget (up/down buttons) m_pMoveUp = std::make_unique(ConfigKey("[Library]", "MoveUp")); m_pMoveDown = std::make_unique(ConfigKey("[Library]", "MoveDown")); diff --git a/src/library/librarycontrol.h b/src/library/librarycontrol.h index 396f841d47ff..7cf4776dbe7e 100644 --- a/src/library/librarycontrol.h +++ b/src/library/librarycontrol.h @@ -106,6 +106,8 @@ class LibraryControl : public QObject { // Give the keyboard focus to the main library pane void setLibraryFocus(); + std::unique_ptr m_pMaximize; + // Controls to navigate vertically within currently focused widget (up/down buttons) std::unique_ptr m_pMoveUp; std::unique_ptr m_pMoveDown;