summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-23 23:38:53 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-23 23:38:53 (GMT)
commita539ed4b8cb57472407c96e57a055666c07aa97b (patch)
tree2e941ca43d30a4df9593f1e88841b3067eb463cd
parent439739d980a6bb8b8a65156cbbac97af6fb7c831 (diff)
allow to have one splitter full-size
-rw-r--r--kate/data/kateui.rc6
-rw-r--r--kate/src/kateviewmanager.cpp40
-rw-r--r--kate/src/kateviewmanager.h8
-rw-r--r--kate/src/kateviewspace.cpp2
4 files changed, 55 insertions, 1 deletions
diff --git a/kate/data/kateui.rc b/kate/data/kateui.rc
index 84d9444..a4ec482 100644
--- a/kate/data/kateui.rc
+++ b/kate/data/kateui.rc
@@ -1,5 +1,5 @@
<!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" />
diff --git a/kate/src/kateviewmanager.cpp b/kate/src/kateviewmanager.cpp
index ed2ffbe..47a1123 100644
--- a/kate/src/kateviewmanager.cpp
+++ b/kate/src/kateviewmanager.cpp
@@ -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
*/
diff --git a/kate/src/kateviewmanager.h b/kate/src/kateviewmanager.h
index a94f8b1..ed40530 100644
--- a/kate/src/kateviewmanager.h
+++ b/kate/src/kateviewmanager.h
@@ -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;
diff --git a/kate/src/kateviewspace.cpp b/kate/src/kateviewspace.cpp
index f0337c0..2976ab1 100644
--- a/kate/src/kateviewspace.cpp
+++ b/kate/src/kateviewspace.cpp
@@ -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);