Commit 7cfbb8bb authored by Gaston Haro's avatar Gaston Haro 🎨 Committed by Kurt Hindenburg
Browse files

Better accesibility to maximize view

Summary:
- Added handlig of mouse double click on view header bar to toggle
  maximize.
- Added menu entry under View -> Split view, Toogle maximize view

Test plan:
A.1. Open Konsole and create split views
A.2. Double clicking a view header should toggle maximize/restore the view
B.1. Open Konsole and create split views
B.2. Go to menu View -> Split view -> Toggle maximize view
parent 97037da1
<!DOCTYPE kpartgui>
<kpartgui name="konsole" version="11">
<kpartgui name="konsole" version="12">
<MenuBar>
<Menu name="file"><text>File</text>
<Action name="new-window"/>
......@@ -23,6 +23,7 @@
<Action name="close-other-views"/>
<Action name="expand-active-view"/>
<Action name="shrink-active-view"/>
<Action name="toggle-maximize-current-view"/>
</Menu>
<Separator/>
<Action name="detach-tab" />
......
......@@ -115,6 +115,14 @@ TerminalHeaderBar::TerminalHeaderBar(QWidget *parent)
setFocusIndicatorState(false);
}
void TerminalHeaderBar::mouseDoubleClickEvent(QMouseEvent *ev)
{
if (ev->button() != Qt::LeftButton) {
return;
}
m_toggleExpandedMode->click();
}
// Hack untill I can detangle the creation of the TerminalViews
void TerminalHeaderBar::finishHeaderSetup(ViewProperties *properties)
{
......
......@@ -53,6 +53,7 @@ protected:
void mousePressEvent(QMouseEvent *ev) override;
void mouseReleaseEvent(QMouseEvent *ev) override;
void mouseMoveEvent(QMouseEvent *ev) override;
void mouseDoubleClickEvent(QMouseEvent *ev) override;
Q_SIGNALS:
void requestToggleExpansion();
......
......@@ -221,8 +221,10 @@ void ViewManager::setupActions()
collection->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_Tab);
connect(action, &QAction::triggered, this, &ViewManager::lastUsedViewReverse);
action = new QAction(i18nc("@action Shortcut entry", "Maximize current Terminal"), this);
collection->addAction(QStringLiteral("maximize-current-terminal"), action);
action = new QAction(i18nc("@action Shortcut entry", "Toggle maximize current view"), this);
action->setText(i18nc("@action:inmenu", "Toggle maximize current view"));
action->setIcon(QIcon::fromTheme(QStringLiteral("view-fullscreen")));
collection->addAction(QStringLiteral("toggle-maximize-current-view"), action);
collection->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_E);
connect(action, &QAction::triggered, _viewContainer, &TabbedViewContainer::toggleMaximizeCurrentTerminal);
_multiSplitterOnlyActions << action;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment