Skip to content

Commit

Permalink
Update Item properties on custom field change
Browse files Browse the repository at this point in the history
This makes Item properties update when a custom title formatting field provided by a component (such as Playback Statistics) changes.

Although Item properties doesn’t use title formatting, this change makes the panel update when things like playback statistics change, and makes the behaviour consistent with Default UI.
  • Loading branch information
reupen committed Jul 11, 2024
1 parent 6ec91fb commit 677c572
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@
setting when opened from the Layout preferences page.
[[#909](https://github.com/reupen/columns_ui/pull/909)]

- Item properties now updates when a component indicates a custom title
formatting field has changed.
[[#912](https://github.com/reupen/columns_ui/pull/912)]

(Although Item properties doesn’t use title formatting, this change makes the
panel update when things like playback statistics change.)

- A bug where dynamic internet radio artwork may not have been immediately shown
after changing the ‘Displayed track’ in the Artwork view panel was fixed.
[[#854](https://github.com/reupen/columns_ui/pull/854)]
Expand Down
13 changes: 4 additions & 9 deletions foo_ui_columns/item_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,16 +616,11 @@ void ItemProperties::on_playback_stop(play_control::t_stop_reason p_reason)

void ItemProperties::on_changed_sorted(metadb_handle_list_cref p_items_sorted, bool p_fromhook)
{
if (!p_fromhook) {
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) {
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 677c572

Please sign in to comment.