mac: Redraw icon when menu is closed
This commit is contained in:
parent
4b9ff309ec
commit
58dee04d5c
2 changed files with 23 additions and 2 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "atom/browser/ui/atom_menu_model.h"
|
||||
#include "atom/browser/ui/tray_icon.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
|
||||
|
@ -17,7 +18,8 @@
|
|||
|
||||
namespace atom {
|
||||
|
||||
class TrayIconCocoa : public TrayIcon {
|
||||
class TrayIconCocoa : public TrayIcon,
|
||||
public AtomMenuModel::Observer {
|
||||
public:
|
||||
TrayIconCocoa();
|
||||
virtual ~TrayIconCocoa();
|
||||
|
@ -30,6 +32,10 @@ class TrayIconCocoa : public TrayIcon {
|
|||
void PopContextMenu(const gfx::Point& pos) override;
|
||||
void SetContextMenu(ui::SimpleMenuModel* menu_model) override;
|
||||
|
||||
protected:
|
||||
// AtomMenuModel::Observer:
|
||||
void MenuClosed() override;
|
||||
|
||||
private:
|
||||
// Atom custom view for NSStatusItem.
|
||||
base::scoped_nsobject<StatusItemView> status_item_view_;
|
||||
|
@ -37,6 +43,9 @@ class TrayIconCocoa : public TrayIcon {
|
|||
// Status menu shown when right-clicking the system icon.
|
||||
base::scoped_nsobject<AtomMenuController> menu_;
|
||||
|
||||
// Used for unregistering observer.
|
||||
AtomMenuModel* menu_model_; // weak ref.
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TrayIconCocoa);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue