Skip to content

Commit

Permalink
Make modifier flag check less strict
Browse files Browse the repository at this point in the history
Fixes #410
  • Loading branch information
jordanbaird committed Oct 22, 2024
1 parent 54c6c9b commit 8fc8997
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Ice/UI/LayoutBar/LayoutBarItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ final class LayoutBarItemView: NSView {
return alert
}

/// Provides an alert to display when the user is pressing a key while
/// moving a menu bar item.
func provideAlertForKeyDown() -> NSAlert {
/// Provides an alert to display when the user is pressing the Command key
/// while moving a menu bar item.
func provideAlertForCommandKeyDown() -> NSAlert {
let alert = NSAlert()
alert.messageText = "Do not press keys while moving menu bar items."
alert.messageText = "Do not hold the Command key while moving a menu bar item."
return alert
}

Expand Down Expand Up @@ -160,8 +160,8 @@ final class LayoutBarItemView: NSView {
override func mouseDragged(with event: NSEvent) {
super.mouseDragged(with: event)

guard event.modifierFlags.isEmpty else {
let alert = provideAlertForKeyDown()
guard !event.modifierFlags.contains(.command) else {
let alert = provideAlertForCommandKeyDown()
alert.runModal()
return
}
Expand Down

0 comments on commit 8fc8997

Please sign in to comment.