Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(view-api): add ImageView #22738

Merged
merged 1 commit into from Mar 22, 2020
Merged

feat(view-api): add ImageView #22738

merged 1 commit into from Mar 22, 2020

Conversation

@zcbenz
Copy link
Member

zcbenz commented Mar 18, 2020

Description of Change

This PR adds a simple ImageView with a single setImage method, this class is hidden under the enable_view_api build flag.

One use of this class, is to show a splash image when the window is created, and then replace the image view with WebContents once after the page is loaded. I have a written a simple demo:
https://gist.github.com/zcbenz/e0048264a2890c2b9e85fa91e5682b76

Once this is merged, I will start working on an RFC to make parts of the view APIs public, which would be a minimum set of APIs to enable implementing loading screens for apps (i.e. the APIs used by the demo above).

The feature of ImageView is currently rather limited, and I'll start improving it after the RFC is accepted.

Note that this PR does not touch our public API.

Release Notes

Notes: no-notes

Copy link
Member

deepak1556 left a comment

LGTM

Wondering if this conflicts with refactor from #22726 and the class should be made a pure gin wrappable, but since the trackable object comes from the base class View, the separation can't happen without some refactor chunk in this PR and that can happen separately, approving based on this.

@zcbenz

This comment has been minimized.

Copy link
Member Author

zcbenz commented Mar 18, 2020

Wondering if this conflicts with refactor from #22726 and the class should be made a pure gin wrappable

Currently we have to use our gin_helper::Wrappable because:

  1. we need to support the new ImageView style constructor;
  2. the base class and child class must be able to have different prototypes.

They probably don't need to inherit from gin_helper::TrackableObject though.

@electron-cation electron-cation bot removed the new-pr 🌱 label Mar 19, 2020
@zcbenz zcbenz force-pushed the image-view branch from f3b5db3 to 8bd6110 Mar 20, 2020
@zcbenz zcbenz force-pushed the image-view branch from 8bd6110 to 21f5616 Mar 21, 2020
@zcbenz zcbenz merged commit 341f643 into master Mar 22, 2020
15 checks passed
15 checks passed
Artifact Comparison No Changes
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-woa-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
electron-arm-testing Build #20200321.2 succeeded
Details
electron-arm64-testing Build #20200321.2 succeeded
Details
electron-woa-testing Build #20200321.3 succeeded
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

release-clerk bot commented Mar 22, 2020

No Release Notes

@zcbenz zcbenz deleted the image-view branch Mar 22, 2020
sentialx added a commit to sentialx/electron that referenced this pull request Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.