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] macOS - Add a way to access Dock api #4520

Closed
BillGoldenWater opened this issue Jun 29, 2022 · 3 comments
Closed

[feat] macOS - Add a way to access Dock api #4520

BillGoldenWater opened this issue Jun 29, 2022 · 3 comments

Comments

@BillGoldenWater
Copy link
Contributor

Describe the problem

For show progress bars on dock icon.
For add item to right click menu for shortcut.
For listen "activate" event, for reopen window when all windows are closed.
etc.

Describe the solution you'd like

some pseudocode

progress bar:

app.get_dock().unwrap().update_progress_bar(show: bool, percent: f32)

adding items:

app.get_dock().unwrap().setMenu(menu: Menu)
// like tauri::Menu

listen "activate" event:

app..get_dock().unwrap().addEventHandler(id: &str, |app_handle, event| match event {
  DockEvent::Activate {window_all_closed: bool} => {
    if (!window_all_closed) {
      show_main_window()
    }
  }

  _ => {}
})

app..get_dock().unwrap().removeEventHandler(id: &str)

Alternatives considered

No response

Additional context

No response

@FabianLars
Copy link
Member

A little bit of context, i asked for this issue because i didn't find an existing issue for the dock menu.
On that note, #3084 is the tracking issue for the events and #4208 for the progress bar.

@amrbashir
Copy link
Member

duplicate of #2358

@FabianLars
Copy link
Member

FabianLars commented Jun 29, 2022

Ah i thought that one is only about showing/hiding the icon and stuff, and not for the custom menu, my bad then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants