forked from nemomobile/qtquickcontrols-nemo
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
/* | ||
* Copyright (C) 2018-2025 Chupligin Sergey <[email protected]> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Library General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Library General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Library General Public License | ||
* along with this library; see the file COPYING.LIB. If not, write to | ||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
* Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
|
||
#include "plugin.h" | ||
#include "nemoimageprovider.h" | ||
#include "sizing.h" | ||
|
@@ -8,16 +28,5 @@ void QQuickNemoControlsExtensionPlugin::registerTypes(const char* uri) | |
{ | ||
Q_ASSERT(uri == QLatin1String("Nemo")); | ||
qmlRegisterModule(uri, 2, 0); | ||
} | ||
|
||
void QQuickNemoControlsExtensionPlugin::initializeEngine(QQmlEngine* engine, const char* uri) | ||
{ | ||
Theme* theme = new Theme(); | ||
|
||
QQmlExtensionPlugin::initializeEngine(engine, uri); | ||
QQmlContext* context = engine->rootContext(); | ||
context->setContextProperty("size", theme->size()); | ||
context->setContextProperty("Theme", theme); | ||
|
||
engine->addImageProvider(QLatin1String("theme"), new NemoImageProvider); | ||
qmlRegisterSingletonType<Theme>(uri, 1, 0, "Theme", &Theme::qmlInstance); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
/* | ||
* Copyright (C) 2018-2025 Chupligin Sergey <[email protected]> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Library General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Library General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Library General Public License | ||
* along with this library; see the file COPYING.LIB. If not, write to | ||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
* Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
#ifndef QQUICKNEMOCONTROLSEXTENSIONPLUGIN_H | ||
#define QQUICKNEMOCONTROLSEXTENSIONPLUGIN_H | ||
|
||
|
@@ -9,7 +28,6 @@ class QQuickNemoControlsExtensionPlugin : public QQmlExtensionPlugin { | |
Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid FILE "nemo.json") | ||
public: | ||
void registerTypes(const char* uri); | ||
void initializeEngine(QQmlEngine* engine, const char* uri); | ||
}; | ||
|
||
#endif // QQUICKNEMOCONTROLSEXTENSIONPLUGIN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters