X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/31fc08fe7ff06d8660624a360a52c7f9af2854a4..830dd0148a26d91ba7f3e0316da1e021fe2b83e4:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index af217eab4..e3591bcaf 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -119,6 +119,7 @@ DolphinMainWindow::DolphinMainWindow() , m_sessionSaveWatcher(nullptr) , m_sessionSaveScheduled(false) , m_splitViewAction(nullptr) + , m_splitViewMenuAction(nullptr) { Q_INIT_RESOURCE(dolphin); @@ -1832,14 +1833,21 @@ void DolphinMainWindow::setupActions() // (note that most of it is set up in DolphinViewActionHandler) m_splitViewAction = actionCollection()->add(QStringLiteral("split_view")); + m_splitViewMenuAction = actionCollection()->addAction(QStringLiteral("split_view_menu")); + m_splitViewAction->setWhatsThis(xi18nc("@info:whatsthis find", "This splits " "the folder view below into two autonomous views.This " "way you can see two locations at once and move items between them " "quickly.Click this again afterwards to recombine the views.")); + m_splitViewMenuAction->setWhatsThis(m_splitViewAction->whatsThis()); + + // only set it for the menu version + actionCollection()->setDefaultShortcut(m_splitViewMenuAction, Qt::Key_F3); + m_splitViewAction->setPopupMode(QToolButton::MenuButtonPopup); - actionCollection()->setDefaultShortcut(m_splitViewAction, Qt::Key_F3); connect(m_splitViewAction, &QAction::triggered, this, &DolphinMainWindow::toggleSplitView); + connect(m_splitViewMenuAction, &QAction::triggered, this, &DolphinMainWindow::toggleSplitView); QAction *popoutSplit = actionCollection()->addAction(QStringLiteral("popout_split_view")); popoutSplit->setWhatsThis(xi18nc("@info:whatsthis", @@ -2552,6 +2560,11 @@ void DolphinMainWindow::updateSplitActions() popoutSplitAction->setText(i18nc("@action:intoolbar Move active split view to a new window", "Pop out")); popoutSplitAction->setEnabled(false); } + + // Update state from toolbar action + m_splitViewMenuAction->setText(m_splitViewAction->text()); + m_splitViewMenuAction->setToolTip(m_splitViewAction->toolTip()); + m_splitViewMenuAction->setIcon(m_splitViewAction->icon()); } void DolphinMainWindow::updateAllowedToolbarAreas()