Skip to content

feat: customize button texts of message dialog - #4383

Merged
lucasfernog merged 8 commits into
tauri-apps:devfrom
meowtec:feat/dialog-button-custom
Dec 27, 2022
Merged

feat: customize button texts of message dialog#4383
lucasfernog merged 8 commits into
tauri-apps:devfrom
meowtec:feat/dialog-button-custom

Conversation

@meowtec

@meowtec meowtec commented Jun 17, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

Nice PR!

@meowtec

meowtec commented Jun 17, 2022

Copy link
Copy Markdown
Contributor Author

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

riverar commented Jun 17, 2022

Copy link
Copy Markdown

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

meowtec commented Jun 18, 2022

Copy link
Copy Markdown
Contributor Author

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 force-pushed the feat/dialog-button-custom branch from 5b43bfa to 878163d Compare August 11, 2022 15:24
@meowtec
meowtec force-pushed the feat/dialog-button-custom branch from 878163d to 88d5a11 Compare August 11, 2022 15:30
@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

meowtec commented Aug 11, 2022

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
Member

Fixed with a trick @meowtec :P

@lucasfernog

Copy link
Copy Markdown
Member

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

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

@lucasfernog

Copy link
Copy Markdown
Member

Implements #3455

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

Copy link
Copy Markdown
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>
xorza added a commit to xorza/Darkroom that referenced this pull request May 21, 2025
rexc-lab added a commit to rexc-lab/RxTerm that referenced this pull request Jun 11, 2026
cargo test on windows-latest crashed with STATUS_ENTRYPOINT_NOT_FOUND
(0xc0000139) before running any test: tauri-build embeds its Windows
application manifest only into the app binary (rustc-link-arg-bins),
so test executables load Common-Controls v5 and miss the entry points
tauri's dialog code imports.

Apply the workaround tauri uses in its own repo: suppress tauri-build's
per-bin manifest and embed the same manifest (vendored from tauri-build
2.5.6) into every Windows MSVC link target via /MANIFEST:EMBED.
tauri-apps/tauri#4383 (comment)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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