wails icon indicating copy to clipboard operation
wails copied to clipboard

[v3/windows] Add an implementation of the `SetIcon` method

Open almas1992 opened this issue 6 months ago • 8 comments

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Before: image

After: image

Type of change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • [x] Windows
  • [ ] macOS
  • [ ] Linux

Test Configuration

Please paste the output of wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.

Checklist:

  • [x] I have updated website/src/pages/changelog.mdx with details of this PR
  • [ ] My code follows the general coding style of this project
  • [ ] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes

almas1992 avatar Dec 21 '23 10:12 almas1992

[!IMPORTANT]

Auto Review Skipped

Auto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging @coderabbitai in a comment. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

coderabbitai[bot] avatar Dec 21 '23 10:12 coderabbitai[bot]

Woops! This change breaks the functionality of the DisableIcon option.

almas1992 avatar Dec 22 '23 02:12 almas1992

You should be able to get the application using application.Get() and check this value in the options before continuing

leaanthony avatar Dec 22 '23 05:12 leaanthony

You should be able to get the application using application.Get() and check this value in the options before continuing

DisableIcon is a application.WebviewWindow option, not an application.Option, and it's in every window, independent of each other.

almas1992 avatar Dec 22 '23 06:12 almas1992

That'll teach me to answer on mobile 😂 Even easier!

leaanthony avatar Dec 22 '23 09:12 leaanthony

I'm assuming this is for runtime updates? Both icons indicated in the picture work fine in build

leaanthony avatar Dec 22 '23 09:12 leaanthony

I'm assuming this is for runtime updates? Both icons indicated in the picture work fine in build

Yes, this is updating icons at runtime.The screenshot shows the direct run go run main.go😂

almas1992 avatar Dec 22 '23 10:12 almas1992

If I'm not mistaken, setIcon is also called when the application start up. https://github.com/wailsapp/wails/blob/cf7537df018189d4ad75dffc918baacdd141ed50/v3/pkg/application/application.go#L493

almas1992 avatar Dec 22 '23 10:12 almas1992

@almas1992 - Did you find a resolution for when you disable the icon?

leaanthony avatar Jan 03 '24 08:01 leaanthony

@almas1992 - Did you find a resolution for when you disable the icon?

No, I haven't found an effective solution yet. 🫠

almas1992 avatar Jan 03 '24 08:01 almas1992