From acd0f2fc781612e4d7df70de0caddc7da20ee6c3 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Mon, 10 Jun 2019 16:44:01 -0400 Subject: [PATCH] Do not show both 'hide' and 'close' options on tabs for child buffers. We can only close it (as opposed to hide it) if it's not a child. Part of #11331. --- src/frontends/qt4/GuiWorkArea.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index cb3f71f9f0..001056df72 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -2090,12 +2090,19 @@ void TabWorkArea::showContextMenu(const QPoint & pos) if (clicked_tab_ == -1) return; + GuiWorkArea * wa = workArea(clicked_tab_); + LASSERT(wa, return); + // show tab popup QMenu popup; popup.addAction(QIcon(getPixmap("images/", "hidetab", "svgz,png")), qt_("Hide tab"), this, SLOT(hideCurrentTab())); - popup.addAction(QIcon(getPixmap("images/", "closetab", "svgz,png")), - qt_("Close tab"), this, SLOT(closeCurrentBuffer())); + + // we want to show the 'close' option only if this is not a child buffer. + Buffer const & buf = wa->bufferView().buffer(); + if (!buf.parent()) + popup.addAction(QIcon(getPixmap("images/", "closetab", "svgz,png")), + qt_("Close tab"), this, SLOT(closeCurrentBuffer())); popup.exec(tabBar()->mapToGlobal(pos)); clicked_tab_ = -1; -- 2.39.2