optimise updateCardCounts

This commit is contained in:
GenevensiS
2025-06-29 23:19:28 +02:00
parent 5be8ae8794
commit e252c8808b
2 changed files with 15 additions and 1 deletions
+11
View File
@@ -107,6 +107,17 @@ void CardsPanel::updateCardCounts() {
int selected = card_list->GetSelectedItemCount();
int filtered = card_list->GetItemCount();
int total = set->cards.size();
if (
selected_cards_count == selected
&& filtered_cards_count == filtered
&& total_cards_count == total
) return;
selected_cards_count = selected;
filtered_cards_count = filtered;
total_cards_count = total;
if (filtered == total) {
counts->SetLabel(_TOOL_2_("card counts 2",
wxString::Format(wxT("%i"), selected),
+4 -1
View File
@@ -92,7 +92,10 @@ private:
bool notes_below_editor;
/// Update card counts
void updateCardCounts();
void updateCardCounts();
int selected_cards_count = 0;
int filtered_cards_count = 0;
int total_cards_count = 0;
/// Move the notes panel below the editor or below the card list
void updateNotesPosition();
// before Layout, call updateNotesPosition.