Skip to content

Commit c31c75f

Browse files
docs: fix missing docs for a few methods (#13449)
1 parent 9687a9b commit c31c75f

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

crates/tauri-runtime/src/lib.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ pub trait RuntimeHandle<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'st
272272
fn set_activation_policy(&self, activation_policy: ActivationPolicy) -> Result<()>;
273273

274274
/// Sets the dock visibility for the application.
275-
///
276275
#[cfg(target_os = "macos")]
277276
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
278277
fn set_dock_visibility(&self, visible: bool) -> Result<()>;
@@ -297,14 +296,24 @@ pub trait RuntimeHandle<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'st
297296
/// Run a task on the main thread.
298297
fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>;
299298

299+
/// Get a handle to the display controller of the windowing system.
300300
fn display_handle(&self) -> std::result::Result<DisplayHandle, raw_window_handle::HandleError>;
301301

302+
/// Returns the primary monitor of the system.
303+
///
304+
/// Returns None if it can't identify any monitor as a primary one.
302305
fn primary_monitor(&self) -> Option<Monitor>;
306+
307+
/// Returns the monitor that contains the given point.
303308
fn monitor_from_point(&self, x: f64, y: f64) -> Option<Monitor>;
309+
310+
/// Returns the list of all the monitors available on the system.
304311
fn available_monitors(&self) -> Vec<Monitor>;
305312

313+
/// Get the cursor position relative to the top-left hand corner of the desktop.
306314
fn cursor_position(&self) -> Result<PhysicalPosition<f64>>;
307315

316+
/// Sets the app theme.
308317
fn set_theme(&self, theme: Option<Theme>);
309318

310319
/// Shows the application, but does not automatically focus it.
@@ -407,12 +416,21 @@ pub trait Runtime<T: UserEvent>: Debug + Sized + 'static {
407416
pending: PendingWebview<T, Self>,
408417
) -> Result<DetachedWebview<T, Self>>;
409418

419+
/// Returns the primary monitor of the system.
420+
///
421+
/// Returns None if it can't identify any monitor as a primary one.
410422
fn primary_monitor(&self) -> Option<Monitor>;
423+
424+
/// Returns the monitor that contains the given point.
411425
fn monitor_from_point(&self, x: f64, y: f64) -> Option<Monitor>;
426+
427+
/// Returns the list of all the monitors available on the system.
412428
fn available_monitors(&self) -> Vec<Monitor>;
413429

430+
/// Get the cursor position relative to the top-left hand corner of the desktop.
414431
fn cursor_position(&self) -> Result<PhysicalPosition<f64>>;
415432

433+
/// Sets the app theme.
416434
fn set_theme(&self, theme: Option<Theme>);
417435

418436
/// Sets the activation policy for the application.
@@ -421,7 +439,6 @@ pub trait Runtime<T: UserEvent>: Debug + Sized + 'static {
421439
fn set_activation_policy(&mut self, activation_policy: ActivationPolicy);
422440

423441
/// Sets the dock visibility for the application.
424-
///
425442
#[cfg(target_os = "macos")]
426443
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
427444
fn set_dock_visibility(&mut self, visible: bool);

crates/tauri/src/app.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,11 @@ macro_rules! shared_app_impl {
824824
})
825825
}
826826

827-
/// Set the app theme.
827+
/// Sets the app theme.
828+
///
829+
/// ## Platform-specific
830+
///
831+
/// - **iOS / Android:** Unsupported.
828832
pub fn set_theme(&self, theme: Option<Theme>) {
829833
#[cfg(windows)]
830834
for window in self.manager.windows().values() {

crates/tauri/src/webview/webview_window.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,12 @@ impl<R: Runtime> WebviewWindow<R> {
19801980
self.window.set_title_bar_style(style)
19811981
}
19821982

1983-
/// Set the window theme.
1983+
/// Sets the theme for this window.
1984+
///
1985+
/// ## Platform-specific
1986+
///
1987+
/// - **Linux / macOS**: Theme is app-wide and not specific to this window.
1988+
/// - **iOS / Android:** Unsupported.
19841989
pub fn set_theme(&self, theme: Option<tauri_utils::Theme>) -> crate::Result<()> {
19851990
self.window.set_theme(theme)
19861991
}

0 commit comments

Comments
 (0)