ctrl+shift+tab, switch pages in Leftpanel reverse order

This commit is contained in:
pazos 2018-05-11 22:30:40 +02:00
parent 827c80d4d8
commit 2bbd5c6814
3 changed files with 22 additions and 10 deletions

View file

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

View file

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

View file

@ -146,12 +146,13 @@ ApplicationWindow {
else if(middlePanel.state === "Transfer") middlePanel.state = "Dashboard"
*/
if(middlePanel.state === "Settings") middlePanel.state = "Sign"
else if(middlePanel.state === "Sign") middlePanel.state = "AddressBook"
else if(middlePanel.state === "AddressBook") middlePanel.state = "History"
else if(middlePanel.state === "History") middlePanel.state = "SharedRingDB"
else if(middlePanel.state === "Sign") middlePanel.state = "SharedRingDB"
else if(middlePanel.state === "SharedRingDB") middlePanel.state = "TxKey"
else if(middlePanel.state === "TxKey") middlePanel.state = "Receive"
else if(middlePanel.state === "Receive") middlePanel.state = "Transfer"
else if(middlePanel.state === "TxKey") middlePanel.state = "Mining"
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"
}