diff --git a/dialog.cpp b/dialog.cpp index 0521f2ee2..36a525886 100644 --- a/dialog.cpp +++ b/dialog.cpp @@ -271,7 +271,7 @@ void DialogPrivate::checkBorders(bool updateMaskIfNeeded) } //decide if to disable the other borders - if (!extender && q->isVisible()) { + if (q->isVisible()) { QRect geom; if (applet) { geom = screenGeom; @@ -298,6 +298,15 @@ void DialogPrivate::checkBorders(bool updateMaskIfNeeded) if (!extender) { background->getMargins(leftWidth, topHeight, rightWidth, bottomHeight); + } else { + FrameSvg::EnabledBorders disabledBorders = FrameSvg::NoBorder; + if (!(borders & FrameSvg::LeftBorder)) { + disabledBorders |= FrameSvg::LeftBorder; + } + if (!(borders & FrameSvg::RightBorder)) { + disabledBorders |= FrameSvg::RightBorder; + } + extender->d->setDisabledBordersHint(disabledBorders); } //kDebug() << leftWidth << topHeight << rightWidth << bottomHeight; @@ -313,7 +322,7 @@ void DialogPrivate::checkBorders(bool updateMaskIfNeeded) } q->update(); - } + } resizeChecksWithBorderCheck = false; } diff --git a/extenders/extender.cpp b/extenders/extender.cpp index ef736e6ea..e03536d47 100644 --- a/extenders/extender.cpp +++ b/extenders/extender.cpp @@ -20,6 +20,7 @@ #include "extender.h" #include +#include #include #include #include @@ -29,6 +30,7 @@ #include "applet.h" #include "containment.h" #include "corona.h" +#include "dialog.h" #include "extendergroup.h" #include "extenderitem.h" #include "framesvg.h" @@ -626,6 +628,10 @@ FrameSvg::EnabledBorders Extender::enabledBordersForItem(ExtenderItem *item) con } } + //someone (i.e. a Dialog) told the extender to disable some border? + borders &= ~d->disabledBordersHint; + + return borders; } @@ -633,6 +639,7 @@ ExtenderPrivate::ExtenderPrivate(Applet *applet, Extender *extender) : q(extender), applet(applet), background(new FrameSvg(extender)), + disabledBordersHint(FrameSvg::NoBorder), currentSpacerIndex(-1), spacerWidget(0), emptyExtenderMessage(QString()), @@ -896,6 +903,18 @@ void ExtenderPrivate::viewportGeometryChanged(const QRectF &rect) } } +void ExtenderPrivate::setDisabledBordersHint(const FrameSvg::EnabledBorders borders) +{ + if (disabledBordersHint == borders) { + return; + } + + disabledBordersHint = borders; + foreach (Plasma::ExtenderItem *item, attachedExtenderItems) { + item->d->themeChanged(); + } +} + bool Extender::isEmpty() const { //It's empty if it doesn't have items or has only group that are empty and autohide diff --git a/private/extender_p.h b/private/extender_p.h index 85786bc51..8acb23379 100644 --- a/private/extender_p.h +++ b/private/extender_p.h @@ -77,6 +77,7 @@ class ExtenderPrivate void adjustMinimumSize(); void setPositionFromDragPosition(const QPointF &pos); ExtenderGroup *findGroup(const QString &name) const; + void setDisabledBordersHint(const FrameSvg::EnabledBorders borders); Extender *q; @@ -85,6 +86,7 @@ class ExtenderPrivate QGraphicsWidget *mainWidget; QGraphicsLinearLayout *layout; FrameSvg *background; + FrameSvg::EnabledBorders disabledBordersHint; int currentSpacerIndex; Spacer *spacerWidget;