Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Item details and Item properties on custom field change #912

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,21 @@
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)]

- 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
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
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
Loading