Commit 6878f437 authored by Carlos Alves's avatar Carlos Alves
Browse files

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
parent da301485
......@@ -1814,6 +1814,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()) {
......
......@@ -376,6 +376,9 @@ public:
// a character which left edge is closest to the point.
void getCharacterPosition(const QPoint &widgetPoint, int &line, int &column, bool edge) const;
// toggle the header bar Minimize/Maximize button.
void setExpandedMode(bool expand);
friend class TerminalPainter;
friend class TerminalScrollBar;
......
......@@ -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