Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
change the shortcuts for iOS and Android. And change code sample copid
Browse files Browse the repository at this point in the history
  • Loading branch information
YanBuXuan committed Dec 17, 2019
1 parent 53b7589 commit 0cef0e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sketch-flow",
"version": "2.2.4",
"description": "Make Icon Slicing simple for app developers!",
"description": "Make icon slicing simple for app developers!",
"repository": {
"type": "git",
"url": "git+https://github.com/hite/Sketch-Flow"
Expand Down
7 changes: 3 additions & 4 deletions src/getslice_ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function moveToProject(sourcePath, destPath, fileName) {
pluginUtils.moveToProject(sourcePath, destPath, function (dest) {
const pb = NSPasteboard.generalPasteboard()
pb.clearContents()
pb.writeObjects([`@"${fileName}"`])
pb.writeObjects([`[UIImage imageNamed:@"${fileName}"]`])
})
}

Expand All @@ -255,14 +255,13 @@ export function copyTextCode() {
var layer = selectedLayers.layers[0]

if (layer.type === 'Text' && layer.sharedStyle && layer.sharedStyle.name) {
const text = layer.name
const styleNameParts = layer.sharedStyle.name.split('/')
const code = '<#label#>.text = @"' + text + '";\n' + `YXSpec(<#label#>, YXCode_${styleNameParts.pop()});`
const code = `YXCode_${styleNameParts.pop()}`
const pb = NSPasteboard.generalPasteboard()
pb.clearContents()
pb.writeObjects([code])

UI.message('Code is copied')
UI.message('Text code is copied')
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
{
"name": "Slice for iOS",
"identifier": "sketch-flow.getslice_ios-identifier",
"shortcut": "ctrl cmd s",
"shortcut": "ctrl s",
"script": "./getslice_ios.js",
"handler": "sliceIOS"
},
{
"name": "Slice for Android",
"identifier": "sketch-flow.getslice_android-identifier",
"shortcut": "ctrl cmd a",
"shortcut": "ctrl a",
"script": "./getslice_android.js",
"handler": "sliceAndroid"
},
Expand Down Expand Up @@ -61,7 +61,7 @@
},
"identifier": "me.hite.sketch-flow",
"homepage": "https://github.com/hite/Sketch-Flow",
"version": "2.2.4",
"version": "2.2.7",
"description" : "Make icon slicing simple for app developers!",
"authorEmail" : "[email protected]",
"name" : "Sketch Flow"
Expand Down

0 comments on commit 0cef0e9

Please sign in to comment.