]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt/BulletsModule.cpp
Show suggestions containing the input in the command buffer
[features.git] / src / frontends / qt / BulletsModule.cpp
index 0572f677ceb9120b80258a07a1d92cf304073611..3c9e42e8e20aaea1f37d1b645c7c0f257e5b22a4 100644 (file)
@@ -174,8 +174,8 @@ QPixmap getSelectedPixmap(QPixmap pixmap, QSize const icon_size)
 void BulletsModule::setupPanel(QListWidget * lw, QString const & panelname,
        int const font, string const folder)
 {
-       connect(lw, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
-               this, SLOT(bulletSelected(QListWidgetItem *, QListWidgetItem*)));
+       connect(lw, SIGNAL(itemClicked(QListWidgetItem *)),
+               this, SLOT(bulletSelected(QListWidgetItem *)));
 
        // add panelname to combox
        bulletpaneCO->addItem(panelname);
@@ -250,12 +250,18 @@ void BulletsModule::init()
 }
 
 
-void BulletsModule::bulletSelected(QListWidgetItem * item, QListWidgetItem *)
+void BulletsModule::bulletSelected(QListWidgetItem * item)
 {
+       int const level = levelLW->currentRow();
+
+       // no change
+       if (bullets_[level].getFont() == bulletpaneCO->currentIndex()
+               && bullets_[level].getCharacter() == item->type())
+               return;
+
        // unselect previous item
        selectItem(current_font_, current_char_, false);
 
-       int const level = levelLW->currentRow();
        bullets_[level].setCharacter(item->type());
        bullets_[level].setFont(bulletpaneCO->currentIndex());
        current_font_ = bulletpaneCO->currentIndex();