summaryrefslogtreecommitdiffstats
path: root/src/library/librarycontrol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/librarycontrol.cpp')
-rw-r--r--src/library/librarycontrol.cpp44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/library/librarycontrol.cpp b/src/library/librarycontrol.cpp
index aed741c1ce..feacf2baa0 100644
--- a/src/library/librarycontrol.cpp
+++ b/src/library/librarycontrol.cpp
@@ -190,6 +190,18 @@ LibraryControl::LibraryControl(Library* pLibrary)
this,
&LibraryControl::slotIncrementFontSize);
+ // Track Color controls
+ m_pTrackColorPrev = std::make_unique<ControlPushButton>(ConfigKey("[Library]", "track_color_prev"));
+ m_pTrackColorNext = std::make_unique<ControlPushButton>(ConfigKey("[Library]", "track_color_next"));
+ connect(m_pTrackColorPrev.get(),
+ &ControlPushButton::valueChanged,
+ this,
+ &LibraryControl::slotTrackColorPrev);
+ connect(m_pTrackColorNext.get(),
+ &ControlPushButton::valueChanged,
+ this,
+ &LibraryControl::slotTrackColorNext);
+
/// Deprecated controls
m_pSelectNextTrack = std::make_unique<ControlPushButton>(ConfigKey("[Playlist]", "SelectNextTrack"));
connect(m_pSelectNextTrack.get(),
@@ -563,8 +575,8 @@ void LibraryControl::slotGoToItem(double v) {
slotToggleSelectedSidebarItem(v);
}
}
- // TODO(xxx) instead of remote control the widgets individual, we should
- // translate this into Alt+Return and handle it at each library widget
+ // TODO(xxx) instead of remote control the widgets individual, we should
+ // translate this into Alt+Return and handle it at each library widget
// individual https://bugs.launchpad.net/mixxx/+bug/1758618
//emitKeyEvent(QKeyEvent{QEvent::KeyPress, Qt::Key_Return, Qt::AltModifier});
}
@@ -603,3 +615,31 @@ void LibraryControl::slotDecrementFontSize(double v) {
slotFontSize(-1);
}
}
+
+void LibraryControl::slotTrackColorPrev(double v) {
+ if (!m_pLibraryWidget) {
+ return;
+ }
+
+ if (v > 0) {
+ LibraryView* activeView = m_pLibraryWidget->getActiveView();
+ if (!activeView) {
+ return;
+ }
+ activeView->assignPreviousTrackColor();
+ }
+}
+
+void LibraryControl::slotTrackColorNext(double v) {
+ if (!m_pLibraryWidget) {
+ return;
+ }
+
+ if (v > 0) {
+ LibraryView* activeView = m_pLibraryWidget->getActiveView();
+ if (!activeView) {
+ return;
+ }
+ activeView->assignNextTrackColor();
+ }
+}