Commit 45733c04 authored by Carlos Alves's avatar Carlos Alves Committed by Kurt Hindenburg

Fix Maximize current Terminal (Keyboard vs Mouse)

It checks if the toggle is minimized to let it rearrange.
But Keyboard shortcut did not toggle the button.

BUG: 418498
FIXED-IN: 20.08.3

Cherry-pick from 6878f437
parent 0516650a
......@@ -2720,6 +2720,11 @@ void TerminalDisplay::getCharacterPosition(const QPoint& widgetPoint, int& line,
line = qBound(0, (widgetPoint.y() - contentsRect().top() - _contentRect.top()) / _fontHeight, _usedLines - 1);
}
void TerminalDisplay::setExpandedMode(bool expand)
{
_headerBar->setExpandedMode(expand);
}
void TerminalDisplay::updateLineProperties()
{
if (_screenWindow.isNull()) {
......
......@@ -378,6 +378,9 @@ public:
return _hasCompositeFocus;
}
// toggle the header bar Minimize/Maximize button.
void setExpandedMode(bool expand);
public Q_SLOTS:
/**
* Scrolls current ScreenWindow
......
......@@ -185,6 +185,13 @@ void TerminalHeaderBar::updateSpecialState(ViewProperties *item)
}
}
void TerminalHeaderBar::setExpandedMode(bool expand)
{
if (m_toggleExpandedMode->isChecked() != expand) {
m_toggleExpandedMode->setChecked(expand);
}
}
void TerminalHeaderBar::paintEvent(QPaintEvent *paintEvent)
{
/* Try to get the widget that's 10px above this one.
......
......@@ -44,6 +44,7 @@ public:
QSize minimumSizeHint() const override;
void applyVisibilitySettings();
QSplitter *getTopLevelSplitter();
void setExpandedMode(bool expand);
public Q_SLOTS:
void setFocusIndicatorState(bool focused);
......
......@@ -270,6 +270,7 @@ void ViewSplitter::handleMinimizeMaximize(bool maximize)
{
auto topLevelSplitter = getToplevelSplitter();
auto currentTerminalDisplay = topLevelSplitter->activeTerminalDisplay();
currentTerminalDisplay->setExpandedMode(maximize);
if (maximize) {
for (int i = 0, end = topLevelSplitter->count(); i < end; i++) {
auto widgetAt = topLevelSplitter->widget(i);
......
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