Skip to content

Commit

Permalink
Update Item details on custom field change
Browse files Browse the repository at this point in the history
This makes Item details update when it’s current showing a selection (rather than the playing item) and a custom title formatting field provided by a component (such as Playback Statistics) changes.
  • Loading branch information
reupen committed Jul 11, 2024
1 parent 596117b commit 6ec91fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
Note: An item group of ‘None’ is used to execute a context menu command
without any tracks, which isn’t normally useful.

- Item details now updates when it’s tracking the current selection and a
component indicates a custom title formatting field has changed.
[[#912](https://github.com/reupen/columns_ui/pull/912)]

- The Item details options dialogue box now respects the current dark mode
setting when opened from the Layout preferences page.
[[#909](https://github.com/reupen/columns_ui/pull/909)]
Expand Down
16 changes: 7 additions & 9 deletions foo_ui_columns/item_details.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,16 +508,14 @@ void ItemDetails::on_items_selection_change(const bit_array& p_affected, const b

void ItemDetails::on_changed_sorted(metadb_handle_list_cref p_items_sorted, bool p_fromhook)
{
if (!p_fromhook && !m_nowplaying_active) {
bool b_refresh = false;
size_t count = m_handles.get_count();
for (size_t i = 0; i < count && !b_refresh; i++) {
size_t index = pfc_infinite;
if (p_items_sorted.bsearch_t(pfc::compare_t<metadb_handle_ptr, metadb_handle_ptr>, m_handles[i], index))
b_refresh = true;
}
if (b_refresh) {
if (m_nowplaying_active)
return;

for (auto&& track : m_handles) {
if (size_t index{};
p_items_sorted.bsearch_t(pfc::compare_t<metadb_handle_ptr, metadb_handle_ptr>, track, index)) {
refresh_contents();
break;
}
}
}
Expand Down

0 comments on commit 6ec91fb

Please sign in to comment.