close and home buttons fixed

This commit is contained in:
Marco Martin 2015-06-11 15:50:38 -07:00
parent 0860194325
commit 1f8f890757
4 changed files with 15 additions and 3 deletions

View file

@ -0,0 +1,2 @@
workspace.slotToggleShowDesktop();

View file

@ -24,12 +24,22 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0
Item {
Rectangle {
anchors.fill: parent
//TODO: decide what color we want applets
color: theme.backgroundColor
width: 600
height: 40
property Item toolBox
PlasmaComponents.ToolButton {
anchors.horizontalCenter: parent.horizontalCenter
iconSource: "go-home"
onClicked: plasmoid.nativeInterface.executeScript("showdesktop");
}
PlasmaComponents.ToolButton {
anchors.right: parent.right
iconSource: "window-close"

View file

@ -41,10 +41,10 @@ TaskPanel::~TaskPanel()
void TaskPanel::executeScript(const QString &script)
{
//Plasma::Package p =
package().filePath("scripts", script + ".js");
qWarning()<<"AAAAAA"<<package().filePath("scripts", script + ".js")<<package().path();
QDBusMessage message = QDBusMessage::createMethodCall(s_kwinService, "/Scripting", QString(), "loadScript");
QList<QVariant> arguments;
arguments << QVariant("/opt/kde5qt5/share/plasma/plasmoids/org.kde.phone.taskpanel/code/close.js");
arguments << QVariant(package().filePath("scripts", script + ".js"));
message.setArguments(arguments);
QDBusMessage reply = QDBusConnection::sessionBus().call(message);
if (reply.type() == QDBusMessage::ErrorMessage) {