no more old layouts in libplasma, new stuff on API can start
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=796624
This commit is contained in:
parent
17215e3d33
commit
aa3c3eccce
26
applet.cpp
26
applet.cpp
@ -34,6 +34,7 @@
|
||||
#include <QTimer>
|
||||
#include <QUiLoader>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QGraphicsLinearLayout>
|
||||
#include <QGraphicsProxyWidget>
|
||||
@ -67,8 +68,6 @@
|
||||
|
||||
#include "plasma/layouts/boxlayout.h"
|
||||
#include "plasma/widgets/widget.h"
|
||||
#include "plasma/widgets/lineedit.h"
|
||||
#include "plasma/widgets/pushbutton.h"
|
||||
|
||||
//#define DYNAMIC_SHADOWS
|
||||
namespace Plasma
|
||||
@ -106,7 +105,6 @@ public:
|
||||
package(0),
|
||||
needsConfigOverlay(0),
|
||||
background(0),
|
||||
failureText(0),
|
||||
script(0),
|
||||
configXml(0),
|
||||
shadow(0),
|
||||
@ -311,7 +309,7 @@ public:
|
||||
QList<QGraphicsItem*> watchedForMouseMove;
|
||||
QStringList loadedEngines;
|
||||
Plasma::SvgPanel *background;
|
||||
Plasma::LineEdit *failureText;
|
||||
//Plasma::LineEdit *failureText;
|
||||
AppletScript *script;
|
||||
ConfigXml* configXml;
|
||||
ShadowItem* shadow;
|
||||
@ -688,17 +686,14 @@ void Applet::paintWindowFrame ( QPainter * painter, const QStyleOptionGraphicsIt
|
||||
void Applet::setFailedToLaunch(bool failed, const QString& reason)
|
||||
{
|
||||
if (d->failed == failed) {
|
||||
if (d->failureText) {
|
||||
d->failureText->setHtml(visibleFailureText(reason));
|
||||
setGeometry(QRectF(geometry().topLeft(), d->failureText->sizeHint()));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
d->failed = failed;
|
||||
prepareGeometryChange();
|
||||
|
||||
d->failureText = 0;
|
||||
|
||||
qDeleteAll(QGraphicsItem::children());
|
||||
setLayout(0);
|
||||
|
||||
@ -763,14 +758,15 @@ void Applet::setNeedsConfiguring(bool needsConfig)
|
||||
d->needsConfigOverlay->setZValue(zValue);
|
||||
|
||||
qDeleteAll(d->needsConfigOverlay->QGraphicsItem::children());
|
||||
PushButton* button = new PushButton(d->needsConfigOverlay);
|
||||
QPushButton* button = new QPushButton();
|
||||
button->setText(i18n("Configure..."));
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(showConfigurationInterface()));
|
||||
QSizeF s = button->geometry().size();
|
||||
button->resize(s);
|
||||
button->setPos(d->needsConfigOverlay->boundingRect().width() / 2 - s.width() / 2,
|
||||
d->needsConfigOverlay->boundingRect().height() / 2 - s.height() / 2);
|
||||
button->show();
|
||||
QGraphicsLinearLayout *configLayout = new QGraphicsLinearLayout(this);
|
||||
configLayout->setContentsMargins(0, 0, 0, 0);
|
||||
QGraphicsProxyWidget * configWidget = new QGraphicsProxyWidget(this);
|
||||
configWidget->setWidget(button);
|
||||
configLayout->addItem(configWidget);
|
||||
setLayout(configLayout);
|
||||
d->needsConfigOverlay->show();
|
||||
}
|
||||
|
||||
|
@ -46,9 +46,6 @@
|
||||
#include "desktoptoolbox_p.h"
|
||||
#include "svg.h"
|
||||
|
||||
#include "layouts/freelayout.h"
|
||||
#include "layouts/boxlayout.h"
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
@ -268,17 +265,17 @@ void Containment::setContainmentType(Containment::Type type)
|
||||
|
||||
if (isContainment() && type == DesktopContainment) {
|
||||
if (!d->toolbox) {
|
||||
Plasma::Widget *addWidgetTool = addToolBoxTool("addwidgets", "list-add", i18n("Add Widgets"));
|
||||
QGraphicsWidget *addWidgetTool = addToolBoxTool("addwidgets", "list-add", i18n("Add Widgets"));
|
||||
connect(addWidgetTool, SIGNAL(clicked()), this, SIGNAL(showAddWidgets()));
|
||||
|
||||
Plasma::Widget *zoomInTool = addToolBoxTool("zoomIn", "zoom-in", i18n("Zoom In"));
|
||||
QGraphicsWidget *zoomInTool = addToolBoxTool("zoomIn", "zoom-in", i18n("Zoom In"));
|
||||
connect(zoomInTool, SIGNAL(clicked()), this, SLOT(zoomIn()));
|
||||
|
||||
Plasma::Widget *zoomOutTool = addToolBoxTool("zoomOut", "zoom-out", i18n("Zoom Out"));
|
||||
QGraphicsWidget *zoomOutTool = addToolBoxTool("zoomOut", "zoom-out", i18n("Zoom Out"));
|
||||
connect(zoomOutTool, SIGNAL(clicked()), this, SIGNAL(zoomOut()));
|
||||
|
||||
if (!isKioskImmutable()) {
|
||||
Plasma::Widget *lockTool = addToolBoxTool("lockWidgets", "object-locked",
|
||||
QGraphicsWidget *lockTool = addToolBoxTool("lockWidgets", "object-locked",
|
||||
isImmutable() ? i18n("Unlock Widgets") :
|
||||
i18n("Lock Widgets"));
|
||||
connect(lockTool, SIGNAL(clicked()), this, SLOT(toggleDesktopImmutability()));
|
||||
@ -1214,7 +1211,7 @@ void Containment::emitLaunchActivated()
|
||||
emit launchActivated();
|
||||
}
|
||||
|
||||
Plasma::Widget * Containment::addToolBoxTool(const QString& toolName, const QString& iconName, const QString& iconText)
|
||||
QGraphicsWidget * Containment::addToolBoxTool(const QString& toolName, const QString& iconName, const QString& iconText)
|
||||
{
|
||||
Plasma::Icon *tool = new Plasma::Icon(this);
|
||||
|
||||
|
@ -273,7 +273,7 @@ class PLASMA_EXPORT Containment : public Applet
|
||||
*
|
||||
* @return the constructed tool
|
||||
*/
|
||||
Plasma::Widget * addToolBoxTool(const QString &toolName = QString(), const QString &iconName = QString(), const QString &iconText = QString());
|
||||
QGraphicsWidget * addToolBoxTool(const QString &toolName = QString(), const QString &iconName = QString(), const QString &iconText = QString());
|
||||
|
||||
/**
|
||||
* Enables or disables a toolbox tool by name
|
||||
|
@ -40,7 +40,6 @@
|
||||
|
||||
#include "plasma/applet.h"
|
||||
|
||||
#include "layouts/freelayout.h"
|
||||
#include "plasma/plasma.h"
|
||||
#include "plasma/view.h"
|
||||
#include "plasma/containment.h"
|
||||
|
Loading…
Reference in New Issue
Block a user