Skip to content

Commit

Permalink
gtkui: Add setting to disable column header sorting. Closes: #1133
Browse files Browse the repository at this point in the history
  • Loading branch information
radioactiveman committed Jan 28, 2024
1 parent bd6455f commit 96f7a85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/gtkui/settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ static const PreferencesWidget gtkui_widgets[] = {
WidgetCustomGTK (pw_col_create_chooser),
WidgetCheck (N_("Show column headers"),
WidgetBool ("gtkui", "playlist_headers", redisplay_playlists)),
WidgetCheck (N_("Make column headers clickable for sorting"),
WidgetBool ("gtkui", "playlist_headers_sortable", redisplay_playlists)),
WidgetLabel (N_("<b>Miscellaneous</b>")),
WidgetCheck (N_("Use symbolic icons in toolbar"),
WidgetBool ("gtkui", "symbolic_icons", update_toolbar_icons)),
Expand Down
1 change: 1 addition & 0 deletions src/gtkui/ui_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ static const char * const gtkui_defaults[] = {
"autoscroll", "TRUE",
"playlist_columns", "title artist album queued length",
"playlist_headers", "TRUE",
"playlist_headers_sortable", "TRUE",
"show_remaining_time", "FALSE",

#ifdef USE_GTK3
Expand Down
3 changes: 2 additions & 1 deletion src/gtkui/ui_playlist_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ GtkWidget * ui_playlist_widget_new (Playlist playlist)
audgui_list_add_column (list, pw_col_label[n] ? _(pw_col_names[n]) :
nullptr, i, pw_col_types[n], pw_col_min_widths[n]);

if (pw_col_sort_types[n] < Playlist::n_sort_types)
if (aud_get_bool ("gtkui", "playlist_headers_sortable") &&
pw_col_sort_types[n] < Playlist::n_sort_types)
{
auto column = gtk_tree_view_get_column ((GtkTreeView *) list, i);
auto sort_type_ptr = aud::to_ptr (pw_col_sort_types[n]);
Expand Down

0 comments on commit 96f7a85

Please sign in to comment.