[LyX/master] Categorized Combo: Do not draw category line if the combo has zero categories
Juergen Spitzmueller
spitz at lyx.org
Thu Apr 23 06:11:29 UTC 2020
commit 631d6b9b2e4a0eb7765fe56b23f9dc603fbcae9d
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Thu Apr 23 08:31:50 2020 +0200
Categorized Combo: Do not draw category line if the combo has zero categories
---
src/frontends/qt/CategorizedCombo.cpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/frontends/qt/CategorizedCombo.cpp b/src/frontends/qt/CategorizedCombo.cpp
index 319bcb0..3460a14 100644
--- a/src/frontends/qt/CategorizedCombo.cpp
+++ b/src/frontends/qt/CategorizedCombo.cpp
@@ -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
More information about the lyx-cvs
mailing list