|
@@ -193,18 +193,18 @@ pub enum RunEvent {
|
|
|
MainEventsCleared,
|
|
|
/// Emitted when the user wants to open the specified resource with the app.
|
|
|
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(any(target_os = "macos", feature = "ios"))))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(any(target_os = "macos", feature = "ios"))))]
|
|
|
Opened {
|
|
|
/// The URL of the resources that is being open.
|
|
|
urls: Vec<url::Url>,
|
|
|
},
|
|
|
/// An event from a menu item, could be on the window menu bar, application menu bar (on macOS) or tray icon menu.
|
|
|
#[cfg(desktop)]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(desktop)))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(desktop)))]
|
|
|
MenuEvent(crate::menu::MenuEvent),
|
|
|
/// An event from a tray icon.
|
|
|
#[cfg(all(desktop, feature = "tray-icon"))]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
TrayIconEvent(crate::tray::TrayIconEvent),
|
|
|
}
|
|
|
|
|
@@ -506,7 +506,7 @@ macro_rules! shared_app_impl {
|
|
|
|
|
|
/// Registers a global tray icon menu event listener.
|
|
|
#[cfg(all(desktop, feature = "tray-icon"))]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
pub fn on_tray_icon_event<F: Fn(&AppHandle<R>, TrayIconEvent) + Send + Sync + 'static>(
|
|
|
&self,
|
|
|
handler: F,
|
|
@@ -523,7 +523,7 @@ macro_rules! shared_app_impl {
|
|
|
/// Gets the first tray icon registered,
|
|
|
/// usually the one configured in the Tauri configuration file.
|
|
|
#[cfg(all(desktop, feature = "tray-icon"))]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
pub fn tray(&self) -> Option<TrayIcon<R>> {
|
|
|
self
|
|
|
.manager
|
|
@@ -540,7 +540,7 @@ macro_rules! shared_app_impl {
|
|
|
///
|
|
|
/// Note that dropping the returned icon, will cause the tray icon to disappear.
|
|
|
#[cfg(all(desktop, feature = "tray-icon"))]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
pub fn remove_tray(&self) -> Option<TrayIcon<R>> {
|
|
|
let mut tray_icons = self.manager.inner.tray_icons.lock().unwrap();
|
|
|
if !tray_icons.is_empty() {
|
|
@@ -551,7 +551,7 @@ macro_rules! shared_app_impl {
|
|
|
|
|
|
/// Gets a tray icon using the provided id.
|
|
|
#[cfg(all(desktop, feature = "tray-icon"))]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
pub fn tray_by_id<'a, I>(&self, id: &'a I) -> Option<TrayIcon<R>>
|
|
|
where
|
|
|
I: ?Sized,
|
|
@@ -572,7 +572,7 @@ macro_rules! shared_app_impl {
|
|
|
///
|
|
|
/// Note that dropping the returned icon, will cause the tray icon to disappear.
|
|
|
#[cfg(all(desktop, feature = "tray-icon"))]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
|
|
pub fn remove_tray_by_id<'a, I>(&self, id: &'a I) -> Option<TrayIcon<R>>
|
|
|
where
|
|
|
I: ?Sized,
|
|
@@ -824,7 +824,7 @@ impl<R: Runtime> App<R> {
|
|
|
/// app.run(|_app_handle, _event| {});
|
|
|
/// ```
|
|
|
#[cfg(target_os = "macos")]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
|
|
pub fn set_activation_policy(&mut self, activation_policy: ActivationPolicy) {
|
|
|
self
|
|
|
.runtime
|
|
@@ -1046,7 +1046,7 @@ impl<R: Runtime> Builder<R> {
|
|
|
///
|
|
|
/// - **macOS:** on macOS the application *must* be executed on the main thread, so this function is not exposed.
|
|
|
#[cfg(any(windows, target_os = "linux"))]
|
|
|
- #[cfg_attr(doc_cfg, doc(cfg(any(windows, target_os = "linux"))))]
|
|
|
+ #[cfg_attr(docsrs, doc(cfg(any(windows, target_os = "linux"))))]
|
|
|
#[must_use]
|
|
|
pub fn any_thread(mut self) -> Self {
|
|
|
self.runtime_any_thread = true;
|
|
@@ -1176,7 +1176,7 @@ impl<R: Runtime> Builder<R> {
|
|
|
/// refers to a different `T`.
|
|
|
///
|
|
|
/// Managed state can be retrieved by any command handler via the
|
|
|
- /// [`State`](crate::State) guard. In particular, if a value of type `T`
|
|
|
+ /// [`State`] guard. In particular, if a value of type `T`
|
|
|
/// is managed by Tauri, adding `State<T>` to the list of arguments in a
|
|
|
/// command handler instructs Tauri to retrieve the managed value.
|
|
|
/// Additionally, [`state`](crate::Manager#method.state) can be used to retrieve the value manually.
|
|
@@ -1859,7 +1859,7 @@ fn on_event_loop_event<R: Runtime, F: FnMut(&AppHandle<R>, RunEvent) + 'static>(
|
|
|
|
|
|
/// Make `Wry` the default `Runtime` for `Builder`
|
|
|
#[cfg(feature = "wry")]
|
|
|
-#[cfg_attr(doc_cfg, doc(cfg(feature = "wry")))]
|
|
|
+#[cfg_attr(docsrs, doc(cfg(feature = "wry")))]
|
|
|
impl Default for Builder<crate::Wry> {
|
|
|
fn default() -> Self {
|
|
|
Self::new()
|