Commit 49f04efb authored by Tanbir Jishan's avatar Tanbir Jishan Committed by Nate Graham
Browse files

Applets/margin-separator: Use edit mode from framework

The native interface if this plasmoid is used to access the edit mode
of the plasmashell. Since this property is available now in frameworks,
there is no need use the native interface. Instead use the editMode from
frameworks.
parent 085087f8
......@@ -15,5 +15,4 @@ endif()
add_subdirectory(minimizeall)
add_subdirectory(showdesktop)
add_subdirectory(kimpanel)
add_subdirectory(margins-separator)
plasma_install_package(keyboardlayout org.kde.plasma.keyboardlayout)
plasma_install_package(package org.kde.plasma.marginsseparator)
add_subdirectory(plugin)
......@@ -12,10 +12,9 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
Rectangle {
id: root
readonly property bool editMode : Plasmoid.nativeInterface.containment.editMode
color: editMode ? PlasmaCore.Theme.buttonFocusColor : "transparent" // So that user can identify the Plasmoid in edit mode
Layout.minimumWidth: editMode ? units.largeSpacing : 1 // We don't have zeroSpacing and assigning 0 does not work as well
color: Plasmoid.editMode ? PlasmaCore.Theme.buttonFocusColor : "transparent" // So that user can identify the Plasmoid in edit mode
Layout.minimumWidth: Plasmoid.editMode ? units.largeSpacing : 1 // We don't have zeroSpacing and assigning 0 does not work as well
Layout.preferredWidth: Layout.minimumWidth
Layout.maximumWidth: Layout.minimumWidth
......
kde_enable_exceptions()
add_definitions(-DTRANSLATION_DOMAIN=\"marginSeparator\")
kcoreaddons_add_plugin(org.kde.plasma.marginsseparator SOURCES marginSeparator.cpp INSTALL_NAMESPACE "plasma/applets")
target_link_libraries(org.kde.plasma.marginsseparator Qt::Gui Qt::Core Qt::Qml Qt::Quick KF5::Plasma KF5::PlasmaQuick KF5::I18n)
/*
SPDX-FileCopyrightText: 2020 Tanbir Jishan <tantalising007@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "marginSeparator.h"
#include <QDebug>
#include <QProcess>
#include <QtQml>
#include <Plasma/Containment>
#include <Plasma/Corona>
MarginSeparator::MarginSeparator(QObject *parent, const KPluginMetaData &data, const QVariantList &args)
: Plasma::Applet(parent, data, args)
{
}
PlasmaQuick::AppletQuickItem *MarginSeparator::containmentGraphicObject() const
{
return containment()->property("_plasma_graphicObject").value<PlasmaQuick::AppletQuickItem *>();
}
K_PLUGIN_CLASS_WITH_JSON(MarginSeparator, "../package/metadata.json")
#include "marginSeparator.moc"
/*
SPDX-FileCopyrightText: 2022 Tanbir Jishan <tantalising007@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <Plasma/Applet>
#include <PlasmaQuick/AppletQuickItem>
namespace Plasma
{
class Containment;
}
class MarginSeparator;
class MarginSeparator : public Plasma::Applet
{
Q_OBJECT
Q_PROPERTY(PlasmaQuick::AppletQuickItem *containment READ containmentGraphicObject CONSTANT)
public:
MarginSeparator(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
PlasmaQuick::AppletQuickItem *containmentGraphicObject() const;
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment