feat: customize border radius of Views (#42320)
* feat: add View#setBorderRadius test: initial setBorderRadius tests fix: robustly set border radius chore: add PAUSE_CAPTURE_TESTS for easier screencap dev feat: add view border radius support test: view border radius refactor: cleanup view code * maybe delay capture to fix tests? * refactor: retry screen captures in an attempt to fix flakiness * refactor: ScreenCapture constructor no longer async * increase screen capture timeout, feels a little short * refactor: move rounded rect util into chromium_src * skip some capture tests on mas
This commit is contained in:
parent
cbd11bb605
commit
778d3098a0
15 changed files with 261 additions and 90 deletions
|
@ -37,6 +37,7 @@ class View : public gin_helper::EventEmitter<View>,
|
|||
void SetLayout(v8::Isolate* isolate, v8::Local<v8::Object> value);
|
||||
std::vector<v8::Local<v8::Value>> GetChildren();
|
||||
void SetBackgroundColor(std::optional<WrappedSkColor> color);
|
||||
void SetBorderRadius(int radius);
|
||||
void SetVisible(bool visible);
|
||||
|
||||
// views::ViewObserver
|
||||
|
@ -44,6 +45,7 @@ class View : public gin_helper::EventEmitter<View>,
|
|||
void OnViewIsDeleting(views::View* observed_view) override;
|
||||
|
||||
views::View* view() const { return view_; }
|
||||
std::optional<int> border_radius() const { return border_radius_; }
|
||||
|
||||
// disable copy
|
||||
View(const View&) = delete;
|
||||
|
@ -58,9 +60,11 @@ class View : public gin_helper::EventEmitter<View>,
|
|||
void set_delete_view(bool should) { delete_view_ = should; }
|
||||
|
||||
private:
|
||||
void ApplyBorderRadius();
|
||||
void ReorderChildView(gin::Handle<View> child, size_t index);
|
||||
|
||||
std::vector<v8::Global<v8::Object>> child_views_;
|
||||
std::optional<int> border_radius_;
|
||||
|
||||
bool delete_view_ = true;
|
||||
raw_ptr<views::View> view_ = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue