be able to set the borders of the frame to show/paint; one of the things i really dislike about QFrame, now solved in Plasma::Frame

svn path=/trunk/KDE/kdelibs/; revision=1026213
This commit is contained in:
Aaron J. Seigo 2009-09-21 05:29:47 +00:00
parent 7b5f1d4e35
commit 76dfb7c57e
2 changed files with 30 additions and 3 deletions

View File

@ -130,6 +130,20 @@ Frame::Shadow Frame::frameShadow() const
return d->shadow;
}
void Frame::setEnabledBorders(const FrameSvg::EnabledBorders borders)
{
if (borders != d->svg->enabledBorders()) {
d->svg->setEnabledBorders(borders);
d->syncBorders();
update();
}
}
FrameSvg::EnabledBorders Frame::enabledBorders() const
{
return d->svg->enabledBorders();
}
void Frame::setText(QString text)
{
d->text = text;
@ -203,9 +217,7 @@ QWidget *Frame::nativeWidget() const
return 0;
}
void Frame::paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget)
void Frame::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)

View File

@ -23,6 +23,7 @@
#include <QtGui/QGraphicsWidget>
#include <plasma/plasma_export.h>
#include <plasma/framesvg.h>
class QFrame;
@ -75,10 +76,24 @@ public:
*/
Shadow frameShadow() const;
/**
* Sets what borders should be painted
* @arg flags borders we want to paint
*/
void setEnabledBorders(const FrameSvg::EnabledBorders borders);
/**
* Convenience method to get the enabled borders
* @return what borders are painted
* @since 4.4
*/
FrameSvg::EnabledBorders enabledBorders() const;
/**
* Set the text to display by this Frame
*
* @arg text the text
* @since 4.4
*/
void setText(QString text);