]> git.lyx.org Git - features.git/commitdiff
Categorized Combo: Do not draw category line if the combo has zero categories
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 23 Apr 2020 06:31:50 +0000 (08:31 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:57 +0000 (15:48 +0200)
src/frontends/qt/CategorizedCombo.cpp

index 319bcb0e9c1f522898048fdd73db8f38a9384e01..3460a1417a4874a5082e919abb4946ef697171fb 100644 (file)
@@ -153,7 +153,8 @@ void CCItemDelegate::paint(QPainter * painter, QStyleOptionViewItem const & opti
        QString cat = categoryCC(*index.model(), index.row());
 
        // 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();
 
                // draw unselected background
@@ -286,7 +287,7 @@ void CategorizedCombo::Private::setFilter(QString const & s)
                lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row();
 
        filter_ = s;
-    filterModel_->setFilterRegExp(charFilterRegExp(filter_));
+       filterModel_->setFilterRegExp(charFilterRegExp(filter_));
        countCategories();
 
        // restore old selection