Skip to content

Commit

Permalink
qtui: Add setting to disable column header sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
radioactiveman committed Jan 28, 2024
1 parent 96f7a85 commit e69b85e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/qtui/playlist-qt.cc
Expand Up @@ -50,8 +50,6 @@ PlaylistWidget::PlaylistWidget(QWidget * parent, Playlist playlist)

auto header = new PlaylistHeader(this);
setHeader(header);
/* this has to come after setHeader() to take effect */
header->setSectionsClickable(true);

setAllColumnsShowFocus(true);
setAlternatingRowColors(true);
Expand Down Expand Up @@ -541,5 +539,8 @@ void PlaylistWidget::hidePopup()

void PlaylistWidget::updateSettings()
{
header()->setSectionsClickable(
aud_get_bool("qtui", "playlist_headers_sortable"));

setHeaderHidden(!aud_get_bool("qtui", "playlist_headers"));
}
4 changes: 4 additions & 0 deletions src/qtui/settings.cc
Expand Up @@ -40,6 +40,7 @@ const char * const qtui_defaults[] = {
"playlist_columns", DEFAULT_COLUMNS,
"playlist_headers", "TRUE",
"playlist_headers_bold", "FALSE",
"playlist_headers_sortable", "TRUE",
"show_remaining_time", "FALSE",
// clang-format on
nullptr};
Expand Down Expand Up @@ -78,6 +79,9 @@ static const PreferencesWidget qtui_widgets[] = {
WidgetCheck(N_("Use bold font for column headers"),
WidgetBool("qtui", "playlist_headers_bold",
qtui_update_playlist_headers)),
WidgetCheck(N_("Make column headers clickable for sorting"),
WidgetBool("qtui", "playlist_headers_sortable",
qtui_update_playlist_settings)),
WidgetLabel(N_("<b>Miscellaneous</b>")),
WidgetCheck(N_("Scroll on song change"), WidgetBool("qtui", "autoscroll"))};

Expand Down

0 comments on commit e69b85e

Please sign in to comment.