Skip to content

Commit

Permalink
fix dark mode alert style (#137)
Browse files Browse the repository at this point in the history
* fix dark mode alert style
* update CHANGES.rst
  • Loading branch information
jaredks committed May 22, 2020
1 parent 7fb9e87 commit 5a868f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,7 @@ Changes
0.3.0.dev
---------

- Fix dark mode alert style #137
- Notifications: fixes, cleanup, and tests #131
- Fix slider for some older macOS versions (10.11 and before?)
- Keyboard interrupts now stop a running application
Expand Down
2 changes: 2 additions & 0 deletions rumps/rumps.py
Expand Up @@ -75,6 +75,7 @@ def alert(title=None, message='', ok=None, cancel=None, other=None, icon_path=No
cancel = 'Cancel' if cancel else None
alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
title, ok, cancel, other, message)
alert.window().setAppearance_(AppKit.NSAppearance.currentAppearance())
alert.setAlertStyle_(0) # informational style
if icon_path is not None:
icon = _nsimage_from_file(icon_path)
Expand Down Expand Up @@ -846,6 +847,7 @@ def run(self):
:return: a :class:`rumps.rumps.Response` object that contains the text and the button clicked as an integer.
"""
_log(self)
self._alert.window().setAppearance_(AppKit.NSAppearance.currentAppearance())
clicked = self._alert.runModal() % 999
if clicked > 2 and self._cancel:
clicked -= 1
Expand Down

0 comments on commit 5a868f4

Please sign in to comment.