Commit a539ed4b authored by Christoph Cullmann's avatar Christoph Cullmann

allow to have one splitter full-size

parent 439739d9
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kate" version="74">
<kpartgui name="kate" version="75">
<MenuBar>
<Menu name="file" noMerge="1"><text>&amp;File</text>
......@@ -57,9 +57,13 @@
<Separator />
<Action name="view_split_vert"/>
<Action name="view_split_horiz"/>
<Separator />
<Action name="view_close_current_space"/>
<Action name="view_close_others"/>
<Separator />
<Action name="view_hide_others"/>
<Action name="view_show_others"/>
<Separator />
<Action name="view_split_move_left" />
<Action name="view_split_move_right" />
<Action name="view_split_move_up" />
......
......@@ -145,6 +145,20 @@ void KateViewManager::setupActions()
m_closeOtherViews->setWhatsThis(i18n("Close every view but the active one"));
m_hideOtherViews = m_mainWindow->actionCollection()->addAction(QStringLiteral("view_hide_others"));
m_hideOtherViews->setIcon(QIcon::fromTheme(QStringLiteral("view-fullscreen")));
m_hideOtherViews->setText(i18n("Hide Inactive Views"));
connect(m_hideOtherViews, SIGNAL(triggered()), this, SLOT(slotHideOtherViews()), Qt::QueuedConnection);
m_hideOtherViews->setWhatsThis(i18n("Hide every view but the active one"));
m_showOtherViews = m_mainWindow->actionCollection()->addAction(QStringLiteral("view_show_others"));
m_showOtherViews->setIcon(QIcon::fromTheme(QStringLiteral("view-restore")));
m_showOtherViews->setText(i18n("Show Inactive Views"));
connect(m_showOtherViews, SIGNAL(triggered()), this, SLOT(slotShowOtherViews()), Qt::QueuedConnection);
m_showOtherViews->setWhatsThis(i18n("Show the currently not active views"));
goNext = m_mainWindow->actionCollection()->addAction(QStringLiteral("go_next_split_view"));
goNext->setText(i18n("Next Split View"));
goNext->setShortcut(Qt::Key_F8);
......@@ -856,6 +870,32 @@ void KateViewManager::slotCloseOtherViews()
}
}
void KateViewManager::slotHideOtherViews()
{
// avoid flicker
KateUpdateDisabler disableUpdates (mainWindow());
KateViewSpace *active = activeViewSpace();
foreach(KateViewSpace * v, m_viewSpaceList) {
if (active != v) {
v->hide();
}
}
}
void KateViewManager::slotShowOtherViews()
{
// avoid flicker
KateUpdateDisabler disableUpdates (mainWindow());
KateViewSpace *active = activeViewSpace();
foreach(KateViewSpace * v, m_viewSpaceList) {
if (active != v) {
v->show();
}
}
}
/**
* session config functions
*/
......
......@@ -224,6 +224,12 @@ public Q_SLOTS:
/** closes every view but the active one */
void slotCloseOtherViews();
/** hide every view but the active one */
void slotHideOtherViews();
/** show every view but the active one */
void slotShowOtherViews();
void reactivateActiveView();
......@@ -242,6 +248,8 @@ private:
QAction *m_closeView;
QAction *m_closeOtherViews;
QAction *m_hideOtherViews;
QAction *m_showOtherViews;
QAction *goNext;
QAction *goPrev;
......
......@@ -71,6 +71,8 @@ KateViewSpace::KateViewSpace(KateViewManager *viewManager,
split->addAction(m_viewManager->mainWindow()->actionCollection()->action(QStringLiteral("view_split_horiz")));
split->addAction(m_viewManager->mainWindow()->actionCollection()->action(QStringLiteral("view_close_current_space")));
split->addAction(m_viewManager->mainWindow()->actionCollection()->action(QStringLiteral("view_close_others")));
split->addAction(m_viewManager->mainWindow()->actionCollection()->action(QStringLiteral("view_hide_others")));
split->addAction(m_viewManager->mainWindow()->actionCollection()->action(QStringLiteral("view_show_others")));
split->setWhatsThis(i18n("Control view space splitting"));
split->installEventFilter(this); // on click, active this view space
hLayout->addWidget(split);
......
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