Browse Source

fix(core): set dialog title via API, closes #4029 (#4030)

Lucas Fernandes Nogueira 3 years ago
parent
commit
220e746014
2 changed files with 11 additions and 0 deletions
  1. 5 0
      .changes/fix-dialog-title.md
  2. 6 0
      core/tauri/src/endpoints/dialog.rs

+ 5 - 0
.changes/fix-dialog-title.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Fixes the `title` option being ignored in the dialog API endpoints.

+ 6 - 0
core/tauri/src/endpoints/dialog.rs

@@ -95,6 +95,9 @@ impl Cmd {
     {
       dialog_builder = dialog_builder.set_parent(&context.window);
     }
+    if let Some(title) = options.title {
+      dialog_builder = dialog_builder.set_title(&title);
+    }
     if let Some(default_path) = options.default_path {
       dialog_builder = set_default_path(dialog_builder, default_path);
     }
@@ -143,6 +146,9 @@ impl Cmd {
     {
       dialog_builder = dialog_builder.set_parent(&context.window);
     }
+    if let Some(title) = options.title {
+      dialog_builder = dialog_builder.set_title(&title);
+    }
     if let Some(default_path) = options.default_path {
       dialog_builder = set_default_path(dialog_builder, default_path);
     }