--Bug fixes

-Deleting a flame in the library tree was taking three tries.
This commit is contained in:
Person 2019-04-26 16:18:21 -07:00
parent 5f98be7336
commit 5faa8aa5bd

View File

@ -359,7 +359,6 @@ void Fractorium::dockLocationChanged(Qt::DockWidgetArea area)
bool Fractorium::eventFilter(QObject* o, QEvent* e)
{
static int fcount = 0;//Qt seems to deliver three events for every key press. So a count must be kept to only respond to the third event.
static int libdelcount = 0;//Note that if anything ever changes under the hood with Qt, this will likely stop working, so adjust as accordingly.
static int xfupcount = 0;
static int xfdncount = 0;
@ -394,19 +393,12 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e)
{
//Require shift for deleting to prevent it from triggering when the user enters delete in the edit box.
if (ke->key() == Qt::Key_Delete && e->type() == QEvent::KeyRelease && shift)
{
libdelcount++;
if (libdelcount >= 3)
{
auto v = GetCurrentEmberIndex();
if (ui.LibraryTree->topLevelItem(0)->childCount() > 1)
OnDelete(v);
libdelcount = 0;
}
return true;
}
}