diff --git a/clients/plastik/plastikbutton.cpp b/clients/plastik/plastikbutton.cpp index ec719ecc94..b44eee80cc 100644 --- a/clients/plastik/plastikbutton.cpp +++ b/clients/plastik/plastikbutton.cpp @@ -64,7 +64,7 @@ PlastikButton::PlastikButton(PlastikClient *parent, const char *name, int size, bool toggle, int btns) : QButton(parent->widget(), name), m_client(parent), - m_lastMouse(0), + m_lastMouse(NoButton), m_realizeButtons(btns), m_size(size), m_type(type), diff --git a/clients/plastik/plastikbutton.h b/clients/plastik/plastikbutton.h index e7d709df55..492128cae0 100644 --- a/clients/plastik/plastikbutton.h +++ b/clients/plastik/plastikbutton.h @@ -41,7 +41,7 @@ public: ~PlastikButton(); QSize sizeHint() const; ///< Return size hint. - int lastMousePress() const { return m_lastMouse; } + ButtonState lastMousePress() const { return m_lastMouse; } void reset() { repaint(false); } PlastikClient * client() { return m_client; } virtual void setOn(bool on); @@ -61,7 +61,7 @@ private: private: PlastikClient *m_client; - int m_lastMouse; + ButtonState m_lastMouse; int m_realizeButtons; int m_size; diff --git a/clients/plastik/plastikclient.cpp b/clients/plastik/plastikclient.cpp index 3a351d3453..3395424755 100644 --- a/clients/plastik/plastikclient.cpp +++ b/clients/plastik/plastikclient.cpp @@ -797,17 +797,7 @@ void PlastikClient::slotMaximize() { if (m_button[MaxButton]) { - switch (m_button[MaxButton]->lastMousePress()) - { - case MidButton: - maximize(maximizeMode() ^ MaximizeVertical ); - break; - case RightButton: - maximize(maximizeMode() ^ MaximizeHorizontal ); - break; - default: - maximize(maximizeMode() == MaximizeFull ? MaximizeRestore : MaximizeFull ); - } + maximize(m_button[MaxButton]->lastMousePress() ); doShape(); } }