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(core): add mult-window support #1217

Merged
merged 18 commits into from Feb 12, 2021
Merged

feat(core): add mult-window support #1217

merged 18 commits into from Feb 12, 2021

Conversation

lucasfernog
Copy link
Member

@lucasfernog lucasfernog commented Feb 11, 2021

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • New Binding Issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes. Issue #___
  • No

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

This PR adds multi-window support to Tauri. Check out the new example:

$ cd tauri
$ cargo run --example multiwindow

For now the windows can be configured on tauri.conf.json but a Rust API will be provided soon on the AppBuilder struct.

The window API will be improved on a subsequent PR, with the event system refactored to simplify multi-window usage and APIs to manipulate the windows.

@lucasfernog lucasfernog requested a review from a team as a code owner February 11, 2021 16:36
@lucasfernog lucasfernog requested review from a team February 11, 2021 16:36
@lucasfernog lucasfernog changed the title refactor(core): change tauri.conf.json to multiple windows feat(core): add mult-window support Feb 11, 2021
#[serde(default)]
pub url: WindowUrl,
/// The horizontal position of the window's top left corner
pub x: Option<f64>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should accept usize for these and convert them to i64 on the wry side. I can't think of a scenario where you'd actually pass a non integer so it makes more sense to accept an integer imo, it will save people from having to add the .0, which could be confusing for those unfamiliar with Rust and statically typed languages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just following the wry interface. We should follow the same convention.
This is the tauri.conf.json stuff and the deserialization would also work with integers. The only real issue regarding this would be the Rust API to create windows, but I can also change that to accept both usize and f64.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that Wry itself should take usizes, but if Tauri accepts either that's ok too.

@lucasfernog lucasfernog merged commit 07208df into dev Feb 12, 2021
@lucasfernog lucasfernog deleted the feat/multiwindow branch February 12, 2021 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants