]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/CategorizedCombo.cpp
New LFUN buffer-external-modification-clear
[lyx.git] / src / frontends / qt4 / CategorizedCombo.cpp
index b380a4c56173f1dccd8eab952053670f27807499..4509e79b9566c28a5531ce748cbb5a1818645dc5 100644 (file)
@@ -245,7 +245,7 @@ void CCItemDelegate::drawCategoryHeader(QPainter * painter, QStyleOptionViewItem
        QFontMetrics fm(font);
        int w = fm.width(category);
        int x = opt.rect.x() + (opt.rect.width() - w) / 2;
-       int y = opt.rect.y() + 1.5 * fm.ascent();
+       int y = opt.rect.y() + 3 * fm.ascent() / 2;
        int left = x;
        int right = x + w;
        painter->drawText(x, y, category);
@@ -271,10 +271,10 @@ QString CCItemDelegate::underlineFilter(QString const & s) const
        // step through data item and put "(x)" for every matching character
        QString r;
        int lastp = -1;
-       cc_->filter();
        for (int i = 0; i < f.length(); ++i) {
                int p = s.indexOf(f[i], lastp + 1, Qt::CaseInsensitive);
-               LASSERT(p != -1, /**/);
+               if (p < 0)
+                       continue;
                if (lastp == p - 1 && lastp != -1) {
                        // remove ")" and append "x)"
                        r = r.left(r.length() - 4) + s[p] + "</u>";
@@ -348,7 +348,6 @@ CategorizedCombo::CategorizedCombo(QWidget * parent)
        : QComboBox(parent), d(new Private(this))
 {
        setSizeAdjustPolicy(QComboBox::AdjustToContents);
-       setFocusPolicy(Qt::ClickFocus);
        setMinimumWidth(sizeHint().width());
        setMaxVisibleItems(100);