feat: programmatically modify traffic light positioning (#22533)
* setter * getter * specs and docs * fixup Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
parent
1811751c6c
commit
3e2cec83d9
7 changed files with 80 additions and 5 deletions
|
@ -814,6 +814,16 @@ void TopLevelWindow::SetVibrancy(v8::Isolate* isolate,
|
|||
window_->SetVibrancy(type);
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
void TopLevelWindow::SetTrafficLightPosition(const gfx::Point& position) {
|
||||
window_->SetTrafficLightPosition(position);
|
||||
}
|
||||
|
||||
gfx::Point TopLevelWindow::GetTrafficLightPosition() const {
|
||||
return window_->GetTrafficLightPosition();
|
||||
}
|
||||
#endif
|
||||
|
||||
void TopLevelWindow::SetTouchBar(
|
||||
std::vector<gin_helper::PersistentDictionary> items) {
|
||||
window_->SetTouchBar(std::move(items));
|
||||
|
@ -1184,6 +1194,12 @@ void TopLevelWindow::BuildPrototype(v8::Isolate* isolate,
|
|||
.SetMethod("setAutoHideCursor", &TopLevelWindow::SetAutoHideCursor)
|
||||
#endif
|
||||
.SetMethod("setVibrancy", &TopLevelWindow::SetVibrancy)
|
||||
#if defined(OS_MACOSX)
|
||||
.SetMethod("setTrafficLightPosition",
|
||||
&TopLevelWindow::SetTrafficLightPosition)
|
||||
.SetMethod("getTrafficLightPosition",
|
||||
&TopLevelWindow::GetTrafficLightPosition)
|
||||
#endif
|
||||
.SetMethod("_setTouchBarItems", &TopLevelWindow::SetTouchBar)
|
||||
.SetMethod("_refreshTouchBarItem", &TopLevelWindow::RefreshTouchBarItem)
|
||||
.SetMethod("_setEscapeTouchBarItem",
|
||||
|
|
|
@ -185,6 +185,12 @@ class TopLevelWindow : public gin_helper::TrackableObject<TopLevelWindow>,
|
|||
bool IsVisibleOnAllWorkspaces();
|
||||
void SetAutoHideCursor(bool auto_hide);
|
||||
virtual void SetVibrancy(v8::Isolate* isolate, v8::Local<v8::Value> value);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
void SetTrafficLightPosition(const gfx::Point& position);
|
||||
gfx::Point GetTrafficLightPosition() const;
|
||||
#endif
|
||||
|
||||
void SetTouchBar(std::vector<gin_helper::PersistentDictionary> items);
|
||||
void RefreshTouchBarItem(const std::string& item_id);
|
||||
void SetEscapeTouchBarItem(gin_helper::PersistentDictionary item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue