fix issue where the selection panel sometimes collapses to very small size
This commit is contained in:
@@ -73,6 +73,11 @@ void ItemChipRow::rebuildChips(const std::vector<Entry>& entries)
|
||||
ItemChip* chip = new ItemChip(icon, this);
|
||||
m_layout->addWidget(chip, static_cast<int>(index) / kChipsPerRow,
|
||||
static_cast<int>(index) % kChipsPerRow);
|
||||
// Shown right away, because the panel measures itself as soon as this returns. A
|
||||
// widget created under an already-visible parent starts hidden, and a layout
|
||||
// treats a hidden item as empty, so an unshown chip would add nothing to the
|
||||
// size hint and the panel would be fitted to a buffer section that looks empty.
|
||||
chip->show();
|
||||
m_chips.push_back(chip);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user