Skip to content

Commit

Permalink
Track menu per deck: move config key to track_decl.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Sep 10, 2022
1 parent feacd54 commit 2b0c853
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/track/track_decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ enum class ExportTrackMetadataResult {
Skipped,
};

// key for control to open/close the decks' track menus
const QString kShowTrackMenuKey = QStringLiteral("show_track_menu");

Q_DECLARE_METATYPE(TrackPointer);
4 changes: 2 additions & 2 deletions src/widget/wtrackproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ WTrackProperty::WTrackProperty(
// Set up the control for opening/closing the deck's track menu.
// The first WTrackProperty parsed for this group creates a pushbutton,
// all following WTrackProperty widgets only set the respective proxy.
ConfigKey trackMenuCfgKey(group, "show_track_menu");
ConfigKey trackMenuCfgKey(group, kShowTrackMenuKey);
ControlObject* pMenuControl =
ControlObject::getControl(trackMenuCfgKey, ControlFlag::NoWarnIfMissing);
if (!pMenuControl) {
Expand All @@ -69,7 +69,7 @@ WTrackProperty::WTrackProperty(
&WTrackMenu::trackMenuVisible,
this,
[this](bool visible) {
ControlObject::set(ConfigKey(m_group, "show_track_menu"),
ControlObject::set(ConfigKey(m_group, kShowTrackMenuKey),
visible ? 1.0 : 0.0);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/widget/wtracktext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ WTrackText::WTrackText(QWidget* pParent,
&WTrackMenu::trackMenuVisible,
this,
[this](bool visible) {
ControlObject::set(ConfigKey(m_group, "show_track_menu"),
ControlObject::set(ConfigKey(m_group, kShowTrackMenuKey),
visible ? 1.0 : 0.0);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/widget/wtrackwidgetgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ WTrackWidgetGroup::WTrackWidgetGroup(QWidget* pParent,
&WTrackMenu::trackMenuVisible,
this,
[this](bool visible) {
ControlObject::set(ConfigKey(m_group, "show_track_menu"),
ControlObject::set(ConfigKey(m_group, kShowTrackMenuKey),
visible ? 1.0 : 0.0);
});
}
Expand Down

0 comments on commit 2b0c853

Please sign in to comment.