disable borders near to the edge of the screen for extenders too
svn path=/trunk/KDE/kdelibs/; revision=1206154
This commit is contained in:
parent
6855137e40
commit
e04e91e9ad
13
dialog.cpp
13
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;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "extender.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDesktopWidget>
|
||||
#include <QLabel>
|
||||
#include <QGraphicsSceneDragDropEvent>
|
||||
#include <QGraphicsGridLayout>
|
||||
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user