Skip to content

Commit

Permalink
library: add '[Library],sort_focused_column' control pushbutton
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Schürmann <daschuer@mixxx.org>
  • Loading branch information
ronso0 and daschuer committed May 10, 2022
1 parent 6393ead commit d950a08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/library/librarycontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ LibraryControl::LibraryControl(Library* pLibrary)
m_pSortOrder = std::make_unique<ControlPushButton>(ConfigKey("[Library]", "sort_order"));
m_pSortOrder->setButtonMode(ControlPushButton::TOGGLE);
m_pSortColumnToggle = std::make_unique<ControlEncoder>(ConfigKey("[Library]", "sort_column_toggle"), false);
m_pSortFocusedColumn = std::make_unique<ControlPushButton>(
ConfigKey("[Library]", "sort_focused_column"));
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
connect(m_pSortColumn.get(),
&ControlEncoder::valueChanged,
Expand All @@ -221,6 +223,14 @@ LibraryControl::LibraryControl(Library* pLibrary)
&ControlEncoder::valueChanged,
this,
&LibraryControl::slotSortColumnToggle);
connect(m_pSortFocusedColumn.get(),
&ControlObject::valueChanged,
this,
[this](double value) {
if (value > 0.0) {
slotSortColumnToggle(TrackModel::SortColumnId::CurrentIndex);
}
});

// Font sizes
m_pFontSizeKnob = std::make_unique<ControlObject>(
Expand Down
1 change: 1 addition & 0 deletions src/library/librarycontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class LibraryControl : public QObject {
std::unique_ptr<ControlEncoder> m_pSortColumn;
std::unique_ptr<ControlEncoder> m_pSortColumnToggle;
std::unique_ptr<ControlPushButton> m_pSortOrder;
std::unique_ptr<ControlPushButton> m_pSortFocusedColumn;

// Controls to change track color
std::unique_ptr<ControlPushButton> m_pTrackColorPrev;
Expand Down

0 comments on commit d950a08

Please sign in to comment.