mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-12 22:14:35 +00:00
Categorized Combo: Do not draw category line if the combo has zero categories
This commit is contained in:
parent
a9668f1cae
commit
631d6b9b2e
@ -153,7 +153,8 @@ void CCItemDelegate::paint(QPainter * painter, QStyleOptionViewItem const & opti
|
|||||||
QString cat = categoryCC(*index.model(), index.row());
|
QString cat = categoryCC(*index.model(), index.row());
|
||||||
|
|
||||||
// not the same as in the previous line?
|
// not the same as in the previous line?
|
||||||
if (index.row() == 0 || cat != categoryCC(*index.model(), index.row() - 1)) {
|
if (cc_->d->visibleCategories_ > 0
|
||||||
|
&& (index.row() == 0 || cat != categoryCC(*index.model(), index.row() - 1))) {
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
// draw unselected background
|
// draw unselected background
|
||||||
@ -286,7 +287,7 @@ void CategorizedCombo::Private::setFilter(QString const & s)
|
|||||||
lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row();
|
lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row();
|
||||||
|
|
||||||
filter_ = s;
|
filter_ = s;
|
||||||
filterModel_->setFilterRegExp(charFilterRegExp(filter_));
|
filterModel_->setFilterRegExp(charFilterRegExp(filter_));
|
||||||
countCategories();
|
countCategories();
|
||||||
|
|
||||||
// restore old selection
|
// restore old selection
|
||||||
|
Loading…
Reference in New Issue
Block a user