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 selected = card_list->GetSelectedItemCount();
|
||||||
int filtered = card_list->GetItemCount();
|
int filtered = card_list->GetItemCount();
|
||||||
int total = set->cards.size();
|
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) {
|
if (filtered == total) {
|
||||||
counts->SetLabel(_TOOL_2_("card counts 2",
|
counts->SetLabel(_TOOL_2_("card counts 2",
|
||||||
wxString::Format(wxT("%i"), selected),
|
wxString::Format(wxT("%i"), selected),
|
||||||
|
|||||||
@@ -92,7 +92,10 @@ private:
|
|||||||
bool notes_below_editor;
|
bool notes_below_editor;
|
||||||
|
|
||||||
/// Update card counts
|
/// 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
|
/// Move the notes panel below the editor or below the card list
|
||||||
void updateNotesPosition();
|
void updateNotesPosition();
|
||||||
// before Layout, call updateNotesPosition.
|
// before Layout, call updateNotesPosition.
|
||||||
|
|||||||
Reference in New Issue
Block a user