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: customize button texts of message dialog #4383

Merged
merged 8 commits into from
Dec 27, 2022

Conversation

meowtec
Copy link
Contributor

@meowtec meowtec commented Jun 17, 2022

Demo:
Screenshot 2022-08-11 233900

What kind of change does this PR introduce?

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

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

Now we can show message dialog with customize buttons.
Limit: we can have at most two buttons. If need more buttons, the dialog API should have breaking change. I have no idea about the best solution.

@lucasfernog
Copy link
Member

Nice PR!

@meowtec
Copy link
Contributor Author

meowtec commented Jun 17, 2022

While there is a new problem: the dialog level (Info / Warning / Error) is not implemented in the new message dialog.
I am trying to complete it but got stuck at microsoft/win32metadata#968

@riverar
Copy link

riverar commented Jun 17, 2022

I'm not familiar with Tauri architecture yet but beware that your manifest may need external edits, may get overwritten, etc. for users that need to add identity, enable high-DPI, add registration-free coclass entries, etc.

@meowtec
Copy link
Contributor Author

meowtec commented Jun 18, 2022

I'm not familiar with Tauri architecture yet but beware that your manifest may need external edits, may get overwritten, etc. for users that need to add identity, enable high-DPI, add registration-free coclass entries, etc.

I think that all manifests should be added by tauri, and provide some config option to users if necessary. Just like what electron does: electron/electron#14596

@amrbashir amrbashir linked an issue Jul 18, 2022 that may be closed by this pull request
@meowtec meowtec marked this pull request as ready for review August 11, 2022 15:40
@meowtec meowtec requested a review from a team as a code owner August 11, 2022 15:40
@meowtec
Copy link
Contributor Author

meowtec commented Aug 11, 2022

Test failed:

  process didn't exit successfully: `D:\a\tauri\tauri\target\debug\deps\tauri-66d30672674b2f8e.exe` (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)

Seems because common controls v6 was not used when testing. I am unfamiliar with the restart crate and don't know how to fix it.
@lucasfernog Could you give some help?

@lucasfernog
Copy link
Member

@meowtec it's not related to the restart crate; even if you remove both restart and app-updater from the workspace and run cargo test --features dialog-all it fails with the same error. Seems like we'd need to enable common controls v6 on the unit test runner itself?

@lucasfernog
Copy link
Member

Fixed with a trick @meowtec :P

@lucasfernog
Copy link
Member

Is okLabel and cancelLabel good names for this on the JS API? Example:

ask('something?', { okLabel: 'Sure', cancelLabel: 'Definitely not' })

@lucasfernog
Copy link
Member

Implements #3455

@lucasfernog lucasfernog merged commit 00e1efa into tauri-apps:dev Dec 27, 2022
@amrbashir
Copy link
Member

and #2147

luoffei pushed a commit to luoffei/tauri that referenced this pull request Dec 29, 2022
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
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.

[feat] Modern dialog styles on Windows
4 participants