[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdeplasma-addons] applets/comic: ButtonBar takes a QGraphicsWidget as parent.
From: Matthias Fuchs <mat69 () gmx ! net>
Date: 2012-02-02 19:35:44
Message-ID: 20120202193544.3CAB9A60A6 () git ! kde ! org
[Download RAW message or body]
Git commit 00e6937eb05c92356887cef858c24e7681c733a0 by Matthias Fuchs.
Committed on 01/02/2012 at 23:49.
Pushed by mfuchs into branch 'master'.
ButtonBar takes a QGraphicsWidget as parent.
M +2 -3 applets/comic/buttonbar.cpp
M +4 -5 applets/comic/buttonbar.h
M +2 -2 applets/comic/comic.cpp
http://commits.kde.org/kdeplasma-addons/00e6937eb05c92356887cef858c24e7681c733a0
diff --git a/applets/comic/buttonbar.cpp b/applets/comic/buttonbar.cpp
index 223a329..bb4dbef 100644
--- a/applets/comic/buttonbar.cpp
+++ b/applets/comic/buttonbar.cpp
@@ -29,10 +29,10 @@
#include <QtGui/QGraphicsLinearLayout>
#include <QtCore/QPropertyAnimation>
-ButtonBar::ButtonBar(QObject *parent)
+ButtonBar::ButtonBar(QGraphicsWidget *parent)
: QObject(parent)
{
- mFrame = new Plasma::Frame();
+ mFrame = new Plasma::Frame(parent);
mFrame->setZValue(10);
QGraphicsLinearLayout *l = new QGraphicsLinearLayout();
mPrev = new Plasma::PushButton(mFrame);
@@ -70,7 +70,6 @@ ButtonBar::ButtonBar(QObject *parent)
ButtonBar::~ButtonBar()
{
- delete mFrame;
}
QSizeF ButtonBar::size() const
diff --git a/applets/comic/buttonbar.h b/applets/comic/buttonbar.h
index ceba2e8..d4020bb 100644
--- a/applets/comic/buttonbar.h
+++ b/applets/comic/buttonbar.h
@@ -25,6 +25,7 @@
class QPointF;
class QPropertyAnimation;
+class QGraphicsWidget;
namespace Plasma {
class Frame;
@@ -46,7 +47,7 @@ class ButtonBar : public QObject
* @note the button bar is hidden by default and has no
* position associated with it
*/
- explicit ButtonBar(QObject *parent);
+ explicit ButtonBar(QGraphicsWidget *parent);
~ButtonBar();
QSizeF size() const;
@@ -58,14 +59,12 @@ class ButtonBar : public QObject
void setPos(const QPointF &pos);
/**
- * Will fade in the button bar if it was hidden
- * TODO the hidden part
+ * Will fade in the button bar
*/
void show();
/**
- * Will fade out the button bar if it was visible
- * TODO the visible part
+ * Will fade out the button bar
*/
void hide();
diff --git a/applets/comic/comic.cpp b/applets/comic/comic.cpp
index a32d172..ef565e5 100644
--- a/applets/comic/comic.cpp
+++ b/applets/comic/comic.cpp
@@ -1159,13 +1159,13 @@ void ComicApplet::buttonBar()
{
if (mArrowsOnHover) {
if (!mButtonBar) {
- mButtonBar = new ButtonBar(this);
+ mButtonBar = new ButtonBar(mMainWidget);
connect(mButtonBar, SIGNAL(prevClicked()), this, SLOT(slotPreviousDay()));
connect(mButtonBar, SIGNAL(nextClicked()), this, SLOT(slotNextDay()));
connect(mButtonBar, SIGNAL(zoomClicked()), this, SLOT(fullView()));
// Set frame position
- constraintsEvent( Plasma::SizeConstraint );
+ constraintsEvent(Plasma::SizeConstraint);
}
} else {
delete mButtonBar;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic