diff --git a/widgets/frame.cpp b/widgets/frame.cpp index 84e0b73fa..7d4aa5b90 100644 --- a/widgets/frame.cpp +++ b/widgets/frame.cpp @@ -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) diff --git a/widgets/frame.h b/widgets/frame.h index 0fb305e27..fe908f0e0 100644 --- a/widgets/frame.h +++ b/widgets/frame.h @@ -23,6 +23,7 @@ #include #include +#include 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);