Merge pull request #2337 from nishanths/feature/bounds-tray-dblclick

Send bounding Rect on tray double click events
This commit is contained in:
Cheng Zhao 2015-07-29 11:27:04 +08:00
commit 0ca9dfbc12
7 changed files with 15 additions and 8 deletions

View file

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

View file

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

View file

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

View file

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