mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-24 12:39:25 +00:00
Merge pull request #1379
827c80d
ctrl+tab switch pages in the same order as leftpanel2bbd5c6
ctrl+shift+tab, switch pages in Leftpanel reverse order
This commit is contained in:
commit
b6a7836447
3 changed files with 28 additions and 15 deletions
19
filter.cpp
19
filter.cpp
|
@ -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");
|
||||||
|
|
2
filter.h
2
filter.h
|
@ -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);
|
||||||
|
|
||||||
|
|
22
main.qml
22
main.qml
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue