plasma-framework/private/desktoptoolbox_p.h
Aaron J. Seigo 50726d7f08 rework the toolboxes so that they actually mesh with the API of AbstractToolBox:
* have setShowing call the show/hide feature, not the other way around (fixes bug 202549)
* put the actions in order by the tags applied so that things appear ordered
* allow the toolbox to define what the parent of the tools should be (so the desktop toolbox can use the backing as the parent)
* use a layout in the desktop toolbox background that the tools are in; waaaaaay simpler code as a result
* keep only one svg object around for the desktop toolbox background, not two
* use a QtKinetic animation for the show/hide

i'm not happy with the precise positioning of the desktop toolbox nor with the animation (just a fade in/out right now.. meh) but the hard work is done with this commit and the rest is twiddling (which i'll do in the coming days)
BUG:202549

svn path=/trunk/KDE/kdelibs/; revision=1069706
2010-01-04 06:41:43 +00:00

85 lines
2.1 KiB
C++

/*
* Copyright 2007 by Aaron Seigo <aseigo@kde.org>
* Copyright 2008 by Marco Martin <notmart@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef PLASMA_DESKTOPTOOLBOX_P_H
#define PLASMA_DESKTOPTOOLBOX_P_H
#include <QGraphicsItem>
#include <QObject>
#include <QTime>
#include <kicon.h>
#include <private/internaltoolbox_p.h>
#include "animator.h"
namespace Plasma
{
class Widget;
class EmptyGraphicsItem;
class DesktopToolBoxPrivate;
class DesktopToolBox : public InternalToolBox
{
Q_OBJECT
public:
explicit DesktopToolBox(Containment *parent = 0);
~DesktopToolBox();
QRectF boundingRect() const;
QPainterPath shape() const;
void showToolBox();
void hideToolBox();
QSize cornerSize() const;
QSize fullWidth() const;
QSize fullHeight() const;
QGraphicsWidget *toolParent();
public Q_SLOTS:
void toolTipAboutToShow();
void toolTipHidden();
protected:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
protected Q_SLOTS:
void animateHighlight(qreal progress);
void updateTheming();
void toolTriggered(bool);
void hideToolBacker();
/**
* show/hide the toolbox
*/
void toggle();
private:
DesktopToolBoxPrivate *d;
};
} // Plasma namespace
#endif // multiple inclusion guard