Git commit 3877f83cb2f91dab6b59729791ec461268d28d04 by Shaun Reich. Committed on 05/05/2012 at 21:30. Pushed by sreich into branch 'plasma/sreich/sal-qml'. add a close button, which is for some reason being misrendered code cleanup++ M +13 -14 plasma/netbook/containments/sal/shell/fullview.cpp M +1 -7 plasma/netbook/containments/sal/shell/fullview.h http://commits.kde.org/kde-workspace/3877f83cb2f91dab6b59729791ec461268d28d= 04 diff --git a/plasma/netbook/containments/sal/shell/fullview.cpp b/plasma/ne= tbook/containments/sal/shell/fullview.cpp index 0d97d7e..a1e8253 100644 --- a/plasma/netbook/containments/sal/shell/fullview.cpp +++ b/plasma/netbook/containments/sal/shell/fullview.cpp @@ -2,6 +2,7 @@ * Copyright 2007 Frerich Raabe * Copyright 2007 Aaron Seigo * Copyright 2008 Aleix Pol + * Copyright (C) 2012 Shaun Reich * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -54,13 +55,9 @@ using namespace Plasma; = FullView::FullView(const QString &ff, const QString &loc, bool persistent,= QWidget *parent) : QGraphicsView(), - m_formfactor(Plasma::Planar), - m_location(Plasma::Floating), m_containment(0), m_corona(0), m_applet(0), - m_appletShotTimer(0), - m_persistentConfig(persistent), m_closeButton(0) { new SalViewerAdaptor(this); @@ -74,7 +71,7 @@ FullView::FullView(const QString &ff, const QString &loc,= bool persistent, QWidg m_applet =3D Plasma::Applet::load("org.kde.sal"); = if (!m_applet) { - kDebug() << "failed to load"; + kDebug() << "failed to load SAL"; return; } = @@ -99,6 +96,12 @@ FullView::FullView(const QString &ff, const QString &loc= , bool persistent, QWidg viewport()->setAttribute(Qt::WA_NoSystemBackground); Plasma::WindowEffects::overrideShadow(winId(), true); = + m_closeButton =3D new Plasma::PushButton(m_containment); + m_closeButton->setText(i18n("Close")); + m_closeButton->setIcon(KIcon("dialog-close")); + m_closeButton->setMinimumSize(64, 64); + m_corona->addItem(m_closeButton); + // m_applet->addAction(QString("remove"), KStandardAction::quit(this, S= LOT(hide()), m_applet)); // enforce the applet being our size connect(m_applet, SIGNAL(geometryChanged()), this, SLOT(updateGeometry= ())); @@ -121,13 +124,11 @@ FullView::~FullView() { m_containment->destroy(false); kDebug() << "DTOR HIT"; -// storeCurrentApplet(); delete m_closeButton; } = void FullView::showEvent(QShowEvent *event) { - = } = void FullView::toggle(int screen) @@ -157,6 +158,7 @@ void FullView::keyPressEvent(QKeyEvent *event) hide(); event->accept(); } + QGraphicsView::keyPressEvent(event); } = @@ -188,8 +190,6 @@ void FullView::updateGeometry() return; } = - //kDebug() << "New applet geometry is" << m_applet->geometry(); - if (m_applet) { if (m_applet->size().toSize() !=3D size()) { m_applet->resize(size()); @@ -198,15 +198,14 @@ void FullView::updateGeometry() setSceneRect(m_applet->sceneBoundingRect()); } = - if ((windowFlags() & Qt::FramelessWindowHint) && - m_applet->backgroundHints() !=3D Plasma::Applet::NoBackground) { + if ((windowFlags() & Qt::FramelessWindowHint) && m_applet->backgroundH= ints() !=3D Plasma::Applet::NoBackground) { = // TODO: Use the background's mask for blur QRegion mask; - mask +=3D QRect(QPoint(), size()); + mask +=3D QRect(QPoint(), size()); = - Plasma::WindowEffects::enableBlurBehind(winId(), true, mask); - } + Plasma::WindowEffects::enableBlurBehind(winId(), true, mask); + } } = #include "fullview.moc" diff --git a/plasma/netbook/containments/sal/shell/fullview.h b/plasma/netb= ook/containments/sal/shell/fullview.h index b056f63..2b7d23f 100644 --- a/plasma/netbook/containments/sal/shell/fullview.h +++ b/plasma/netbook/containments/sal/shell/fullview.h @@ -1,5 +1,6 @@ /* * Copyright 2007 Aaron Seigo * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -66,15 +67,8 @@ protected: private: = Plasma::Corona *m_corona; - Plasma::FormFactor m_formfactor; - Plasma::Location m_location; Plasma::Containment *m_containment; Plasma::Applet *m_applet; - QStringList m_appletsToShoot; - QTimer *m_appletShotTimer; - // passed through cli by default, config files - // are non-persistent in plasmoidviewer. - bool m_persistentConfig; Plasma::PushButton *m_closeButton; }; =