* cosmetic

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23425 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stefan Schimanski 2008-03-04 09:43:42 +00:00
parent b4466b63f6
commit a90096d4d5

View File

@ -44,7 +44,7 @@ namespace frontend {
class RtlItemDelegate : public QItemDelegate { class RtlItemDelegate : public QItemDelegate {
public: public:
explicit RtlItemDelegate(QObject * parent = 0) explicit RtlItemDelegate(QObject * parent = 0)
: QItemDelegate(parent) {} : QItemDelegate(parent), enabled_(false) {}
void setEnabled(bool enabled = true) void setEnabled(bool enabled = true)
{ {
@ -56,8 +56,10 @@ protected:
QStyleOptionViewItem const & option, QStyleOptionViewItem const & option,
QRect const & rect, QString const & text) const QRect const & rect, QString const & text) const
{ {
if (!enabled_) if (!enabled_) {
return QItemDelegate::drawDisplay(painter, option, rect, text); QItemDelegate::drawDisplay(painter, option, rect, text);
return;
}
// FIXME: do this more elegantly // FIXME: do this more elegantly
docstring stltext = qstring_to_ucs4(text); docstring stltext = qstring_to_ucs4(text);
@ -188,9 +190,10 @@ GuiCompleter::GuiCompleter(GuiWorkArea * gui, QObject * parent)
listView->setIndentation(0); listView->setIndentation(0);
listView->setUniformRowHeights(true); listView->setUniformRowHeights(true);
setPopup(listView); setPopup(listView);
popup()->setItemDelegateForColumn(1, new PixmapItemDelegate(this));
rtlItemDelegate_ = new RtlItemDelegate(this); rtlItemDelegate_ = new RtlItemDelegate(this);
popup()->setItemDelegateForColumn(0, rtlItemDelegate_); popup()->setItemDelegateForColumn(0, rtlItemDelegate_);
popup()->setItemDelegateForColumn(1, new PixmapItemDelegate(this));
// create timeout timers // create timeout timers
popup_timer_.setSingleShot(true); popup_timer_.setSingleShot(true);