summaryrefslogtreecommitdiff
path: root/platform/macos/app/Base.lproj
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-08-21 13:01:09 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-11-28 15:45:43 -0800
commit992726ab492bad5bddd49a5a5c3e57764f1998b9 (patch)
treed2ff202943ca57b0f7ca0307e7feb73c7091b33c /platform/macos/app/Base.lproj
parent03a2dbe3615cd525d091e49f640f960fa2b28a81 (diff)
downloadqtlocation-mapboxgl-992726ab492bad5bddd49a5a5c3e57764f1998b9.tar.gz
[macos] Added Layers sidebar
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.
Diffstat (limited to 'platform/macos/app/Base.lproj')
-rw-r--r--platform/macos/app/Base.lproj/MainMenu.xib5
-rw-r--r--platform/macos/app/Base.lproj/MapDocument.xib185
2 files changed, 177 insertions, 13 deletions
diff --git a/platform/macos/app/Base.lproj/MainMenu.xib b/platform/macos/app/Base.lproj/MainMenu.xib
index 7dd4d08430..4efb8d4c46 100644
--- a/platform/macos/app/Base.lproj/MainMenu.xib
+++ b/platform/macos/app/Base.lproj/MainMenu.xib
@@ -429,6 +429,11 @@
<action selector="toggleToolbarShown:" target="-1" id="BXY-wc-z0C"/>
</connections>
</menuItem>
+ <menuItem title="Show Layers" keyEquivalent="L" id="qtg-l9-BH3">
+ <connections>
+ <action selector="toggleLayers:" target="-1" id="YdA-Mr-MHi"/>
+ </connections>
+ </menuItem>
</items>
</menu>
</menuItem>
diff --git a/platform/macos/app/Base.lproj/MapDocument.xib b/platform/macos/app/Base.lproj/MapDocument.xib
index 4e58490e68..9af40d461d 100644
--- a/platform/macos/app/Base.lproj/MapDocument.xib
+++ b/platform/macos/app/Base.lproj/MapDocument.xib
@@ -1,40 +1,160 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11191" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11191"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MapDocument">
<connections>
<outlet property="mapView" destination="q4d-kF-8Hi" id="7hI-dS-A5R"/>
<outlet property="mapViewContextMenu" destination="XbX-6a-Mgy" id="YD0-1r-5N2"/>
+ <outlet property="splitView" destination="IPR-fm-vk8" id="9xt-ar-uad"/>
+ <outlet property="styleLayersArrayController" destination="GXW-3J-Gff" id="Ygs-7o-juz"/>
+ <outlet property="styleLayersTableView" destination="Mm4-6F-qEb" id="TB5-ha-JJE"/>
<outlet property="window" destination="cSv-fg-MAQ" id="TBu-Mu-79N"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+ <objectController objectClassName="MGLMapView" id="jxx-uM-ZTC" userLabel="Map View Object Controller">
+ <declaredKeys>
+ <string>style</string>
+ </declaredKeys>
+ <connections>
+ <outlet property="content" destination="q4d-kF-8Hi" id="Zpe-0y-eG3"/>
+ </connections>
+ </objectController>
+ <objectController objectClassName="MGLStyle" id="Xji-k6-iQ4" userLabel="Style Object Controller">
+ <declaredKeys>
+ <string>layers</string>
+ </declaredKeys>
+ <connections>
+ <binding destination="jxx-uM-ZTC" name="contentObject" keyPath="selection.style" id="60N-aU-tgJ"/>
+ </connections>
+ </objectController>
+ <arrayController objectClassName="MGLStyleLayer" avoidsEmptySelection="NO" id="GXW-3J-Gff" userLabel="Style Layers Array Controller">
+ <declaredKeys>
+ <string>identifier</string>
+ <string>visible</string>
+ </declaredKeys>
+ <connections>
+ <binding destination="Xji-k6-iQ4" name="contentArray" keyPath="selection.layers" id="X25-Nb-Brf"/>
+ </connections>
+ </arrayController>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" frameAutosaveName="MBXMapWindow" animationBehavior="default" id="cSv-fg-MAQ">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
- <rect key="contentRect" x="388" y="211" width="512" height="480"/>
+ <rect key="contentRect" x="388" y="211" width="642" height="480"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
<view key="contentView" id="TuG-C5-zLS">
- <rect key="frame" x="0.0" y="0.0" width="512" height="480"/>
+ <rect key="frame" x="0.0" y="0.0" width="642" height="480"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <customView translatesAutoresizingMaskIntoConstraints="NO" id="q4d-kF-8Hi" customClass="MGLMapView">
- <rect key="frame" x="0.0" y="0.0" width="512" height="480"/>
+ <splitView autosaveName="MBXLayersSplitView" dividerStyle="thin" vertical="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IPR-fm-vk8">
+ <rect key="frame" x="0.0" y="0.0" width="642" height="480"/>
+ <subviews>
+ <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="sMc-vT-RwH">
+ <rect key="frame" x="0.0" y="0.0" width="163" height="480"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <clipView key="contentView" id="bSc-hK-bzQ">
+ <rect key="frame" x="0.0" y="0.0" width="163" height="480"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" autosaveColumns="NO" id="Mm4-6F-qEb">
+ <rect key="frame" x="0.0" y="0.0" width="163" height="480"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <size key="intercellSpacing" width="3" height="2"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
+ <tableColumns>
+ <tableColumn editable="NO" width="16" minWidth="16" maxWidth="1000" id="P3U-a3-c8q">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+ </tableHeaderCell>
+ <imageCell key="dataCell" lineBreakMode="truncatingTail" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="symbol" id="JWq-c8-aB1"/>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+ <connections>
+ <binding destination="GXW-3J-Gff" name="value" keyPath="arrangedObjects" id="ST5-mo-Mkt">
+ <dictionary key="options">
+ <bool key="NSConditionallySetsEnabled" value="NO"/>
+ <string key="NSValueTransformerName">StyleLayerIconTransformer</string>
+ </dictionary>
+ </binding>
+ </connections>
+ </tableColumn>
+ <tableColumn editable="NO" width="141" minWidth="40" maxWidth="1000" id="BwD-ww-7uw">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+ </tableHeaderCell>
+ <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="6wl-F2-yK2">
+ <font key="font" metaFont="system"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+ <connections>
+ <binding destination="GXW-3J-Gff" name="value" keyPath="arrangedObjects.identifier" id="vQC-tc-CMF">
+ <dictionary key="options">
+ <bool key="NSConditionallySetsEditable" value="YES"/>
+ </dictionary>
+ </binding>
+ <binding destination="GXW-3J-Gff" name="fontItalic" keyPath="arrangedObjects.visible" id="6Wu-cz-WSI">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSNegateBoolean</string>
+ </dictionary>
+ </binding>
+ </connections>
+ </tableColumn>
+ </tableColumns>
+ <connections>
+ <action trigger="doubleAction" selector="toggleStyleLayers:" target="-1" id="Q1v-2T-sIC"/>
+ <outlet property="menu" destination="OHX-Pa-tDw" id="wnL-Ux-WaH"/>
+ </connections>
+ </tableView>
+ </subviews>
+ </clipView>
+ <constraints>
+ <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="185" id="VQs-2Z-hmP"/>
+ </constraints>
+ <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="NDx-rn-TLj">
+ <rect key="frame" x="0.0" y="464" width="184.5" height="16"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="0vt-rI-sHB">
+ <rect key="frame" x="147" y="480" width="16" height="0.0"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ </scrollView>
+ <customView id="q4d-kF-8Hi" customClass="MGLMapView">
+ <rect key="frame" x="164" y="0.0" width="478" height="480"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <constraints>
+ <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="200" id="kg3-4h-7Hl"/>
+ </constraints>
+ <connections>
+ <outlet property="delegate" destination="-2" id="dh2-0H-jFZ"/>
+ <outlet property="menu" destination="XbX-6a-Mgy" id="dSu-HR-Kq2"/>
+ </connections>
+ </customView>
+ </subviews>
+ <holdingPriorities>
+ <real value="250"/>
+ <real value="250"/>
+ </holdingPriorities>
<connections>
- <outlet property="delegate" destination="-2" id="dh2-0H-jFZ"/>
- <outlet property="menu" destination="XbX-6a-Mgy" id="dSu-HR-Kq2"/>
+ <outlet property="delegate" destination="-2" id="dbC-MC-CAy"/>
</connections>
- </customView>
+ </splitView>
</subviews>
<constraints>
- <constraint firstAttribute="bottom" secondItem="q4d-kF-8Hi" secondAttribute="bottom" id="L2t-Be-qWL"/>
- <constraint firstItem="q4d-kF-8Hi" firstAttribute="top" secondItem="TuG-C5-zLS" secondAttribute="top" id="T8A-o3-Bhq"/>
- <constraint firstItem="q4d-kF-8Hi" firstAttribute="leading" secondItem="TuG-C5-zLS" secondAttribute="leading" id="fGH-YW-Qd3"/>
- <constraint firstAttribute="trailing" secondItem="q4d-kF-8Hi" secondAttribute="trailing" id="yfG-iG-K4C"/>
+ <constraint firstAttribute="trailing" secondItem="IPR-fm-vk8" secondAttribute="trailing" id="ABk-5R-Uzg"/>
+ <constraint firstAttribute="bottom" secondItem="IPR-fm-vk8" secondAttribute="bottom" id="CHa-BK-6ld"/>
+ <constraint firstItem="IPR-fm-vk8" firstAttribute="leading" secondItem="TuG-C5-zLS" secondAttribute="leading" id="hcR-y2-x3l"/>
+ <constraint firstItem="IPR-fm-vk8" firstAttribute="top" secondItem="TuG-C5-zLS" secondAttribute="top" id="u78-BU-s5g"/>
</constraints>
</view>
<toolbar key="toolbar" implicitIdentifier="A3AC6577-4712-4628-813D-113498171A84" allowsUserCustomization="NO" displayMode="iconOnly" sizeMode="regular" id="DTc-AP-Bah">
@@ -89,8 +209,25 @@
<action selector="showStyle:" target="-1" id="pBn-SO-HIX"/>
</connections>
</toolbarItem>
+ <toolbarItem implicitItemIdentifier="ACA1D8BE-A108-4BF9-92DC-AE7AA7342CF9" label="Layers" paletteLabel="Show Layers" image="NSListViewTemplate" id="THR-Dm-mn8" customClass="ValidatedToolbarItem">
+ <nil key="toolTip"/>
+ <size key="minSize" width="47" height="32"/>
+ <size key="maxSize" width="48" height="32"/>
+ <button key="view" verticalHuggingPriority="750" id="C3e-Oy-STT">
+ <rect key="frame" x="14" y="14" width="47" height="32"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSListViewTemplate" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="2Gf-wm-QuI">
+ <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
+ <font key="font" metaFont="system"/>
+ </buttonCell>
+ </button>
+ <connections>
+ <action selector="toggleLayers:" target="-1" id="NHT-rn-BuG"/>
+ </connections>
+ </toolbarItem>
</allowedToolbarItems>
<defaultToolbarItems>
+ <toolbarItem reference="THR-Dm-mn8"/>
<toolbarItem reference="XJT-Ho-tuZ"/>
<toolbarItem reference="z4l-5x-MzK"/>
<toolbarItem reference="u23-0z-Otl"/>
@@ -135,8 +272,30 @@
</connections>
<point key="canvasLocation" x="820" y="254.5"/>
</menu>
+ <menu title="Layer" id="OHX-Pa-tDw" userLabel="Layers Context Menu">
+ <items>
+ <menuItem title="Show" id="KWq-LM-Qqo">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <connections>
+ <action selector="toggleStyleLayers:" target="-1" id="kXn-ug-tWC"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="uWQ-uj-mZn"/>
+ <menuItem title="Delete" id="Myg-EZ-Pnq">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <connections>
+ <action selector="deleteStyleLayers:" target="-1" id="cE5-ZP-BDC"/>
+ </connections>
+ </menuItem>
+ </items>
+ <connections>
+ <outlet property="delegate" destination="-2" id="yvb-NB-VGl"/>
+ </connections>
+ </menu>
</objects>
<resources>
+ <image name="NSListViewTemplate" width="14" height="10"/>
<image name="NSShareTemplate" width="11" height="16"/>
+ <image name="symbol" width="13" height="13"/>
</resources>
</document>