mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-16 15:58:11 +00:00
ctrl+shift+tab, switch pages in Leftpanel reverse order
This commit is contained in:
parent
827c80d4d8
commit
2bbd5c6814
3 changed files with 22 additions and 10 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);
|
||||||
|
|
||||||
|
|
11
main.qml
11
main.qml
|
@ -146,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