From 809339d1484cf556512534367b8170bc26baf072 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 12 Aug 2021 14:39:51 +0200 Subject: Remove qtquickcontrols2 sources and explain where they went Now that qtquickcontrols2 has been merged into qtdeclarative, we should make it obvious that this repo should no longer be used, by preventing it from being built. Task-number: QTBUG-95173 Pick-to: 6.2 Change-Id: I95bd6a214f3d75a865ab163ee0a1f9ffbeb7a051 Reviewed-by: Alexandru Croitor Reviewed-by: Volker Hilsheimer --- .../Contents/Sketch/9-patch-export.js | 24 --------------------- .../Contents/Sketch/manifest.json | 19 ---------------- src/quickcontrols2/imagine/design/imagine.sketch | Bin 164993 -> 0 bytes 3 files changed, 43 deletions(-) delete mode 100644 src/quickcontrols2/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/9-patch-export.js delete mode 100644 src/quickcontrols2/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/manifest.json delete mode 100644 src/quickcontrols2/imagine/design/imagine.sketch (limited to 'src/quickcontrols2/imagine/design') diff --git a/src/quickcontrols2/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/9-patch-export.js b/src/quickcontrols2/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/9-patch-export.js deleted file mode 100644 index a7f9a459..00000000 --- a/src/quickcontrols2/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/quickcontrols2/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/manifest.json b/src/quickcontrols2/imagine/design/9-patch-export.sketchplugin/Contents/Sketch/manifest.json deleted file mode 100644 index 40807aa3..00000000 --- a/src/quickcontrols2/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/quickcontrols2/imagine/design/imagine.sketch b/src/quickcontrols2/imagine/design/imagine.sketch deleted file mode 100644 index f3535b37..00000000 Binary files a/src/quickcontrols2/imagine/design/imagine.sketch and /dev/null differ -- cgit v1.2.3