aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/imagine/design
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-05-31 16:40:54 +1000
committerUlf Hermann <ulf.hermann@qt.io>2021-06-05 12:52:00 +0200
commit5e8feb64d6a3cf50360c066e4595e41021bd0f9c (patch)
treec7901024f6c082dab14c97d109853ab5a64db1e1 /src/imports/controls/imagine/design
parent284936db8327f030473c0533041ee850f5369bdd (diff)
Update to latest qml CMake API
The new qml CMake API places a closer relationship between the backing target and the plugin target. Both are typically created together and they share a lot of common details. Instead of creating them in different parts of the source tree, they are now specified together. The src/imports area has effectively been absorbed into the other corresponding subdirectories below src with this change. Task-number: QTBUG-91621 Change-Id: I9bd32e9eb78c198ccc9db04e2829303cac323502 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/imports/controls/imagine/design')
-rw-r--r--src/imports/controls/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/9-patch-export.js24
-rw-r--r--src/imports/controls/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/manifest.json19
-rw-r--r--src/imports/controls/imagine/design/imagine.sketchbin164993 -> 0 bytes
3 files changed, 0 insertions, 43 deletions
diff --git a/src/imports/controls/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/9-patch-export.js b/src/imports/controls/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/9-patch-export.js
deleted file mode 100644
index a7f9a459..00000000
--- a/src/imports/controls/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/9-patch-export.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// 9-patch export
-//
-// This plugin crops upscaled 9-patch PNG assets when exported from Sketch,
-// to ensure that 9-patch borders remain 1px wide when upscaled.
-//
-function onExportSlices(context) {
- var exports = context.actionContext.exports;
- for (var i = 0; i < exports.count(); ++i) {
- var name = exports[i].request.name();
- var scale = exports[i].request.scale();
- if (scale > 1 && name.endsWith(".9"))
- cropAsset(exports[i].path, scale - 1);
- }
-}
-
-function cropAsset(path, inset) {
- var url = NSURL.fileURLWithPath(path);
- var img = CIImage.imageWithContentsOfURL(url);
- var rect = NSInsetRect(img.extent(), inset, inset);
- var cropped = img.imageByCroppingToRect(rect);
- var rep = NSBitmapImageRep.alloc().initWithCIImage(cropped);
- var data = rep.PNGRepresentationWithInterlaced(false);
- data.writeToFile(path);
-}
diff --git a/src/imports/controls/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/manifest.json b/src/imports/controls/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/manifest.json
deleted file mode 100644
index 40807aa3..00000000
--- a/src/imports/controls/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/manifest.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name" : "9-patch export",
- "description" : "Crops upscaled 9-patch PNG assets when exported from Sketch.",
- "version" : "0.1",
- "identifier" : "org.qt-project.sketch.9-patch-export",
- "author" : "The Qt Project",
- "commands" : [
- {
- "name" : "9-patch export",
- "identifier" : "9-patch-export",
- "script" : "9-patch-export.js",
- "handlers" : {
- "actions" : {
- "ExportSlices": "onExportSlices",
- },
- },
- },
- ],
-}
diff --git a/src/imports/controls/imagine/design/imagine.sketch b/src/imports/controls/imagine/design/imagine.sketch
deleted file mode 100644
index f3535b37..00000000
--- a/src/imports/controls/imagine/design/imagine.sketch
+++ /dev/null
Binary files differ