REVIEW: 128564
REVIEW: 110970
BUGS: 171743
emit activeViewUrlChanged(newUrl);
}
emit activeViewUrlChanged(newUrl);
}
+void DolphinTabPage::switchActiveView()
+{
+ if (!m_splitViewEnabled) {
+ return;
+ }
+ if (m_primaryViewActive) {
+ m_secondaryViewContainer->setActive(true);
+ } else {
+ m_primaryViewContainer->setActive(true);
+ }
+}
+
DolphinViewContainer* DolphinTabPage::createViewContainer(const QUrl& url) const
{
DolphinViewContainer* container = new DolphinViewContainer(url, m_splitter);
DolphinViewContainer* DolphinTabPage::createViewContainer(const QUrl& url) const
{
DolphinViewContainer* container = new DolphinViewContainer(url, m_splitter);
connect(view, &DolphinView::activated,
this, &DolphinTabPage::slotViewActivated);
connect(view, &DolphinView::activated,
this, &DolphinTabPage::slotViewActivated);
+ connect(view, &DolphinView::toggleActiveViewRequested,
+ this, &DolphinTabPage::switchActiveView);
+
*/
void slotViewUrlRedirection(const QUrl& oldUrl, const QUrl& newUrl);
*/
void slotViewUrlRedirection(const QUrl& oldUrl, const QUrl& newUrl);
+ void switchActiveView();
+
private:
/**
* Creates a new view container and does the default initialization.
private:
/**
* Creates a new view container and does the default initialization.
<label>Show selection toggle</label>
<default>true</default>
</entry>
<label>Show selection toggle</label>
<default>true</default>
</entry>
+ <entry name="UseTabForSwitchingSplitView" type="Bool">
+ <label>Use tab for switching between right and left split</label>
+ <default>false</default>
+ </entry>
<entry name="ShowToolTips" type="Bool">
<label>Show tooltips</label>
<default>false</default>
<entry name="ShowToolTips" type="Bool">
<label>Show tooltips</label>
<default>false</default>
m_naturalSorting(0),
m_caseSensitiveSorting(0),
m_caseInsensitiveSorting(0),
m_naturalSorting(0),
m_caseSensitiveSorting(0),
m_caseInsensitiveSorting(0),
+ m_renameInline(0),
+ m_useTabForSplitViewSwitch(0)
{
QVBoxLayout* topLayout = new QVBoxLayout(this);
{
QVBoxLayout* topLayout = new QVBoxLayout(this);
// 'Inline renaming of items'
m_renameInline = new QCheckBox(i18nc("option:check", "Rename inline"), this);
// 'Inline renaming of items'
m_renameInline = new QCheckBox(i18nc("option:check", "Rename inline"), this);
+ // 'Use tab for switching between right and left split'
+ m_useTabForSplitViewSwitch = new QCheckBox(i18nc("option:check", "Use tab for switching between right and left split view"), this);
+
topLayout->addWidget(viewPropsBox);
topLayout->addWidget(sortingPropsBox);
topLayout->addWidget(m_showToolTips);
topLayout->addWidget(m_showSelectionToggle);
topLayout->addWidget(m_renameInline);
topLayout->addWidget(viewPropsBox);
topLayout->addWidget(sortingPropsBox);
topLayout->addWidget(m_showToolTips);
topLayout->addWidget(m_showSelectionToggle);
topLayout->addWidget(m_renameInline);
+ topLayout->addWidget(m_useTabForSplitViewSwitch);
topLayout->addStretch();
loadSettings();
topLayout->addStretch();
loadSettings();
connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
connect(m_caseSensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
connect(m_caseSensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
+ connect(m_useTabForSplitViewSwitch, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
}
BehaviorSettingsPage::~BehaviorSettingsPage()
}
BehaviorSettingsPage::~BehaviorSettingsPage()
settings->setShowSelectionToggle(m_showSelectionToggle->isChecked());
setSortingChoiceValue(settings);
settings->setRenameInline(m_renameInline->isChecked());
settings->setShowSelectionToggle(m_showSelectionToggle->isChecked());
setSortingChoiceValue(settings);
settings->setRenameInline(m_renameInline->isChecked());
+ settings->setUseTabForSwitchingSplitView(m_useTabForSplitViewSwitch->isChecked());
settings->save();
if (useGlobalViewProps) {
settings->save();
if (useGlobalViewProps) {
m_showToolTips->setChecked(GeneralSettings::showToolTips());
m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle());
m_renameInline->setChecked(GeneralSettings::renameInline());
m_showToolTips->setChecked(GeneralSettings::showToolTips());
m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle());
m_renameInline->setChecked(GeneralSettings::renameInline());
+ m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView());
loadSortingChoiceSettings();
}
loadSortingChoiceSettings();
}
QRadioButton* m_caseInsensitiveSorting;
QCheckBox* m_renameInline;
QRadioButton* m_caseInsensitiveSorting;
QCheckBox* m_renameInline;
+ QCheckBox* m_useTabForSplitViewSwitch;
bool DolphinView::eventFilter(QObject* watched, QEvent* event)
{
switch (event->type()) {
bool DolphinView::eventFilter(QObject* watched, QEvent* event)
{
switch (event->type()) {
+ case QEvent::KeyPress:
+ if (GeneralSettings::useTabForSwitchingSplitView()) {
+ QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
+ if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) {
+ toggleActiveViewRequested();
+ return true;
+ }
+ }
+ break;
case QEvent::FocusIn:
if (watched == m_container) {
setActive(true);
case QEvent::FocusIn:
if (watched == m_container) {
setActive(true);
*/
void goForwardRequested();
*/
void goForwardRequested();
+ /**
+ * Is emitted when the user wants to move the focus to another view.
+ */
+ void toggleActiveViewRequested();
+
protected:
/** Changes the zoom level if Control is pressed during a wheel event. */
virtual void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE;
protected:
/** Changes the zoom level if Control is pressed during a wheel event. */
virtual void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE;