Only enable maximize terminal button in split header bar when usable

Disable the maximize terminal button when there is only one split
in a tab.

BUG: 435029
wilder
Alfonso Murolo 4 years ago committed by Kurt Hindenburg
parent 5b1f3c6ddb
commit 1a89e3baae
  1. 5
      src/widgets/TerminalHeaderBar.cpp

@ -278,12 +278,14 @@ void TerminalHeaderBar::applyVisibilitySettings()
{
auto *settings = KonsoleSettings::self();
auto toVisibility = settings->splitViewVisibility();
const bool singleTerminalView = (getTopLevelSplitter()->findChildren<TerminalDisplay *>().count() == 1);
switch (toVisibility) {
case KonsoleSettings::AlwaysShowSplitHeader:
m_toggleExpandedMode->setDisabled(singleTerminalView);
setVisible(true);
break;
case KonsoleSettings::ShowSplitHeaderWhenNeeded: {
const bool visible = !(getTopLevelSplitter()->findChildren<TerminalDisplay *>().count() == 1);
const bool visible = !(singleTerminalView);
setVisible(visible);
} break;
case KonsoleSettings::AlwaysHideSplitHeader:
@ -293,4 +295,5 @@ void TerminalHeaderBar::applyVisibilitySettings()
}
}
}

Loading…
Cancel
Save