Make dynamic buttons work along with click events

This commit is contained in:
Samuel Attard 2016-11-27 22:54:12 +11:00 committed by Kevin Sawicki
parent 703b5738c8
commit 7857c83ea1
11 changed files with 203 additions and 20 deletions

View file

@ -283,7 +283,7 @@ void Window::OnExecuteWindowsCommand(const std::string& command_name) {
}
void Window::OnTouchBarItemResult(const std::string& item_type, const std::string& item_id) {
Emit("_touch-bar-interaction", item_type, item_id);
Emit("-touch-bar-interaction", item_type, item_id);
}
#if defined(OS_WIN)
@ -844,8 +844,12 @@ void Window::SetVibrancy(mate::Arguments* args) {
window_->SetVibrancy(type);
}
void Window::InitTouchBar() {
window_->InitTouchBar();
void Window::DestroyTouchBar() {
window_->DestroyTouchBar();
}
void Window::SetTouchBar(mate::Arguments* args) {
window_->SetTouchBar(args);
}
int32_t Window::ID() const {
@ -968,7 +972,8 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setAutoHideCursor", &Window::SetAutoHideCursor)
#endif
.SetMethod("setVibrancy", &Window::SetVibrancy)
.SetMethod("initTouchBar", &Window::InitTouchBar)
.SetMethod("_destroyTouchBar", &Window::DestroyTouchBar)
.SetMethod("_setTouchBar", &Window::SetTouchBar)
#if defined(OS_WIN)
.SetMethod("hookWindowMessage", &Window::HookWindowMessage)
.SetMethod("isWindowMessageHooked", &Window::IsWindowMessageHooked)