Adding sidebar

This commit is contained in:
Selim Mustafaev 2022-07-04 00:37:27 +03:00
parent a650e107a2
commit 7985fb83cc
10 changed files with 372 additions and 144 deletions

View File

@ -87,6 +87,12 @@
7AE32D6927F06536004EF6E0 /* CoreDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D6827F06536004EF6E0 /* CoreDataSource.swift */; }; 7AE32D6927F06536004EF6E0 /* CoreDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D6827F06536004EF6E0 /* CoreDataSource.swift */; };
7AE32D6E27F06D2D004EF6E0 /* SwiftDate in Frameworks */ = {isa = PBXBuildFile; productRef = 7AE32D6D27F06D2D004EF6E0 /* SwiftDate */; }; 7AE32D6E27F06D2D004EF6E0 /* SwiftDate in Frameworks */ = {isa = PBXBuildFile; productRef = 7AE32D6D27F06D2D004EF6E0 /* SwiftDate */; };
7AE32D7127F06DA4004EF6E0 /* DateSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D7027F06DA4004EF6E0 /* DateSection.swift */; }; 7AE32D7127F06DA4004EF6E0 /* DateSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D7027F06DA4004EF6E0 /* DateSection.swift */; };
7AFD7AE02871823E00BCCD37 /* SidebarSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7ADF2871823E00BCCD37 /* SidebarSection.swift */; };
7AFD7AE22871826D00BCCD37 /* SidebarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7AE12871826D00BCCD37 /* SidebarItem.swift */; };
7AFD7AE4287182CD00BCCD37 /* SidebarFilterItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7AE3287182CD00BCCD37 /* SidebarFilterItem.swift */; };
7AFD7AE628718BF000BCCD37 /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7AE528718BF000BCCD37 /* Filter.swift */; };
7AFD7AE82871B7DA00BCCD37 /* MainSplitController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7AE72871B7DA00BCCD37 /* MainSplitController.swift */; };
7AFD7AEB2872355000BCCD37 /* MainWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7AEA2872355000BCCD37 /* MainWindowController.swift */; };
929EDE7F27F89C3000E55F65 /* VEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE7E27F89C3000E55F65 /* VEngine.swift */; }; 929EDE7F27F89C3000E55F65 /* VEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE7E27F89C3000E55F65 /* VEngine.swift */; };
929EDE8127F8A75E00E55F65 /* VPhoto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8027F8A75E00E55F65 /* VPhoto.swift */; }; 929EDE8127F8A75E00E55F65 /* VPhoto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8027F8A75E00E55F65 /* VPhoto.swift */; };
929EDE8327F8C6C500E55F65 /* VOwnershipPeriod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8227F8C6C500E55F65 /* VOwnershipPeriod.swift */; }; 929EDE8327F8C6C500E55F65 /* VOwnershipPeriod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8227F8C6C500E55F65 /* VOwnershipPeriod.swift */; };
@ -246,6 +252,12 @@
7AE32D6527F063A1004EF6E0 /* UIEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIEdgeInsets.swift; sourceTree = "<group>"; }; 7AE32D6527F063A1004EF6E0 /* UIEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIEdgeInsets.swift; sourceTree = "<group>"; };
7AE32D6827F06536004EF6E0 /* CoreDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataSource.swift; sourceTree = "<group>"; }; 7AE32D6827F06536004EF6E0 /* CoreDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataSource.swift; sourceTree = "<group>"; };
7AE32D7027F06DA4004EF6E0 /* DateSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateSection.swift; sourceTree = "<group>"; }; 7AE32D7027F06DA4004EF6E0 /* DateSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateSection.swift; sourceTree = "<group>"; };
7AFD7ADF2871823E00BCCD37 /* SidebarSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarSection.swift; sourceTree = "<group>"; };
7AFD7AE12871826D00BCCD37 /* SidebarItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarItem.swift; sourceTree = "<group>"; };
7AFD7AE3287182CD00BCCD37 /* SidebarFilterItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarFilterItem.swift; sourceTree = "<group>"; };
7AFD7AE528718BF000BCCD37 /* Filter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Filter.swift; sourceTree = "<group>"; };
7AFD7AE72871B7DA00BCCD37 /* MainSplitController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainSplitController.swift; sourceTree = "<group>"; };
7AFD7AEA2872355000BCCD37 /* MainWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainWindowController.swift; sourceTree = "<group>"; };
929EDE7E27F89C3000E55F65 /* VEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VEngine.swift; sourceTree = "<group>"; }; 929EDE7E27F89C3000E55F65 /* VEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VEngine.swift; sourceTree = "<group>"; };
929EDE8027F8A75E00E55F65 /* VPhoto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPhoto.swift; sourceTree = "<group>"; }; 929EDE8027F8A75E00E55F65 /* VPhoto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPhoto.swift; sourceTree = "<group>"; };
929EDE8227F8C6C500E55F65 /* VOwnershipPeriod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VOwnershipPeriod.swift; sourceTree = "<group>"; }; 929EDE8227F8C6C500E55F65 /* VOwnershipPeriod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VOwnershipPeriod.swift; sourceTree = "<group>"; };
@ -361,12 +373,13 @@
path = Components; path = Components;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
7A0391DB28593DAB000EE522 /* Controller */ = { 7A0391DB28593DAB000EE522 /* Controllers */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7A0391DC28593DBC000EE522 /* SidebarController.swift */, 7AFD7ADE2871822000BCCD37 /* Sidebar */,
7AFD7AE72871B7DA00BCCD37 /* MainSplitController.swift */,
); );
path = Controller; path = Controllers;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
7A24C19427EE212E00049E7F /* Fonts */ = { 7A24C19427EE212E00049E7F /* Fonts */ = {
@ -539,6 +552,7 @@
7A49F50827D406CB00AEAAE0 /* Response.swift */, 7A49F50827D406CB00AEAAE0 /* Response.swift */,
7A49F50927D406CB00AEAAE0 /* Settings.swift */, 7A49F50927D406CB00AEAAE0 /* Settings.swift */,
7A49F50A27D406CB00AEAAE0 /* PlateNumber.swift */, 7A49F50A27D406CB00AEAAE0 /* PlateNumber.swift */,
7AFD7AE528718BF000BCCD37 /* Filter.swift */,
); );
path = Models; path = Models;
sourceTree = "<group>"; sourceTree = "<group>";
@ -584,7 +598,8 @@
7A9FD4052857AF590057ECFA /* AutoCat2Mac */ = { 7A9FD4052857AF590057ECFA /* AutoCat2Mac */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7A0391DB28593DAB000EE522 /* Controller */, 7AFD7AE92872353B00BCCD37 /* Window */,
7A0391DB28593DAB000EE522 /* Controllers */,
7A9FD4062857AF590057ECFA /* AppDelegate.swift */, 7A9FD4062857AF590057ECFA /* AppDelegate.swift */,
7A9FD4082857AF590057ECFA /* ViewController.swift */, 7A9FD4082857AF590057ECFA /* ViewController.swift */,
7A9FD40A2857AF5A0057ECFA /* Assets.xcassets */, 7A9FD40A2857AF5A0057ECFA /* Assets.xcassets */,
@ -625,6 +640,25 @@
path = DataSource; path = DataSource;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
7AFD7ADE2871822000BCCD37 /* Sidebar */ = {
isa = PBXGroup;
children = (
7A0391DC28593DBC000EE522 /* SidebarController.swift */,
7AFD7ADF2871823E00BCCD37 /* SidebarSection.swift */,
7AFD7AE12871826D00BCCD37 /* SidebarItem.swift */,
7AFD7AE3287182CD00BCCD37 /* SidebarFilterItem.swift */,
);
path = Sidebar;
sourceTree = "<group>";
};
7AFD7AE92872353B00BCCD37 /* Window */ = {
isa = PBXGroup;
children = (
7AFD7AEA2872355000BCCD37 /* MainWindowController.swift */,
);
path = Window;
sourceTree = "<group>";
};
929EDE8A27F8E84F00E55F65 /* vmodels */ = { 929EDE8A27F8E84F00E55F65 /* vmodels */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -962,6 +996,7 @@
7A49F50227D406C300AEAAE0 /* StorageService.swift in Sources */, 7A49F50227D406C300AEAAE0 /* StorageService.swift in Sources */,
7A49F4FE27D406BA00AEAAE0 /* AnyEncodable.swift in Sources */, 7A49F4FE27D406BA00AEAAE0 /* AnyEncodable.swift in Sources */,
7ABAB2E627FDF83100553691 /* GenericMethodMock.swift in Sources */, 7ABAB2E627FDF83100553691 /* GenericMethodMock.swift in Sources */,
7AFD7AE628718BF000BCCD37 /* Filter.swift in Sources */,
7A49F51227D406CB00AEAAE0 /* VName.swift in Sources */, 7A49F51227D406CB00AEAAE0 /* VName.swift in Sources */,
7A1D80E827F30399007BD64F /* VModel.swift in Sources */, 7A1D80E827F30399007BD64F /* VModel.swift in Sources */,
7A49F51127D406CB00AEAAE0 /* PlateNumber.swift in Sources */, 7A49F51127D406CB00AEAAE0 /* PlateNumber.swift in Sources */,
@ -1005,6 +1040,11 @@
files = ( files = (
7A9FD4092857AF590057ECFA /* ViewController.swift in Sources */, 7A9FD4092857AF590057ECFA /* ViewController.swift in Sources */,
7A0391DD28593DBC000EE522 /* SidebarController.swift in Sources */, 7A0391DD28593DBC000EE522 /* SidebarController.swift in Sources */,
7AFD7AE02871823E00BCCD37 /* SidebarSection.swift in Sources */,
7AFD7AE4287182CD00BCCD37 /* SidebarFilterItem.swift in Sources */,
7AFD7AE82871B7DA00BCCD37 /* MainSplitController.swift in Sources */,
7AFD7AE22871826D00BCCD37 /* SidebarItem.swift in Sources */,
7AFD7AEB2872355000BCCD37 /* MainWindowController.swift in Sources */,
7A9FD4072857AF590057ECFA /* AppDelegate.swift in Sources */, 7A9FD4072857AF590057ECFA /* AppDelegate.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -1344,7 +1384,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 12.0; MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCatCore; PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCatCore;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
@ -1379,7 +1419,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 12.0; MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCatCore; PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCatCore;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
@ -1453,7 +1493,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 12.3; MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat2Mac; PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat2Mac;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@ -1486,7 +1526,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 12.3; MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat2Mac; PRODUCT_BUNDLE_IDENTIFIER = pro.aliencat.AutoCat2Mac;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";

View File

@ -685,7 +685,7 @@
<!--Window Controller--> <!--Window Controller-->
<scene sceneID="WgK-OL-38a"> <scene sceneID="WgK-OL-38a">
<objects> <objects>
<windowController id="ANK-bM-ijm" sceneMemberID="viewController"> <windowController id="ANK-bM-ijm" customClass="MainWindowController" customModule="AutoCat2Mac" customModuleProvider="target" sceneMemberID="viewController">
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="MainWindow" animationBehavior="default" id="XfF-RB-9vb"> <window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="MainWindow" animationBehavior="default" id="XfF-RB-9vb">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/> <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
@ -695,15 +695,22 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/> <rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
</view> </view>
<toolbar key="toolbar" implicitIdentifier="09D11707-F4A3-4FD5-970E-AC5832E91C2B" autosavesConfiguration="NO" displayMode="iconAndLabel" sizeMode="regular" id="ERp-ah-8R1"> <toolbar key="toolbar" implicitIdentifier="09D11707-F4A3-4FD5-970E-AC5832E91C2B" autosavesConfiguration="NO" displayMode="iconOnly" sizeMode="regular" id="ERp-ah-8R1">
<allowedToolbarItems> <allowedToolbarItems>
<toolbarItem implicitItemIdentifier="NSToolbarShowColorsItem" id="Kow-NZ-nnQ"/> <toolbarItem implicitItemIdentifier="NSToolbarShowColorsItem" id="Kow-NZ-nnQ"/>
<toolbarItem implicitItemIdentifier="NSToolbarShowFontsItem" id="xeI-Ij-CqS"/> <toolbarItem implicitItemIdentifier="NSToolbarShowFontsItem" id="xeI-Ij-CqS"/>
<toolbarItem implicitItemIdentifier="NSToolbarPrintItem" id="MRQ-nf-EwM"/> <toolbarItem implicitItemIdentifier="NSToolbarPrintItem" id="MRQ-nf-EwM"/>
<toolbarItem implicitItemIdentifier="NSToolbarSpaceItem" id="aUV-DI-a5F"/> <toolbarItem implicitItemIdentifier="NSToolbarSpaceItem" id="aUV-DI-a5F"/>
<toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="N2K-bn-QdP"/> <toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="N2K-bn-QdP"/>
<toolbarItem implicitItemIdentifier="4217B4EF-FB2D-4346-BB51-ED1F699496FE" label="New check" paletteLabel="Check new number" tag="-1" image="plus" catalog="system" sizingBehavior="auto" id="HR9-WR-cxc">
<connections>
<action selector="checkNewNumber:" target="ANK-bM-ijm" id="AhL-Do-AYS"/>
</connections>
</toolbarItem>
</allowedToolbarItems> </allowedToolbarItems>
<defaultToolbarItems> <defaultToolbarItems>
<toolbarItem reference="N2K-bn-QdP"/>
<toolbarItem reference="HR9-WR-cxc"/>
<toolbarItem reference="Kow-NZ-nnQ"/> <toolbarItem reference="Kow-NZ-nnQ"/>
<toolbarItem reference="xeI-Ij-CqS"/> <toolbarItem reference="xeI-Ij-CqS"/>
<toolbarItem reference="N2K-bn-QdP"/> <toolbarItem reference="N2K-bn-QdP"/>
@ -722,15 +729,15 @@
</objects> </objects>
<point key="canvasLocation" x="76" y="1001"/> <point key="canvasLocation" x="76" y="1001"/>
</scene> </scene>
<!--Split View Controller--> <!--Main Split Controller-->
<scene sceneID="p66-TL-mk9"> <scene sceneID="p66-TL-mk9">
<objects> <objects>
<splitViewController id="kVc-gr-gzC" sceneMemberID="viewController"> <splitViewController id="kVc-gr-gzC" customClass="MainSplitController" customModule="AutoCat2Mac" customModuleProvider="target" sceneMemberID="viewController">
<splitViewItems> <splitViewItems>
<splitViewItem canCollapse="YES" holdingPriority="260" behavior="sidebar" id="rnO-5p-cdV"/> <splitViewItem canCollapse="YES" holdingPriority="260" behavior="sidebar" id="rnO-5p-cdV"/>
<splitViewItem id="3Yu-p4-UFu"/> <splitViewItem id="3Yu-p4-UFu"/>
</splitViewItems> </splitViewItems>
<splitView key="splitView" dividerStyle="thin" vertical="YES" id="Dya-6b-MK1"> <splitView key="splitView" identifier="MainSplitViewID" autosaveName="MainSplitView" dividerStyle="thin" vertical="YES" id="Dya-6b-MK1">
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/> <rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
</splitView> </splitView>
@ -747,107 +754,126 @@
<scene sceneID="yd4-3O-Y98"> <scene sceneID="yd4-3O-Y98">
<objects> <objects>
<viewController id="8Zn-vq-a7w" customClass="SidebarController" customModule="AutoCat2Mac" customModuleProvider="target" sceneMemberID="viewController"> <viewController id="8Zn-vq-a7w" customClass="SidebarController" customModule="AutoCat2Mac" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" misplaced="YES" id="V8j-Wf-y5G"> <view key="view" id="V8j-Wf-y5G">
<rect key="frame" x="0.0" y="0.0" width="149" height="426"/> <rect key="frame" x="0.0" y="0.0" width="149" height="489"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<scrollView misplaced="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="s1Q-a7-rlG"> <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="28" horizontalPageScroll="10" verticalLineScroll="28" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zbf-Sa-jlX">
<rect key="frame" x="0.0" y="0.0" width="149" height="426"/> <rect key="frame" x="0.0" y="0.0" width="149" height="489"/>
<clipView key="contentView" drawsBackground="NO" id="7Wv-jl-4no"> <clipView key="contentView" drawsBackground="NO" id="SqE-1u-BH2">
<rect key="frame" x="0.0" y="0.0" width="149" height="426"/> <rect key="frame" x="0.0" y="0.0" width="149" height="489"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="sourceList" selectionHighlightStyle="sourceList" multipleSelection="NO" autosaveColumns="NO" rowHeight="19" rowSizeStyle="automatic" viewBased="YES" floatsGroupRows="NO" indentationPerLevel="13" outlineTableColumn="t3r-x8-w7V" id="OeX-nT-BfE"> <outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="sourceList" multipleSelection="NO" autosaveName="Sidebar" rowHeight="28" rowSizeStyle="automatic" viewBased="YES" floatsGroupRows="NO" indentationPerLevel="13" autosaveExpandedItems="YES" outlineTableColumn="RdD-fI-vom" id="d2l-fY-90X">
<rect key="frame" x="0.0" y="0.0" width="149" height="426"/> <rect key="frame" x="0.0" y="0.0" width="149" height="489"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="0.0"/> <size key="intercellSpacing" width="3" height="0.0"/>
<color key="backgroundColor" name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/> <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns> <tableColumns>
<tableColumn identifier="AutomaticTableColumnIdentifier.0" width="117" minWidth="16" maxWidth="1000" id="t3r-x8-w7V"> <tableColumn identifier="AutomaticTableColumnIdentifier.0" width="117" minWidth="16" maxWidth="1000" id="RdD-fI-vom">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border"> <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell> </tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="PA4-k7-tVc"> <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="gLE-0y-PGi">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews> <prototypeCellViews>
<tableCellView identifier="SidebarHeaderCell" id="hqM-tZ-7Xa"> <tableCellView identifier="SidebarHeaderCell" id="k5v-i3-GBI">
<rect key="frame" x="11" y="0.0" width="126" height="19"/> <rect key="frame" x="11" y="0.0" width="126" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0dI-58-quQ"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="u6m-3a-VB5">
<rect key="frame" x="0.0" y="3" width="126" height="14"/> <rect key="frame" x="0.0" y="1" width="126" height="14"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Header Cell" id="UmG-sU-6nm">
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Header Cell" id="HOp-Yr-00c">
<font key="font" metaFont="systemMedium" size="11"/> <font key="font" metaFont="systemMedium" size="11"/>
<color key="textColor" name="headerColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="headerColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
</subviews> </subviews>
<constraints>
<constraint firstItem="u6m-3a-VB5" firstAttribute="top" secondItem="k5v-i3-GBI" secondAttribute="top" constant="2" id="4Sz-3Z-RC7"/>
<constraint firstAttribute="trailing" secondItem="u6m-3a-VB5" secondAttribute="trailing" constant="2" id="tu5-Mn-sgd"/>
<constraint firstItem="u6m-3a-VB5" firstAttribute="leading" secondItem="k5v-i3-GBI" secondAttribute="leading" constant="2" id="xdl-UX-l6G"/>
<constraint firstAttribute="bottom" secondItem="u6m-3a-VB5" secondAttribute="bottom" constant="1" id="y16-PJ-JTS"/>
</constraints>
<connections> <connections>
<outlet property="textField" destination="0dI-58-quQ" id="8uM-bh-UhW"/> <outlet property="textField" destination="u6m-3a-VB5" id="sZS-wk-2Oc"/>
</connections> </connections>
</tableCellView> </tableCellView>
<tableCellView identifier="DataCell" id="AhF-Lk-Fp8"> <tableCellView identifier="SidebarItemCell" id="eUb-OR-IxL">
<rect key="frame" x="11" y="19" width="126" height="17"/> <rect key="frame" x="11" y="17" width="126" height="27"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3Sv-b8-VRc"> <imageView translatesAutoresizingMaskIntoConstraints="NO" id="qD0-Bm-WN7">
<rect key="frame" x="3" y="0.0" width="17" height="17"/> <rect key="frame" x="3" y="5" width="17" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <constraints>
<imageCell key="cell" refusesFirstResponder="YES" imageScaling="proportionallyDown" image="NSActionTemplate" id="xpW-4f-Iuo"/> <constraint firstAttribute="height" constant="11" id="PLc-Ox-Ckh"/>
<constraint firstAttribute="width" constant="17" id="XfT-EV-Xms"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" imageScaling="proportionallyDown" image="NSActionTemplate" id="ewq-0M-OAX"/>
</imageView> </imageView>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tEe-zV-PD8"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="A96-IM-JbT">
<rect key="frame" x="25" y="0.0" width="101" height="17"/> <rect key="frame" x="25" y="6" width="96" height="16"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="oKl-mJ-ZEi">
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="Suo-6o-hMn">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
</subviews> </subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="A96-IM-JbT" secondAttribute="trailing" constant="7" id="F0K-EC-Gqs"/>
<constraint firstItem="A96-IM-JbT" firstAttribute="leading" secondItem="qD0-Bm-WN7" secondAttribute="trailing" constant="7" id="GCe-Fp-zhD"/>
<constraint firstItem="qD0-Bm-WN7" firstAttribute="top" secondItem="eUb-OR-IxL" secondAttribute="top" constant="8" id="OAV-Oj-e5b"/>
<constraint firstAttribute="bottom" secondItem="qD0-Bm-WN7" secondAttribute="bottom" constant="8" id="d8y-Ph-SrP"/>
<constraint firstItem="A96-IM-JbT" firstAttribute="leading" secondItem="qD0-Bm-WN7" secondAttribute="trailing" constant="7" id="evl-EN-QSH"/>
<constraint firstItem="A96-IM-JbT" firstAttribute="centerY" secondItem="eUb-OR-IxL" secondAttribute="centerY" id="gdH-E5-hzg"/>
<constraint firstItem="qD0-Bm-WN7" firstAttribute="leading" secondItem="eUb-OR-IxL" secondAttribute="leading" constant="3" id="jDC-Ov-2MF"/>
</constraints>
<connections> <connections>
<outlet property="imageView" destination="3Sv-b8-VRc" id="67o-jv-QEC"/> <outlet property="imageView" destination="qD0-Bm-WN7" id="Ixk-H5-gcS"/>
<outlet property="textField" destination="tEe-zV-PD8" id="EEe-dN-6BI"/> <outlet property="textField" destination="A96-IM-JbT" id="bId-II-VE0"/>
</connections> </connections>
</tableCellView> </tableCellView>
</prototypeCellViews> </prototypeCellViews>
</tableColumn> </tableColumn>
</tableColumns> </tableColumns>
<connections> <connections>
<outlet property="dataSource" destination="8Zn-vq-a7w" id="Ual-F4-9We"/> <outlet property="dataSource" destination="8Zn-vq-a7w" id="Yvp-lX-AfJ"/>
<outlet property="delegate" destination="8Zn-vq-a7w" id="eNL-2H-9bV"/> <outlet property="delegate" destination="8Zn-vq-a7w" id="qhF-dH-xNY"/>
</connections> </connections>
</outlineView> </outlineView>
</subviews> </subviews>
<nil key="backgroundColor"/> <nil key="backgroundColor"/>
</clipView> </clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="ekM-et-eqh"> <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="rhX-ct-wPT">
<rect key="frame" x="1" y="119" width="238" height="15"/> <rect key="frame" x="1" y="119" width="238" height="15"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
</scroller> </scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="mfB-xJ-TpP"> <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="njn-R9-YRd">
<rect key="frame" x="224" y="17" width="15" height="102"/> <rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
</scroller> </scroller>
</scrollView> </scrollView>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="s1Q-a7-rlG" firstAttribute="leading" secondItem="V8j-Wf-y5G" secondAttribute="leading" id="dnc-YM-ev5"/> <constraint firstItem="zbf-Sa-jlX" firstAttribute="top" secondItem="V8j-Wf-y5G" secondAttribute="top" id="0WG-xL-Z0O"/>
<constraint firstItem="s1Q-a7-rlG" firstAttribute="top" secondItem="V8j-Wf-y5G" secondAttribute="top" id="eh6-Qd-AKv"/> <constraint firstItem="zbf-Sa-jlX" firstAttribute="trailing" secondItem="mm0-rn-2nX" secondAttribute="trailing" id="M9M-tz-rnP"/>
<constraint firstItem="s1Q-a7-rlG" firstAttribute="bottom" secondItem="mm0-rn-2nX" secondAttribute="bottom" id="sen-1d-Irx"/> <constraint firstItem="zbf-Sa-jlX" firstAttribute="bottom" secondItem="mm0-rn-2nX" secondAttribute="bottom" id="X2g-Pa-QEZ"/>
<constraint firstItem="s1Q-a7-rlG" firstAttribute="trailing" secondItem="mm0-rn-2nX" secondAttribute="trailing" id="slp-Au-tMP"/> <constraint firstItem="zbf-Sa-jlX" firstAttribute="leading" secondItem="V8j-Wf-y5G" secondAttribute="leading" id="syy-IU-YFy"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="mm0-rn-2nX"/> <viewLayoutGuide key="safeArea" id="mm0-rn-2nX"/>
<viewLayoutGuide key="layoutMargins" id="OCA-xY-Jg3"/> <viewLayoutGuide key="layoutMargins" id="OCA-xY-Jg3"/>
</view> </view>
<connections>
<outlet property="outlineView" destination="d2l-fY-90X" id="sIb-7A-Hxb"/>
</connections>
</viewController> </viewController>
<customObject id="WOV-sh-nF6" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> <customObject id="WOV-sh-nF6" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects> </objects>
@ -871,5 +897,6 @@
</scenes> </scenes>
<resources> <resources>
<image name="NSActionTemplate" width="15" height="15"/> <image name="NSActionTemplate" width="15" height="15"/>
<image name="plus" catalog="system" width="14" height="13"/>
</resources> </resources>
</document> </document>

View File

@ -1,94 +0,0 @@
//
// MainController.swift
// AutoCat2Mac
//
// Created by Selim Mustafaev on 15.06.2022.
//
import AppKit
enum SidebarSection: Int, CaseIterable {
case source
var name: String {
switch self {
case .source:
return "Vehicles DB"
}
}
}
enum VehicleSource: Int, CaseIterable {
case local
case remote
var name: String {
switch self {
case .local:
return "Local history"
case .remote:
return "Remote DB"
}
}
var iconName: String {
switch self {
case .local:
return "internaldrive"
case .remote:
return "externaldrive.connected.to.line.below"
}
}
}
class SidebarController: NSViewController, NSOutlineViewDataSource, NSOutlineViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
}
// MARK: - NSOutlineViewDataSource
func outlineView(_ outlineView: NSOutlineView, numberOfChildrenOfItem item: Any?) -> Int {
guard item != nil else {
return SidebarSection.allCases.count
}
if let section = item as? SidebarSection {
return VehicleSource.allCases.count
} else {
return 0
}
}
func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
guard item != nil else {
return SidebarSection.source
}
if let section = item as? SidebarSection {
return VehicleSource.allCases[index]
} else {
return SidebarSection.source
}
}
func outlineView(_ outlineView: NSOutlineView, isItemExpandable item: Any) -> Bool {
return item is SidebarSection
}
// MARK: - NSOutlineViewDelegate
func outlineView(_ outlineView: NSOutlineView, viewFor tableColumn: NSTableColumn?, item: Any) -> NSView? {
if let category = item as? SidebarSection {
let cell = outlineView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "SidebarHeaderCell"), owner: nil) as? NSTableCellView
cell?.textField?.stringValue = category.name
return cell
}
return nil
}
}

View File

@ -0,0 +1,17 @@
//
// MainSplitController.swift
// AutoCat2Mac
//
// Created by Selim Mustafaev on 03.07.2022.
//
import AppKit
class MainSplitController: NSSplitViewController {
override func viewDidLoad() {
super.viewDidLoad()
splitView.autosaveName = "MainSplitViewAutosave"
}
}

View File

@ -0,0 +1,108 @@
//
// MainController.swift
// AutoCat2Mac
//
// Created by Selim Mustafaev on 15.06.2022.
//
import AppKit
class SidebarController: NSViewController, NSOutlineViewDataSource, NSOutlineViewDelegate {
@IBOutlet weak var outlineView: NSOutlineView!
var sections: [SidebarSection] = [
.database(items: [
SidebarFilterItem.local,
SidebarFilterItem.remote
])
]
var addItem: NSToolbarItem?
override func viewDidLoad() {
super.viewDidLoad()
outlineView.usesAutomaticRowHeights = true
}
// MARK: - NSOutlineViewDataSource
func outlineView(_ outlineView: NSOutlineView, numberOfChildrenOfItem item: Any?) -> Int {
guard item != nil else {
return sections.count
}
if let section = item as? SidebarSection {
return section.items.count
} else {
return 0
}
}
func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
guard item != nil else {
return sections[index]
}
if let section = item as? SidebarSection {
return section.items[index]
} else {
return sections[index]
}
}
func outlineView(_ outlineView: NSOutlineView, isItemExpandable item: Any) -> Bool {
return item is SidebarSection
}
// MARK: - NSOutlineViewDelegate
func outlineView(_ outlineView: NSOutlineView, viewFor tableColumn: NSTableColumn?, item: Any) -> NSView? {
if let category = item as? SidebarSection {
let cell = outlineView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "SidebarHeaderCell"), owner: nil) as? NSTableCellView
cell?.textField?.stringValue = category.name
return cell
} else if let item = item as? SidebarItem {
let cell = outlineView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "SidebarItemCell"), owner: nil) as? NSTableCellView
cell?.textField?.stringValue = item.title
cell?.imageView?.image = NSImage(systemSymbolName: item.iconName, accessibilityDescription: item.title)
return cell
}
return nil
}
func outlineView(_ outlineView: NSOutlineView, isGroupItem item: Any) -> Bool {
item is SidebarSection
}
func outlineView(_ outlineView: NSOutlineView, shouldSelectItem item: Any) -> Bool {
outlineView.parent(forItem: item) != nil
}
func outlineView(_ outlineView: NSOutlineView, persistentObjectForItem item: Any?) -> Any? {
guard let section = item as? SidebarSection else {
return nil
}
return section.name
}
func outlineView(_ outlineView: NSOutlineView, itemForPersistentObject object: Any) -> Any? {
guard let name = object as? String else {
return nil
}
return sections.first { $0.name == name }
}
func outlineViewSelectionDidChange(_ notification: Notification) {
let item = self.outlineView.item(atRow: self.outlineView.selectedRow)
if let filter = item as? SidebarFilterItem {
print("Selected filter: ", filter.title)
}
}
}

View File

@ -0,0 +1,38 @@
//
// SidebarFilterItem.swift
// AutoCat2Mac
//
// Created by Selim Mustafaev on 03.07.2022.
//
import AutoCatCore
class SidebarFilterItem: SidebarItem {
var iconName: String
var title: String
var badge: Int?
let filter: Filter
init(iconName: String, title: String, filter: Filter) {
self.iconName = iconName
self.title = title
self.filter = filter
}
static var local: SidebarFilterItem {
SidebarFilterItem(iconName: "internaldrive",
title: "Local history",
filter: Filter(dataSource: .local))
}
static var remote: SidebarFilterItem {
SidebarFilterItem(iconName: "externaldrive.connected.to.line.below",
title: "Remote DB",
filter: Filter(dataSource: .remote))
}
}

View File

@ -0,0 +1,15 @@
//
// SidebarItem.swift
// AutoCat2Mac
//
// Created by Selim Mustafaev on 03.07.2022.
//
import Foundation
protocol SidebarItem {
var iconName: String { get }
var title: String { get }
var badge: Int? { get }
}

View File

@ -0,0 +1,24 @@
//
// SidebarSection.swift
// AutoCat2Mac
//
// Created by Selim Mustafaev on 03.07.2022.
//
import Foundation
class SidebarSection {
let name: String
let items: [SidebarItem]
init(name: String, items: [SidebarItem]) {
self.name = name
self.items = items
}
static func database(items: [SidebarItem]) -> SidebarSection {
SidebarSection(name: "Vehicles DB", items: items)
}
}

View File

@ -0,0 +1,30 @@
//
// MainWindowController.swift
// AutoCat2Mac
//
// Created by Selim Mustafaev on 03.07.2022.
//
import AppKit
class MainWindowController: NSWindowController {
override func windowDidLoad() {
super.windowDidLoad()
}
override func awakeFromNib() {
super.awakeFromNib()
// First - flexible space item
// Second - new number check item
// Third - sidebar separator item
window?.toolbar?.insertItem(withItemIdentifier: .sidebarTrackingSeparator, at: 2)
}
// MARK: - Toolbar actions
@IBAction func checkNewNumber(_ sender: NSToolbarItem) {
print("Check new number")
}
}

View File

@ -0,0 +1,23 @@
//
// Filter.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 03.07.2022.
//
import Foundation
public enum DataSource {
case local
case remote
}
public class Filter {
var dataSource: DataSource = .remote
public init(dataSource: DataSource) {
self.dataSource = dataSource
}
}