Send bounding Rect on tray double click events

This commit is contained in:
Nishanth Shanmugham 2015-07-25 20:56:35 -07:00
parent 7ceca9f426
commit f53995d555
6 changed files with 8 additions and 8 deletions

View file

@ -44,8 +44,8 @@ void Tray::OnClicked(const gfx::Rect& bounds) {
Emit("clicked", bounds); Emit("clicked", bounds);
} }
void Tray::OnDoubleClicked() { void Tray::OnDoubleClicked(const gfx::Rect& bounds) {
Emit("double-clicked"); Emit("double-clicked", bounds);
} }
void Tray::OnBalloonShow() { void Tray::OnBalloonShow() {

View file

@ -43,7 +43,7 @@ class Tray : public mate::EventEmitter,
// TrayIconObserver: // TrayIconObserver:
void OnClicked(const gfx::Rect& bounds) override; void OnClicked(const gfx::Rect& bounds) override;
void OnDoubleClicked() override; void OnDoubleClicked(const gfx::Rect& bounds) override;
void OnBalloonShow() override; void OnBalloonShow() override;
void OnBalloonClicked() override; void OnBalloonClicked() override;
void OnBalloonClosed() override; void OnBalloonClosed() override;

View file

@ -33,8 +33,8 @@ void TrayIcon::NotifyClicked(const gfx::Rect& bounds) {
FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnClicked(bounds)); FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnClicked(bounds));
} }
void TrayIcon::NotifyDoubleClicked() { void TrayIcon::NotifyDoubleClicked(const gfx::Rect& bounds) {
FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnDoubleClicked()); FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnDoubleClicked(bounds));
} }
void TrayIcon::NotifyBalloonShow() { void TrayIcon::NotifyBalloonShow() {

View file

@ -55,7 +55,7 @@ class TrayIcon {
void AddObserver(TrayIconObserver* obs) { observers_.AddObserver(obs); } void AddObserver(TrayIconObserver* obs) { observers_.AddObserver(obs); }
void RemoveObserver(TrayIconObserver* obs) { observers_.RemoveObserver(obs); } void RemoveObserver(TrayIconObserver* obs) { observers_.RemoveObserver(obs); }
void NotifyClicked(const gfx::Rect& = gfx::Rect()); void NotifyClicked(const gfx::Rect& = gfx::Rect());
void NotifyDoubleClicked(); void NotifyDoubleClicked(const gfx::Rect& = gfx::Rect());
void NotifyBalloonShow(); void NotifyBalloonShow();
void NotifyBalloonClicked(); void NotifyBalloonClicked();
void NotifyBalloonClosed(); void NotifyBalloonClosed();

View file

@ -156,7 +156,7 @@ const CGFloat kMargin = 3;
} }
if (event.clickCount == 2 && !menuController_) { if (event.clickCount == 2 && !menuController_) {
trayIcon_->NotifyDoubleClicked(); trayIcon_->NotifyDoubleClicked([self getBoundsFromEvent:event]);
} }
[self setNeedsDisplay:YES]; [self setNeedsDisplay:YES];
} }

View file

@ -17,7 +17,7 @@ namespace atom {
class TrayIconObserver { class TrayIconObserver {
public: public:
virtual void OnClicked(const gfx::Rect& bounds) {} virtual void OnClicked(const gfx::Rect& bounds) {}
virtual void OnDoubleClicked() {} virtual void OnDoubleClicked(const gfx::Rect& bounds) {}
virtual void OnBalloonShow() {} virtual void OnBalloonShow() {}
virtual void OnBalloonClicked() {} virtual void OnBalloonClicked() {}
virtual void OnBalloonClosed() {} virtual void OnBalloonClosed() {}