[aurorae] Plastik theme transits to QtQuick 2

icc-effect-5.14.5
Martin Gräßlin 2013-10-01 13:58:01 +02:00
parent fbe5a497b4
commit 8055cde910
8 changed files with 18 additions and 17 deletions

View File

@ -6,6 +6,6 @@ set(plastik_plugin_SRCS
qt4_automoc(${plastik_plugin_SRCS})
add_library(plastikplugin SHARED ${plastik_plugin_SRCS})
target_link_libraries(plastikplugin Qt5::Core Qt5::Declarative KF5::KConfigWidgets kdecorations)
install(TARGETS plastikplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/kwin/decorations/plastik)
install(FILES qmldir DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/kwin/decorations/plastik)
target_link_libraries(plastikplugin Qt5::Core Qt5::Quick KF5::KConfigWidgets kdecorations)
install(TARGETS plastikplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kwin/decorations/plastik)
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kwin/decorations/plastik)

View File

@ -27,7 +27,7 @@ namespace KWin
{
PlastikButtonProvider::PlastikButtonProvider()
: QDeclarativeImageProvider(Pixmap)
: QQuickImageProvider(Pixmap)
{
}
@ -40,7 +40,7 @@ QPixmap PlastikButtonProvider::requestPixmap(const QString &id, QSize *size, con
QStringList idParts = id.split(QStringLiteral("/"));
if (idParts.isEmpty()) {
// incorrect id
return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize);
return QQuickImageProvider::requestPixmap(id, size, requestedSize);
}
bool active = false;
bool toggled = false;
@ -95,7 +95,7 @@ QPixmap PlastikButtonProvider::requestPixmap(const QString &id, QSize *size, con
button = AppMenuIcon;
} else {
// not recognized icon
return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize);
return QQuickImageProvider::requestPixmap(id, size, requestedSize);
}
return icon(button, origSize, active, shadow);
}

View File

@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef KWIN_PLASTIK_BUTTON_H
#define KWIN_PLASTIK_BUTTON_H
#include <QDeclarativeImageProvider>
#include <QQuickImageProvider>
namespace KWin
{
class PlastikButtonProvider : public QDeclarativeImageProvider
class PlastikButtonProvider : public QQuickImageProvider
{
public:
explicit PlastikButtonProvider();

View File

@ -16,18 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "plastikplugin.h"
#include "plastikbutton.h"
#include <QDeclarativeEngine>
#include <QQmlEngine>
void PlastikPlugin::registerTypes(const char *uri)
{
Q_UNUSED(uri)
}
void PlastikPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri)
void PlastikPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.kwin.decorations.plastik"));
engine->addImageProvider(QLatin1String("plastik"), new KWin::PlastikButtonProvider());
QDeclarativeExtensionPlugin::initializeEngine(engine, uri);
QQmlExtensionPlugin::initializeEngine(engine, uri);
}
#include "moc_plastikplugin.cpp"

View File

@ -17,15 +17,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef PLASTIK_PLUGIN_H
#define PLASTIK_PLUGIN_H
#include <QDeclarativeExtensionPlugin>
#include <QQmlExtensionPlugin>
class PlastikPlugin : public QDeclarativeExtensionPlugin
class PlastikPlugin : public QQmlExtensionPlugin
{
Q_PLUGIN_METADATA(IID "org.kde.kwin.decorations.plastik")
Q_OBJECT
public:
virtual void registerTypes(const char *uri);
virtual void initializeEngine(QDeclarativeEngine *engine, const char *uri);
virtual void registerTypes(const char *uri) override;
virtual void initializeEngine(QQmlEngine *engine, const char *uri) override;
};
#endif // PLASTIK_PLUGIN_H

View File

@ -1,3 +1,4 @@
module org.kde.kwin.decorations.plastik
plugin plastikplugin
# we need to have at least one element of Qt is not able to find the plugin *shrug*

View File

@ -14,7 +14,7 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
import QtQuick 1.1
import QtQuick 2.0
import org.kde.kwin.decoration 0.1
import org.kde.kwin.decorations.plastik 1.0

View File

@ -14,7 +14,7 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
import QtQuick 1.1
import QtQuick 2.0
import org.kde.kwin.decoration 0.1
import org.kde.kwin.decorations.plastik 1.0