From 664fd4167cb9042385e0777ab6f22a5c436238d1 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 12 Feb 2014 17:36:46 +0100 Subject: [PATCH] maximizing the panel actually works --- src/shell/panelview.cpp | 13 +++++++++++++ src/shell/panelview.h | 2 ++ 2 files changed, 15 insertions(+) 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);