Skip to content

Commit ee38def

Browse files
committed
Update MenuBarItemManager.swift
1 parent 2ddb1e5 commit ee38def

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Diff for: Ice/MenuBar/MenuBarItems/MenuBarItemManager.swift

+14-4
Original file line numberDiff line numberDiff line change
@@ -374,22 +374,31 @@ extension MenuBarItemManager {
374374
enum ErrorCode: Int, CustomStringConvertible {
375375
/// An operation could not be completed.
376376
case couldNotComplete
377+
377378
/// The creation of a menu bar item event failed.
378379
case eventCreationFailure
380+
379381
/// The shared app state is invalid or could not be found.
380382
case invalidAppState
383+
381384
/// An event source could not be created or is otherwise invalid.
382385
case invalidEventSource
386+
383387
/// The location of the mouse cursor is invalid or could not be found.
384388
case invalidCursorLocation
389+
385390
/// A menu bar item is invalid.
386391
case invalidItem
392+
387393
/// A menu bar item cannot be moved.
388394
case notMovable
395+
389396
/// A menu bar item event operation timed out.
390397
case eventOperationTimeout
398+
391399
/// A menu bar item frame check timed out.
392400
case frameCheckTimeout
401+
393402
/// An operation timed out.
394403
case otherTimeout
395404

@@ -537,10 +546,8 @@ extension MenuBarItemManager {
537546
/// A string to use for logging purposes.
538547
var logString: String {
539548
switch self {
540-
case .leftOfItem(let item):
541-
"left of \(item.logString)"
542-
case .rightOfItem(let item):
543-
"right of \(item.logString)"
549+
case .leftOfItem(let item): "left of \(item.logString)"
550+
case .rightOfItem(let item): "right of \(item.logString)"
544551
}
545552
}
546553
}
@@ -698,6 +705,7 @@ extension MenuBarItemManager {
698705

699706
Logger.itemManager.debug("Received \(type.logString) at \(location.logString) (item: \(item.logString))")
700707

708+
// Disable the tap and resume the continuation.
701709
proxy.disable()
702710
continuation.resume()
703711

@@ -710,6 +718,7 @@ extension MenuBarItemManager {
710718
continuation.resume(throwing: EventError(code: .eventOperationTimeout, item: item))
711719
}
712720

721+
// Post the event to the location.
713722
postEvent(event, to: location)
714723
}
715724
}
@@ -1458,6 +1467,7 @@ private enum MenuBarItemEventButtonState {
14581467
private enum MenuBarItemEventType {
14591468
/// The event type for moving a menu bar item.
14601469
case move(MenuBarItemEventButtonState)
1470+
14611471
/// The event type for clicking a menu bar item.
14621472
case click(MenuBarItemEventButtonState)
14631473

0 commit comments

Comments
 (0)