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
11
dialog.cpp
11
dialog.cpp
@ -271,7 +271,7 @@ void DialogPrivate::checkBorders(bool updateMaskIfNeeded)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//decide if to disable the other borders
|
//decide if to disable the other borders
|
||||||
if (!extender && q->isVisible()) {
|
if (q->isVisible()) {
|
||||||
QRect geom;
|
QRect geom;
|
||||||
if (applet) {
|
if (applet) {
|
||||||
geom = screenGeom;
|
geom = screenGeom;
|
||||||
@ -298,6 +298,15 @@ void DialogPrivate::checkBorders(bool updateMaskIfNeeded)
|
|||||||
|
|
||||||
if (!extender) {
|
if (!extender) {
|
||||||
background->getMargins(leftWidth, topHeight, rightWidth, bottomHeight);
|
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;
|
//kDebug() << leftWidth << topHeight << rightWidth << bottomHeight;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "extender.h"
|
#include "extender.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <QDesktopWidget>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QGraphicsSceneDragDropEvent>
|
#include <QGraphicsSceneDragDropEvent>
|
||||||
#include <QGraphicsGridLayout>
|
#include <QGraphicsGridLayout>
|
||||||
@ -29,6 +30,7 @@
|
|||||||
#include "applet.h"
|
#include "applet.h"
|
||||||
#include "containment.h"
|
#include "containment.h"
|
||||||
#include "corona.h"
|
#include "corona.h"
|
||||||
|
#include "dialog.h"
|
||||||
#include "extendergroup.h"
|
#include "extendergroup.h"
|
||||||
#include "extenderitem.h"
|
#include "extenderitem.h"
|
||||||
#include "framesvg.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;
|
return borders;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,6 +639,7 @@ ExtenderPrivate::ExtenderPrivate(Applet *applet, Extender *extender) :
|
|||||||
q(extender),
|
q(extender),
|
||||||
applet(applet),
|
applet(applet),
|
||||||
background(new FrameSvg(extender)),
|
background(new FrameSvg(extender)),
|
||||||
|
disabledBordersHint(FrameSvg::NoBorder),
|
||||||
currentSpacerIndex(-1),
|
currentSpacerIndex(-1),
|
||||||
spacerWidget(0),
|
spacerWidget(0),
|
||||||
emptyExtenderMessage(QString()),
|
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
|
bool Extender::isEmpty() const
|
||||||
{
|
{
|
||||||
//It's empty if it doesn't have items or has only group that are empty and autohide
|
//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 adjustMinimumSize();
|
||||||
void setPositionFromDragPosition(const QPointF &pos);
|
void setPositionFromDragPosition(const QPointF &pos);
|
||||||
ExtenderGroup *findGroup(const QString &name) const;
|
ExtenderGroup *findGroup(const QString &name) const;
|
||||||
|
void setDisabledBordersHint(const FrameSvg::EnabledBorders borders);
|
||||||
|
|
||||||
Extender *q;
|
Extender *q;
|
||||||
|
|
||||||
@ -85,6 +86,7 @@ class ExtenderPrivate
|
|||||||
QGraphicsWidget *mainWidget;
|
QGraphicsWidget *mainWidget;
|
||||||
QGraphicsLinearLayout *layout;
|
QGraphicsLinearLayout *layout;
|
||||||
FrameSvg *background;
|
FrameSvg *background;
|
||||||
|
FrameSvg::EnabledBorders disabledBordersHint;
|
||||||
|
|
||||||
int currentSpacerIndex;
|
int currentSpacerIndex;
|
||||||
Spacer *spacerWidget;
|
Spacer *spacerWidget;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user