mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Merge pull request #1282 from kdave/single-key-shortcut-v2
[BrowserWindow] Enable single key shortcuts
This commit is contained in:
commit
4c812557f6
|
@ -407,6 +407,7 @@ void BrowserWindow::loadSettings()
|
||||||
settings.beginGroup("Shortcuts");
|
settings.beginGroup("Shortcuts");
|
||||||
m_useTabNumberShortcuts = settings.value("useTabNumberShortcuts", true).toBool();
|
m_useTabNumberShortcuts = settings.value("useTabNumberShortcuts", true).toBool();
|
||||||
m_useSpeedDialNumberShortcuts = settings.value("useSpeedDialNumberShortcuts", true).toBool();
|
m_useSpeedDialNumberShortcuts = settings.value("useSpeedDialNumberShortcuts", true).toBool();
|
||||||
|
m_useSingleKeyShortcuts = settings.value("useSingleKeyShortcuts", false).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
m_adblockIcon->setEnabled(settings.value("AdBlock/enabled", true).toBool());
|
m_adblockIcon->setEnabled(settings.value("AdBlock/enabled", true).toBool());
|
||||||
|
@ -1331,6 +1332,12 @@ void BrowserWindow::keyPressEvent(QKeyEvent* event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (event->modifiers() == Qt::NoModifier && m_useSingleKeyShortcuts) {
|
||||||
|
if (number == 1)
|
||||||
|
m_tabWidget->previousTab();
|
||||||
|
if (number == 2)
|
||||||
|
m_tabWidget->nextTab();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QMainWindow::keyPressEvent(event);
|
QMainWindow::keyPressEvent(event);
|
||||||
|
|
|
@ -207,6 +207,7 @@ private:
|
||||||
// Shortcuts
|
// Shortcuts
|
||||||
bool m_useTabNumberShortcuts;
|
bool m_useTabNumberShortcuts;
|
||||||
bool m_useSpeedDialNumberShortcuts;
|
bool m_useSpeedDialNumberShortcuts;
|
||||||
|
bool m_useSingleKeyShortcuts;
|
||||||
|
|
||||||
// Remember visibility of menubar and statusbar after entering Fullscreen
|
// Remember visibility of menubar and statusbar after entering Fullscreen
|
||||||
bool m_menuBarVisible;
|
bool m_menuBarVisible;
|
||||||
|
|
|
@ -380,6 +380,7 @@ Preferences::Preferences(BrowserWindow* window, QWidget* parent)
|
||||||
settings.beginGroup("Shortcuts");
|
settings.beginGroup("Shortcuts");
|
||||||
ui->switchTabsAlt->setChecked(settings.value("useTabNumberShortcuts", true).toBool());
|
ui->switchTabsAlt->setChecked(settings.value("useTabNumberShortcuts", true).toBool());
|
||||||
ui->loadSpeedDialsCtrl->setChecked(settings.value("useSpeedDialNumberShortcuts", true).toBool());
|
ui->loadSpeedDialsCtrl->setChecked(settings.value("useSpeedDialNumberShortcuts", true).toBool());
|
||||||
|
ui->singleKeyShortcuts->setChecked(settings.value("useSingleKeyShortcuts", false).toBool());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//NOTIFICATIONS
|
//NOTIFICATIONS
|
||||||
|
@ -964,6 +965,7 @@ void Preferences::saveSettings()
|
||||||
settings.beginGroup("Shortcuts");
|
settings.beginGroup("Shortcuts");
|
||||||
settings.setValue("useTabNumberShortcuts", ui->switchTabsAlt->isChecked());
|
settings.setValue("useTabNumberShortcuts", ui->switchTabsAlt->isChecked());
|
||||||
settings.setValue("useSpeedDialNumberShortcuts", ui->loadSpeedDialsCtrl->isChecked());
|
settings.setValue("useSpeedDialNumberShortcuts", ui->loadSpeedDialsCtrl->isChecked());
|
||||||
|
settings.setValue("useSingleKeyShortcuts", ui->singleKeyShortcuts->isChecked());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//BROWSING
|
//BROWSING
|
||||||
|
|
|
@ -1987,7 +1987,14 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="4" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="singleKeyShortcuts">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use single key shortcuts (1 - prev tab, 2 - next tab)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
<spacer name="verticalSpacer_13">
|
<spacer name="verticalSpacer_13">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user