Send bounding Rect on tray double click events
This commit is contained in:
parent
7ceca9f426
commit
f53995d555
6 changed files with 8 additions and 8 deletions
|
@ -44,8 +44,8 @@ void Tray::OnClicked(const gfx::Rect& bounds) {
|
|||
Emit("clicked", bounds);
|
||||
}
|
||||
|
||||
void Tray::OnDoubleClicked() {
|
||||
Emit("double-clicked");
|
||||
void Tray::OnDoubleClicked(const gfx::Rect& bounds) {
|
||||
Emit("double-clicked", bounds);
|
||||
}
|
||||
|
||||
void Tray::OnBalloonShow() {
|
||||
|
|
|
@ -43,7 +43,7 @@ class Tray : public mate::EventEmitter,
|
|||
|
||||
// TrayIconObserver:
|
||||
void OnClicked(const gfx::Rect& bounds) override;
|
||||
void OnDoubleClicked() override;
|
||||
void OnDoubleClicked(const gfx::Rect& bounds) override;
|
||||
void OnBalloonShow() override;
|
||||
void OnBalloonClicked() override;
|
||||
void OnBalloonClosed() override;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -156,7 +156,7 @@ const CGFloat kMargin = 3;
|
|||
}
|
||||
|
||||
if (event.clickCount == 2 && !menuController_) {
|
||||
trayIcon_->NotifyDoubleClicked();
|
||||
trayIcon_->NotifyDoubleClicked([self getBoundsFromEvent:event]);
|
||||
}
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
|
|
@ -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() {}
|
||||
|
|
Loading…
Reference in a new issue