{"id":19690947,"url":"https://github.com/insidegui/customstatusbarwindow","last_synced_at":"2025-04-29T08:36:00.187Z","repository":{"id":140288187,"uuid":"335284683","full_name":"insidegui/CustomStatusBarWindow","owner":"insidegui","description":"Demonstrates a custom NSWindowController that can be attached to a NSStatusItem on macOS.","archived":false,"fork":false,"pushed_at":"2021-02-03T16:07:08.000Z","size":211,"stargazers_count":116,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-21T08:13:42.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insidegui.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-02-02T12:39:28.000Z","updated_at":"2024-12-12T00:59:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2cb01a9-bbce-48ee-a72c-a5a1f2ee1d2e","html_url":"https://github.com/insidegui/CustomStatusBarWindow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FCustomStatusBarWindow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FCustomStatusBarWindow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FCustomStatusBarWindow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FCustomStatusBarWindow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insidegui","download_url":"https://codeload.github.com/insidegui/CustomStatusBarWindow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251465424,"owners_count":21593880,"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":[],"created_at":"2024-11-11T19:07:27.119Z","updated_at":"2025-04-29T08:35:59.820Z","avatar_url":"https://github.com/insidegui.png","language":"Swift","readme":"This sample project demonstrates a custom `NSWindowController` that can be attached to a `NSStatusItem` on macOS, such that it behaves similarly to `NSPopover`, but without the popover animations and pointy bit. The code was extracted from my app [AirBuddy](https://airbuddy.app).\n\n![screenshot](./screenshot.png)\n\nCreating the controller is easy, it needs a status item to be its \"target\", and a view controller for its contents:\n\n```swift\nwindowController = StatusBarMenuWindowController(\n    statusItem: // your status item,\n    contentViewController: // any view controller\n)\n```\n\n**Important: the contentViewController must have its `preferredContentSize` set, the window will automatically resize itself based on that (including if it changes while visible).**\n\nTo present the window attached to the status item:\n\n```swift\nwindowController.showWindow(sender)\n```\n\nIf the status item's underlying window can't be found, the window will be positioned centered on screen as a fallback.\n\nThe implementation of `StatusBarMenuWindowController` also does a few things to make it behave more like system items like Control Center on macOS 11+, such as posting menu tracking notifications which cause the Menu Bar to stay expanded while it's visible on top of a full screen application.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsidegui%2Fcustomstatusbarwindow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsidegui%2Fcustomstatusbarwindow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsidegui%2Fcustomstatusbarwindow/lists"}