diff --git a/src/shell/panelview.cpp b/src/shell/panelview.cpp index 429b22044..fb4f56048 100644 --- a/src/shell/panelview.cpp +++ b/src/shell/panelview.cpp @@ -126,6 +126,19 @@ KConfigGroup PanelView::config() const } } +void PanelView::maximize() +{ + int length; + if (containment()->formFactor() == Plasma::Types::Vertical) { + length = screen()->size().height(); + } else { + length = screen()->size().width(); + } + setOffset(0); + setMinimumLength(length); + setMaximumLength(length); +} + Qt::Alignment PanelView::alignment() const { return m_alignment; diff --git a/src/shell/panelview.h b/src/shell/panelview.h index cef08203c..69de7c112 100644 --- a/src/shell/panelview.h +++ b/src/shell/panelview.h @@ -54,6 +54,8 @@ public: virtual KConfigGroup config() const; + Q_INVOKABLE void maximize(); + Qt::Alignment alignment() const; void setAlignment(Qt::Alignment alignment);