]> git.lyx.org Git - features.git/commitdiff
command buffer fixes
authorJohn Levon <levon@movementarian.org>
Thu, 12 Sep 2002 01:41:16 +0000 (01:41 +0000)
committerJohn Levon <levon@movementarian.org>
Thu, 12 Sep 2002 01:41:16 +0000 (01:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5279 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QCommandBuffer.C
src/frontends/qt2/TODO

index 5c775b7e941865051489b30550832e8a1bc6a4ed..b0b38480ef70a08f5778187bd783b6ae5d044300 100644 (file)
@@ -1,3 +1,7 @@
+2002-09-12  John Levon  <levon@movementarian.org>
+
+       * QCommandBuffer.C: fix click
 2002-09-12  John Levon  <levon@movementarian.org>
 
        * QMathDialog.C: work around Qt bug in previous change
index c3a5bba6e112a6dbb55b09bd84506f3548b25d4c..9d77b01df3b3323c82df45193fff9515bd01fd2a 100644 (file)
@@ -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<string>::const_iterator cit = comp.begin();
        vector<string>::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();
 }
index 655ab289768133ae3031e705d51aef60e8f0f301..1d7ea780fae8a4d5710ba29229af57400937f999 100644 (file)
@@ -17,10 +17,6 @@ QAbout
 
        - give good default size 
 
-QCommandBuffer
-
-       - fix !! I HATE Qt
 QDocument
 
        - implement me. Need MVC (Edwin is on this)