Merge pull request #1379

827c80d ctrl+tab switch pages in the same order as leftpanel
2bbd5c6 ctrl+shift+tab, switch pages in Leftpanel reverse order
This commit is contained in:
luigi1111 2018-05-11 17:00:26 -05:00
commit b6a7836447
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
3 changed files with 28 additions and 15 deletions

View file

@ -34,13 +34,20 @@ filter::filter(QObject *parent) :
QObject(parent) QObject(parent)
{ {
m_tabPressed = false; m_tabPressed = false;
m_backtabPressed = false;
} }
bool filter::eventFilter(QObject *obj, QEvent *ev) { bool filter::eventFilter(QObject *obj, QEvent *ev) {
switch(ev->type()) { switch(ev->type()) {
case QEvent::KeyPress: { case QEvent::KeyPress: {
QKeyEvent *ke = static_cast<QKeyEvent*>(ev); QKeyEvent *ke = static_cast<QKeyEvent*>(ev);
if(ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) { if(ke->key() == Qt::Key_Backtab) {
if(m_backtabPressed)
break;
else m_backtabPressed = true;
}
if(ke->key() == Qt::Key_Tab) {
if(m_tabPressed) if(m_tabPressed)
break; break;
else m_tabPressed = true; else m_tabPressed = true;
@ -58,7 +65,7 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) {
sks = ks.toString(); sks = ks.toString();
} }
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
if(sks.contains("Alt+Tab") || sks.contains("Alt+Shift+Backtab")) if(sks.contains("Alt+Tab") || sks.contains("Alt+Backtab"))
break; break;
#else #else
sks.replace("Meta", "Ctrl"); sks.replace("Meta", "Ctrl");
@ -67,7 +74,11 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) {
} break; } break;
case QEvent::KeyRelease: { case QEvent::KeyRelease: {
QKeyEvent *ke = static_cast<QKeyEvent*>(ev); QKeyEvent *ke = static_cast<QKeyEvent*>(ev);
if(ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab)
if(ke->key() == Qt::Key_Backtab)
m_backtabPressed = false;
if(ke->key() == Qt::Key_Tab)
m_tabPressed = false; m_tabPressed = false;
QString sks; QString sks;
@ -88,7 +99,7 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) {
sks = ks.toString(); sks = ks.toString();
} }
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
if(sks.contains("Alt+Tab") || sks.contains("Alt+Shift+Backtab")) if(sks.contains("Alt+Tab") || sks.contains("Alt+Backtab"))
break; break;
#else #else
sks.replace("Meta", "Ctrl"); sks.replace("Meta", "Ctrl");

View file

@ -36,7 +36,7 @@ class filter : public QObject
Q_OBJECT Q_OBJECT
private: private:
bool m_tabPressed; bool m_tabPressed;
bool m_backtabPressed;
public: public:
explicit filter(QObject *parent = 0); explicit filter(QObject *parent = 0);

View file

@ -124,12 +124,13 @@ ApplicationWindow {
else if(middlePanel.state === "Settings") middlePanel.state = "Dashboard" else if(middlePanel.state === "Settings") middlePanel.state = "Dashboard"
*/ */
if(middlePanel.state === "Settings") middlePanel.state = "Transfer" if(middlePanel.state === "Settings") middlePanel.state = "Transfer"
else if(middlePanel.state === "Transfer") middlePanel.state = "Receive" else if(middlePanel.state === "Transfer") middlePanel.state = "AddressBook"
else if(middlePanel.state === "Receive") middlePanel.state = "TxKey" else if(middlePanel.state === "AddressBook") middlePanel.state = "Receive"
else if(middlePanel.state === "Receive") middlePanel.state = "History"
else if(middlePanel.state === "History") middlePanel.state = "Mining"
else if(middlePanel.state === "Mining") middlePanel.state = "TxKey"
else if(middlePanel.state === "TxKey") middlePanel.state = "SharedRingDB" else if(middlePanel.state === "TxKey") middlePanel.state = "SharedRingDB"
else if(middlePanel.state === "SharedRingDB") middlePanel.state = "History" else if(middlePanel.state === "SharedRingDB") middlePanel.state = "Sign"
else if(middlePanel.state === "History") middlePanel.state = "AddressBook"
else if(middlePanel.state === "AddressBook") middlePanel.state = "Sign"
else if(middlePanel.state === "Sign") middlePanel.state = "Settings" else if(middlePanel.state === "Sign") middlePanel.state = "Settings"
} else if(seq === "Ctrl+Shift+Backtab" || seq === "Alt+Shift+Backtab") { } else if(seq === "Ctrl+Shift+Backtab" || seq === "Alt+Shift+Backtab") {
/* /*
@ -145,12 +146,13 @@ ApplicationWindow {
else if(middlePanel.state === "Transfer") middlePanel.state = "Dashboard" else if(middlePanel.state === "Transfer") middlePanel.state = "Dashboard"
*/ */
if(middlePanel.state === "Settings") middlePanel.state = "Sign" if(middlePanel.state === "Settings") middlePanel.state = "Sign"
else if(middlePanel.state === "Sign") middlePanel.state = "AddressBook" else if(middlePanel.state === "Sign") middlePanel.state = "SharedRingDB"
else if(middlePanel.state === "AddressBook") middlePanel.state = "History"
else if(middlePanel.state === "History") middlePanel.state = "SharedRingDB"
else if(middlePanel.state === "SharedRingDB") middlePanel.state = "TxKey" else if(middlePanel.state === "SharedRingDB") middlePanel.state = "TxKey"
else if(middlePanel.state === "TxKey") middlePanel.state = "Receive" else if(middlePanel.state === "TxKey") middlePanel.state = "Mining"
else if(middlePanel.state === "Receive") middlePanel.state = "Transfer" else if(middlePanel.state === "Mining") middlePanel.state = "History"
else if(middlePanel.state === "History") middlePanel.state = "Receive"
else if(middlePanel.state === "Receive") middlePanel.state = "AddressBook"
else if(middlePanel.state === "AddressBook") middlePanel.state = "Transfer"
else if(middlePanel.state === "Transfer") middlePanel.state = "Settings" else if(middlePanel.state === "Transfer") middlePanel.state = "Settings"
} }