mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
optimise updateCardCounts
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -93,6 +93,9 @@ private:
|
||||
|
||||
/// Update card counts
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user