From c1d336b69347aef09cdf9623999cbdea7791a2c0 Mon Sep 17 00:00:00 2001 From: Person Date: Thu, 30 Jan 2020 18:55:39 -0800 Subject: [PATCH] --User changes -Add new keyboard shortcuts: --P/Shift+P toggles visibility of pre/post xforms. --L/Shift+L toggles visibility of all/selected pre/post xforms. --Bug fixes -Xforms were erroneously able to edit via key pressed when not shown. --- Source/Fractorium/Fractorium.cpp | 39 +++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/Source/Fractorium/Fractorium.cpp b/Source/Fractorium/Fractorium.cpp index 637fa5e..449cb73 100644 --- a/Source/Fractorium/Fractorium.cpp +++ b/Source/Fractorium/Fractorium.cpp @@ -368,6 +368,8 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e) static int ecount = 0; static int gcount = 0; static int hcount = 0; + static int pcount = 0; + static int lcount = 0; if (o == ui.GLParentScrollArea && e->type() == QEvent::Resize) { @@ -487,7 +489,42 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e) return true; } - else if (!DrawXforms())//Everything below this must be for editing xforms via key press. + else if (ke->key() == Qt::Key_P) + { + pcount++; + + if (pcount >= times) + { + pcount = 0; + + if (!shift) + ui.ActionDrawPreAffines->setChecked(!ui.ActionDrawPreAffines->isChecked()); + else + ui.ActionDrawPostAffines->setChecked(!ui.ActionDrawPostAffines->isChecked()); + } + + return true; + } + else if (ke->key() == Qt::Key_L) + { + lcount++; + + if (lcount >= times) + { + lcount = 0; + + if (!shift) + { + if (DrawPreAffines()) + ui.ActionDrawAllPreAffines->setChecked(!ui.ActionDrawAllPreAffines->isChecked()); + } + else if (DrawPostAffines()) + ui.ActionDrawAllPostAffines->setChecked(!ui.ActionDrawAllPostAffines->isChecked()); + } + + return true; + } + else if ((!DrawPreAffines() && pre) || (!DrawPostAffines() && !pre))//Everything below this must be for editing xforms via key press. { return true; }