mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
[TabBar] Added option to always switch tabs using mouse wheel
It will switch tabs even when tabs are overflowing.
This commit is contained in:
parent
bfe9331579
commit
7cb39aed0b
@ -57,6 +57,7 @@ void QzSettings::loadSettings()
|
|||||||
settings.beginGroup("Browser-Tabs-Settings");
|
settings.beginGroup("Browser-Tabs-Settings");
|
||||||
newTabPosition = settings.value("OpenNewTabsSelected", false).toBool() ? Qz::NT_SelectedTab : Qz::NT_NotSelectedTab;
|
newTabPosition = settings.value("OpenNewTabsSelected", false).toBool() ? Qz::NT_SelectedTab : Qz::NT_NotSelectedTab;
|
||||||
tabsOnTop = settings.value("TabsOnTop", false).toBool();
|
tabsOnTop = settings.value("TabsOnTop", false).toBool();
|
||||||
|
alwaysSwitchTabsWithWheel = settings.value("AlwaysSwitchTabsWithWheel", false).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ public:
|
|||||||
// Browser-Tabs-Settings
|
// Browser-Tabs-Settings
|
||||||
Qz::NewTabPositionFlag newTabPosition;
|
Qz::NewTabPositionFlag newTabPosition;
|
||||||
bool tabsOnTop;
|
bool tabsOnTop;
|
||||||
|
bool alwaysSwitchTabsWithWheel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define qzSettings Settings::staticSettings()
|
#define qzSettings Settings::staticSettings()
|
||||||
|
@ -228,6 +228,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
|
|||||||
ui->activateLastTab->setChecked(settings.value("ActivateLastTabWhenClosingActual", false).toBool());
|
ui->activateLastTab->setChecked(settings.value("ActivateLastTabWhenClosingActual", false).toBool());
|
||||||
ui->openNewTabAfterActive->setChecked(settings.value("newTabAfterActive", true).toBool());
|
ui->openNewTabAfterActive->setChecked(settings.value("newTabAfterActive", true).toBool());
|
||||||
ui->openNewEmptyTabAfterActive->setChecked(settings.value("newEmptyTabAfterActive", false).toBool());
|
ui->openNewEmptyTabAfterActive->setChecked(settings.value("newEmptyTabAfterActive", false).toBool());
|
||||||
|
ui->alwaysSwitchTabsWithWheel->setChecked(settings.value("AlwaysSwitchTabsWithWheel", false).toBool());
|
||||||
ui->switchToNewTabs->setChecked(settings.value("OpenNewTabsSelected", false).toBool());
|
ui->switchToNewTabs->setChecked(settings.value("OpenNewTabsSelected", false).toBool());
|
||||||
ui->dontQuitOnTab->setChecked(settings.value("dontQuitWithOneTab", false).toBool());
|
ui->dontQuitOnTab->setChecked(settings.value("dontQuitWithOneTab", false).toBool());
|
||||||
ui->askWhenClosingMultipleTabs->setChecked(settings.value("AskOnClosing", false).toBool());
|
ui->askWhenClosingMultipleTabs->setChecked(settings.value("AskOnClosing", false).toBool());
|
||||||
@ -901,6 +902,7 @@ void Preferences::saveSettings()
|
|||||||
settings.setValue("ActivateLastTabWhenClosingActual", ui->activateLastTab->isChecked());
|
settings.setValue("ActivateLastTabWhenClosingActual", ui->activateLastTab->isChecked());
|
||||||
settings.setValue("newTabAfterActive", ui->openNewTabAfterActive->isChecked());
|
settings.setValue("newTabAfterActive", ui->openNewTabAfterActive->isChecked());
|
||||||
settings.setValue("newEmptyTabAfterActive", ui->openNewEmptyTabAfterActive->isChecked());
|
settings.setValue("newEmptyTabAfterActive", ui->openNewEmptyTabAfterActive->isChecked());
|
||||||
|
settings.setValue("AlwaysSwitchTabsWithWheel", ui->alwaysSwitchTabsWithWheel->isChecked());
|
||||||
settings.setValue("OpenNewTabsSelected", ui->switchToNewTabs->isChecked());
|
settings.setValue("OpenNewTabsSelected", ui->switchToNewTabs->isChecked());
|
||||||
settings.setValue("dontQuitWithOneTab", ui->dontQuitOnTab->isChecked());
|
settings.setValue("dontQuitWithOneTab", ui->dontQuitOnTab->isChecked());
|
||||||
settings.setValue("AskOnClosing", ui->askWhenClosingMultipleTabs->isChecked());
|
settings.setValue("AskOnClosing", ui->askWhenClosingMultipleTabs->isChecked());
|
||||||
|
@ -728,6 +728,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="alwaysSwitchTabsWithWheel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Always switch between tabs with mouse wheel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="switchToNewTabs">
|
<widget class="QCheckBox" name="switchToNewTabs">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "toolbutton.h"
|
#include "toolbutton.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "proxystyle.h"
|
#include "proxystyle.h"
|
||||||
|
#include "qzsettings.h"
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
@ -535,6 +536,12 @@ int ComboTabBar::pinTabBarWidth() const
|
|||||||
void ComboTabBar::wheelEvent(QWheelEvent* event)
|
void ComboTabBar::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
event->accept();
|
event->accept();
|
||||||
|
|
||||||
|
if (qzSettings->alwaysSwitchTabsWithWheel) {
|
||||||
|
setCurrentNextEnabledIndex(event->delta() > 0 ? -1 : 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_mainTabBarWidget->underMouse()) {
|
if (m_mainTabBarWidget->underMouse()) {
|
||||||
if (m_mainTabBarWidget->scrollBar()->isOverFlowed()) {
|
if (m_mainTabBarWidget->scrollBar()->isOverFlowed()) {
|
||||||
m_mainTabBarWidget->scrollByWheel(event);
|
m_mainTabBarWidget->scrollByWheel(event);
|
||||||
|
Loading…
Reference in New Issue
Block a user