From: John Levon Date: Thu, 12 Sep 2002 01:41:16 +0000 (+0000) Subject: command buffer fixes X-Git-Tag: 1.6.10~18295 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=bcffabeb847cebcb966b4c6c128b2aef73366e1d;p=features.git command buffer fixes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5279 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 5c775b7e94..b0b38480ef 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-09-12 John Levon + + * QCommandBuffer.C: fix click + 2002-09-12 John Levon * QMathDialog.C: work around Qt bug in previous change diff --git a/src/frontends/qt2/QCommandBuffer.C b/src/frontends/qt2/QCommandBuffer.C index c3a5bba6e1..9d77b01df3 100644 --- a/src/frontends/qt2/QCommandBuffer.C +++ b/src/frontends/qt2/QCommandBuffer.C @@ -35,6 +35,15 @@ public: } protected: + void mouseReleaseEvent(QMouseEvent * e) { + if (e->x() < 0 || e->y() < 0 + || e->x() > width() || e->y() > height()) { + hide(); + } else { + emit selected(currentText()); + } + } + void keyPressEvent(QKeyEvent * e) { if (e->key() == Key_Escape) { hide(); @@ -116,14 +125,14 @@ void QCommandBuffer::complete() edit_->setText(new_input.c_str()); QTempListBox * list = new QTempListBox(); + + // For some reason the scrollview's contents are larger + // than the number of actual items... vector::const_iterator cit = comp.begin(); vector::const_iterator end = comp.end(); for (; cit != end; ++cit) { list->insertItem(cit->c_str()); } - - // For some reason we get lots of empty entries and the - // scrollbar is wrong as a result. No fix. Qt Sucks. // width() is not big enough by a few pixels. Qt Sucks. list->setMinimumWidth(list->sizeHint().width() + 10); @@ -138,13 +147,6 @@ void QCommandBuffer::complete() connect(list, SIGNAL(selected(const QString &)), this, SLOT(complete_selected(const QString &))); - // Note we *cannot* make a single click popup, because - // events get generated for outside the popup on Qt 2.3.1 - // and even gives valid QListBoxItem *'s. We have no way - // to work past this. Qt Sucks. - //connect(list, SIGNAL(clicked(QListBoxItem *)), - // this, SLOT(complete_selected2(QListBoxItem *))); - list->show(); list->setFocus(); } diff --git a/src/frontends/qt2/TODO b/src/frontends/qt2/TODO index 655ab28976..1d7ea780fa 100644 --- a/src/frontends/qt2/TODO +++ b/src/frontends/qt2/TODO @@ -17,10 +17,6 @@ QAbout - give good default size -QCommandBuffer - - - fix !! I HATE Qt - QDocument - implement me. Need MVC (Edwin is on this)