Skip to content

Commit a6cbaca

Browse files
committed
chore: onboarding -> welcome window
1 parent 70b4747 commit a6cbaca

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src-tauri/capabilities/main.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"editor",
77
"cropper",
88
"record",
9-
"onboarding"
9+
"welcome"
1010
],
1111
"permissions": [
1212
"path:default",

src-tauri/src/cropper/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub fn init_cropper(app: &AppHandle) {
119119

120120
pub fn toggle_cropper(app: &AppHandle) {
121121
if !scap::has_permission() {
122-
crate::open_onboarding(app);
122+
crate::open_welcome_window(app);
123123
return;
124124
}
125125

src-tauri/src/main.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use scap::{capturer::Capturer, frame::Frame};
1010
use std::path::PathBuf;
1111
use tauri::{AppHandle, Manager, WebviewUrl, WebviewWindowBuilder};
1212
use tauri_plugin_global_shortcut;
13+
use tauri_plugin_global_shortcut::ShortcutState;
1314
use tauri_plugin_store::StoreBuilder;
1415
use tokio::sync::Mutex;
15-
use tauri_plugin_global_shortcut::ShortcutState;
1616

1717
#[cfg(target_os = "macos")]
1818
use tauri::ActivationPolicy;
@@ -83,9 +83,9 @@ fn main() {
8383
.as_bool()
8484
.unwrap();
8585

86-
// If this is the first run, show onboarding screen
86+
// If this is the first run, show welcome screen
8787
if first_run || !scap::has_permission() {
88-
open_onboarding(app_handle);
88+
open_welcome_window(app_handle);
8989
store.insert("first_run".to_string(), false.into()).unwrap();
9090
store.save().expect("Failed to save store")
9191
}
@@ -109,20 +109,20 @@ fn main() {
109109
.expect("error while running Helmer Micro");
110110
}
111111

112-
fn open_onboarding(app_handle: &AppHandle) {
113-
match app_handle.get_webview_window("onboarding") {
112+
fn open_welcome_window(app_handle: &AppHandle) {
113+
match app_handle.get_webview_window("welcome") {
114114
Some(window) => {
115115
if window.is_visible().unwrap() {
116116
window.set_focus().unwrap();
117117
}
118118
}
119-
None => create_onboarding_win(app_handle),
119+
None => create_welcome_win(app_handle),
120120
}
121121
}
122122

123-
fn create_onboarding_win(app_handle: &AppHandle) {
124-
let mut onboarding_win =
125-
WebviewWindowBuilder::new(app_handle, "onboarding", WebviewUrl::App("/".into()))
123+
fn create_welcome_win(app_handle: &AppHandle) {
124+
let mut welcome_win =
125+
WebviewWindowBuilder::new(app_handle, "welcome", WebviewUrl::App("/".into()))
126126
.accept_first_mouse(true)
127127
.inner_size(600.0, 580.0)
128128
.title("Helmer Micro")
@@ -131,7 +131,7 @@ fn create_onboarding_win(app_handle: &AppHandle) {
131131
.center();
132132
#[cfg(target_os = "macos")]
133133
{
134-
onboarding_win = onboarding_win.title_bar_style(tauri::TitleBarStyle::Overlay);
134+
welcome_win = welcome_win.title_bar_style(tauri::TitleBarStyle::Overlay);
135135
}
136-
onboarding_win.build().expect("Failed to open onboarding");
136+
welcome_win.build().expect("Failed to open welcome window");
137137
}

src-tauri/src/recorder/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{sync::mpsc, thread};
22

3-
use crate::{open_onboarding, AppState};
3+
use crate::{open_welcome_window, AppState};
44

55
use tauri::{AppHandle, Manager};
66
use tempfile::NamedTempFile;
@@ -12,10 +12,10 @@ use henx::{VideoEncoder, VideoEncoderOptions};
1212

1313
#[tauri::command]
1414
pub async fn start_recording(app_handle: AppHandle) {
15-
// If no permissions, open onboarding screen
15+
// If no permissions, open welcome window
1616
if !scap::has_permission() {
1717
eprintln!("no permission to record screen");
18-
open_onboarding(&app_handle);
18+
open_welcome_window(&app_handle);
1919
return;
2020
}
2121

0 commit comments

Comments
 (0)