mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-21 01:42:15 -07:00
prevent overlapping sort properties
This commit is contained in:
parent
a20820a9cd
commit
a01694da92
1 changed files with 14 additions and 0 deletions
|
|
@ -141,11 +141,25 @@ void ZoneViewWidget::processGroupBy(int index)
|
||||||
auto option = static_cast<CardList::SortOption>(groupBySelector.itemData(index).toInt());
|
auto option = static_cast<CardList::SortOption>(groupBySelector.itemData(index).toInt());
|
||||||
SettingsCache::instance().setZoneViewGroupBy(option);
|
SettingsCache::instance().setZoneViewGroupBy(option);
|
||||||
zone->setGroupBy(option);
|
zone->setGroupBy(option);
|
||||||
|
|
||||||
|
// reset sortBy if it has the same value as groupBy
|
||||||
|
if (option != CardList::NoSort &&
|
||||||
|
option == static_cast<CardList::SortOption>(sortBySelector.currentData().toInt())) {
|
||||||
|
sortBySelector.setCurrentIndex(1); // set to SortByName
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneViewWidget::processSortBy(int index)
|
void ZoneViewWidget::processSortBy(int index)
|
||||||
{
|
{
|
||||||
auto option = static_cast<CardList::SortOption>(sortBySelector.itemData(index).toInt());
|
auto option = static_cast<CardList::SortOption>(sortBySelector.itemData(index).toInt());
|
||||||
|
|
||||||
|
// set to SortByName instead if it has the same value as groupBy
|
||||||
|
if (option != CardList::NoSort &&
|
||||||
|
option == static_cast<CardList::SortOption>(groupBySelector.currentData().toInt())) {
|
||||||
|
sortBySelector.setCurrentIndex(1); // set to SortByName
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SettingsCache::instance().setZoneViewSortBy(option);
|
SettingsCache::instance().setZoneViewSortBy(option);
|
||||||
zone->setSortBy(option);
|
zone->setSortBy(option);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue