This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a sidebar to the main document window in macosapp that lists the layers in the current style and updates whenever the style changes or a layer is added or removed programmatically. Display an icon beside each layer in the sidebar that indicates the kind of layer. Double-click a layer or layers to toggle their visibility, which is an undoable action. Added a menu item and toolbar button to toggle the Layers sidebar. Added a context menu for toggling visibility of and deleting layers selected in the Layers sidebar. Checked in the original SVGs for layer icons.
- Loading branch information
Showing
19 changed files
with
730 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
platform/macos/app/Assets.xcassets/Layers/background.imageset/Contents.json
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "background.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file added
BIN
+1.28 KB
platform/macos/app/Assets.xcassets/Layers/background.imageset/background.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
platform/macos/app/Assets.xcassets/Layers/circle.imageset/Contents.json
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "circle.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
platform/macos/app/Assets.xcassets/Layers/fill.imageset/Contents.json
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "fill.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
platform/macos/app/Assets.xcassets/Layers/symbol.imageset/Contents.json
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "symbol.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file not shown.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#import <Foundation/Foundation.h> | ||
|
||
@interface StyleLayerIconTransformer : NSValueTransformer | ||
|
||
@end |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#import "StyleLayerIconTransformer.h" | ||
|
||
#import <Mapbox/Mapbox.h> | ||
|
||
@implementation StyleLayerIconTransformer | ||
|
||
+ (Class)transformedValueClass { | ||
return [NSString class]; | ||
} | ||
|
||
+ (BOOL)allowsReverseTransformation { | ||
return NO; | ||
} | ||
|
||
- (id)transformedValue:(MGLStyleLayer *)layer { | ||
if ([layer isKindOfClass:[MGLBackgroundStyleLayer class]]) { | ||
return [NSImage imageNamed:@"background"]; | ||
} | ||
if ([layer isKindOfClass:[MGLCircleStyleLayer class]]) { | ||
return [NSImage imageNamed:@"circle"]; | ||
} | ||
if ([layer isKindOfClass:[MGLFillStyleLayer class]]) { | ||
return [NSImage imageNamed:@"fill"]; | ||
} | ||
if ([layer isKindOfClass:[MGLLineStyleLayer class]]) { | ||
return [NSImage imageNamed:@"NSListViewTemplate"]; | ||
} | ||
if ([layer isKindOfClass:[MGLRasterStyleLayer class]]) { | ||
return [[NSWorkspace sharedWorkspace] iconForFileType:@"jpg"]; | ||
} | ||
if ([layer isKindOfClass:[MGLSymbolStyleLayer class]]) { | ||
return [NSImage imageNamed:@"symbol"]; | ||
} | ||
|
||
return nil; | ||
} | ||
|
||
@end |
Oops, something went wrong.