{"id":18031750,"url":"https://github.com/dagronf/dsfactionbar","last_synced_at":"2025-03-27T05:30:55.942Z","repository":{"id":63907290,"uuid":"327538507","full_name":"dagronf/DSFActionBar","owner":"dagronf","description":"An editable, draggable bar of buttons and menus similar to Safari's Favorites bar with overflow support for macOS (10.11 and later).","archived":false,"fork":false,"pushed_at":"2021-02-18T22:51:18.000Z","size":107,"stargazers_count":15,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T04:31:39.703Z","etag":null,"topics":["button-bar","macos","objc","overflow","swift","tabs","ui-components"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dagronf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-07T07:39:16.000Z","updated_at":"2024-04-03T01:13:45.000Z","dependencies_parsed_at":"2022-11-29T13:21:14.667Z","dependency_job_id":null,"html_url":"https://github.com/dagronf/DSFActionBar","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFActionBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFActionBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFActionBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFActionBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dagronf","download_url":"https://codeload.github.com/dagronf/DSFActionBar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791335,"owners_count":20672665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["button-bar","macos","objc","overflow","swift","tabs","ui-components"],"created_at":"2024-10-30T10:10:39.592Z","updated_at":"2025-03-27T05:30:55.561Z","avatar_url":"https://github.com/dagronf.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DSFActionBar\n\n\u003ca href=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/safari-style-tab-bar-expanded.png?raw=true\"\u003e\u003cimg src=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/safari-style-tab-bar-expanded.png?raw=true\" width=\"690\"\u003e\u003c/a\u003e\n\n\u003ca href=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/keychain-style-tab-bar-complete.png?raw=true\"\u003e\u003cimg src=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/keychain-style-tab-bar-complete.png?raw=true\" width=\"490\"\u003e\u003c/a\u003e\n\nAn editable, draggable bar of buttons and menus similar to Safari's Favorites bar with overflow support for macOS (10.11 and later).\n\n![](https://img.shields.io/github/v/tag/dagronf/DSFActionBar) ![](https://img.shields.io/badge/macOS-10.11+-red) ![](https://img.shields.io/badge/Swift-5.3-orange.svg)\n![](https://img.shields.io/badge/License-MIT-lightgrey) [![](https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager)\n\n# Classes\n\n## DSFActionBar\n\nA collection of buttons (items).  If not enough space is available to display all the items, a 'More Items' button appears with the hidden buttons in it.\n\nThis control was inspired by Safari's favorites bar.\n\n\u003ca href=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/safari-style-tab-bar-expanded.png?raw=true\"\u003e\u003cimg src=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/safari-style-tab-bar-expanded.png?raw=true\" width=\"600\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/safari-style-tab-bar-overflow.png?raw=true\"\u003e\u003cimg src=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/safari-style-tab-bar-overflow.png?raw=true\" width=\"300\"\u003e\u003c/a\u003e\n\n\u003ca href=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/safari-style.mp4?raw=true\"\u003eDemo Movie\u003c/a\u003e\n\n### Features\n\n* Center or left-align the item collection\n* Set the background color\n* Add, remove, rename items\n* Enable/Disable items\n* Right-click on item detection\n* Overflow support when the available space is too narrow\n* (Optional) dropdown menu support for items\n* (Optional) reordering via dragging the items\n\n### Example\n\n```swift\nself.actionBar.actionDelegate = self\n\n// Add a simple 'job' button with a target/action\nself.actionBar.add(\"Jobs\", target: self, action: #selector(self.jobItem(_:)))\n\n// Add a button with a drop-down menu\nlet menu = NSMenu()\nmenu.addItem(withTitle: \"first\", action: #selector(self.firstItem(_:)), keyEquivalent: \"\")\nmenu.addItem(withTitle: \"second\", action: #selector(self.secondItem(_:)), keyEquivalent: \"\")\nmenu.addItem(withTitle: \"third\", action: #selector(self.thirdItem(_:)), keyEquivalent: \"\")\nself.actionBar.add(\"Ordering\", menu: menu)\n```\n\n## DSFActionTabBar\n\nA collection of buttons that act as a tab bar.  If not enough space is available, a 'More Items' button appears with the 'hidden' tabs in it.\n\nFor an example of this, look at detail pane in KeyChain Access - \"All Items\", \"Password\" etc. It is this KeyChain Access app that partially inspired this control - as you will notice that if you resize the window smaller than the tabs it just draws off-screen)\n\n### Screenshots\n\n\u003ca href=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/keychain-style-tab-bar-complete.png?raw=true\"\u003e\u003cimg src=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/keychain-style-tab-bar-complete.png?raw=true\" width=\"600\"\u003e\u003c/a\u003e\n\n\u003ca href=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/keychain-style-tab-bar-overflow.png?raw=true\"\u003e\u003cimg src=\"https://github.com/dagronf/dagronf.github.io/blob/master/art/projects/DSFActionBar/keychain-style-tab-bar-overflow.png?raw=true\" width=\"500\"\u003e\u003c/a\u003e\n\n\u003ca href=\"https://github.com/dagronf/dagronf.github.io/raw/master/art/projects/DSFActionBar/keychain-style.mp4\"\u003eDemo Movie\u003c/a\u003e\n\n### Features\n\n* Center or left-align the item collection\n* Set the background color\n* Add, remove, rename items\n* Enable/Disable items\n* Overflow support when the available space is too narrow\n\n### Example\n\n```swift\n// Set the delegate so that we receive tab selection messages\nself.actionTabBar.actionTabDelegate = self\n\n// Add our items\nself.actionTabBar.add(\"All Items\")\nself.actionTabBar.add(\"Passwords\")\nself.actionTabBar.add(\"Secure Notes\")\nself.actionTabBar.add(\"My Certificates\")\nself.actionTabBar.add(\"Keys\")\nself.actionTabBar.add(\"Certificates\")\n\n...\n\nextension MyViewController: DSFActionTabBarDelegate {\n\tfunc actionTabBar(_ actionTabBar: DSFActionTabBar, didSelectItem item: DSFActionBarItem, atIndex index: Int) {\n\t\tSwift.print(\"Selected tab \\(index) for item '\\(item.title)'\")\n\t}\n}\n```\n\n# Demo\n\nYou can find some demo apps in the `Demos` subfolder.\n\n# Installation\n\n## Swift Package Manager\n\nAdd `https://github.com/dagronf/DSFActionBar` to your project.\n\n# Usage\n\n## Via Interface Builder\n\n* Add a custom NSView using Interface Builder, then change the class type to `DSFActionBar` or `DSFActionTabBar` as needed.\n\n## Programatically\n\n```swift\nlet actionBar = DSFActionBar(frame: rect)\nlet tabBar = DSFActionTabBar(frame: rect)\n```\n\n# Known issues\n\n* Dragging after changing the theme (ie. dark mode -\u003e standard) the draw background still uses the color of the previous theme.\n\n# Thanks\n\n## DraggableStackView - Mark Onyschuk\n\n* Mark Onyschuk on [GitHub](https://github.com/monyschuk) -- [Draggable Stack View](https://gist.github.com/monyschuk/cbca3582b6b996ab54c32e2d7eceaf25)\n\n# Changes\n\n## `1.0.0`\n\n* Fixed issue when dragging off the bar not resetting the cursor. ([link](https://github.com/dagronf/DSFActionBar/issues/1))\n\n\n# License\n```\nMIT License\n\nCopyright (c) 2021 Darren Ford\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fdsfactionbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdagronf%2Fdsfactionbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fdsfactionbar/lists"}