Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
feat: Update auth logo + tray onclick + new tray stop icon
Richie McIlroy24e99cb8b60d
diff --git a/apps/desktop/src-tauri/icons/tray-stop-icon.png b/apps/desktop/src-tauri/icons/tray-stop-icon.pngindex dc2761db1..eae239b6d 100644Binary files a/apps/desktop/src-tauri/icons/tray-stop-icon.png and b/apps/desktop/src-tauri/icons/tray-stop-icon.png differdiff --git a/apps/desktop/src-tauri/src/tray.rs b/apps/desktop/src-tauri/src/tray.rsindex 28e9cfda2..995ad2bdd 100644--- a/apps/desktop/src-tauri/src/tray.rs+++ b/apps/desktop/src-tauri/src/tray.rs@@ -2,6 +2,8 @@ use crate::{NewRecordingAdded, RecordingStarted, RecordingStopped, RequestStopReuse cap_project::RecordingMeta;use std::path::PathBuf;use std::result::Result;+use std::sync::atomic::{AtomicBool, Ordering};+use std::sync::Arc;use tauri::{image::Image,menu::{IconMenuItem, IsMenuItem, Menu, MenuItem, MenuItemKind, Submenu},@@ -39,12 +41,13 @@ pub fn create_tray<R: Runtime>(app: &AppHandle<R>) -> tauri::Result<()> {],)?;let app_handle = app.clone();+ let is_recording = Arc::new(AtomicBool::new(false));let _ = TrayIconBuilder::with_id("tray").icon(Image::from_bytes(include_bytes!("../icons/tray-default-icon.png"))?).menu(&menu)- .menu_on_left_click(false)+ .menu_on_left_click(true).on_menu_event(move |app, event| {match event.id.as_ref() {"new_recording" => {@@ -72,9 +75,17 @@ pub fn create_tray<R: Runtime>(app: &AppHandle<R>) -> tauri::Result<()> {}}})- .on_tray_icon_event(move |_, event| {- if let tauri::tray::TrayIconEvent::Click { .. } = event {- let _ = RequestStopRecording.emit(&app_handle);+ .on_tray_icon_event({+ let is_recording = Arc::clone(&is_recording);+ let app_handle = app_handle.clone();+ move |tray, event| {+ if let tauri::tray::TrayIconEvent::Click { .. } = event {+ if is_recording.load(Ordering::Relaxed) {+ let _ = RequestStopRecording.emit(&app_handle);+ } else {+ let _ = tray.set_visible(true);+ }+ }}}).build(app);@@ -90,7 +101,9 @@ pub fn create_tray<R: Runtime>(app: &AppHandle<R>) -> tauri::Result<()> {RecordingStarted::listen_any(app, {let app_handle = app.clone();+ let is_recording = Arc::clone(&is_recording);move |_| {+ is_recording.store(true, Ordering::Relaxed);if let Some(tray) = app_handle.tray_by_id("tray") {if let Ok(icon) = Image::from_bytes(include_bytes!("../icons/tray-stop-icon.png")) {let _ = tray.set_icon(Some(icon));@@ -101,7 +114,9 @@ pub fn create_tray<R: Runtime>(app: &AppHandle<R>) -> tauri::Result<()> {RecordingStopped::listen_any(app, {let app_handle = app.clone();+ let is_recording = Arc::clone(&is_recording);move |_| {+ is_recording.store(false, Ordering::Relaxed);if let Some(tray) = app_handle.tray_by_id("tray") {if let Ok(icon) =Image::from_bytes(include_bytes!("../icons/tray-default-icon.png"))diff --git a/apps/desktop/src/routes/(main)/callback.template.ts b/apps/desktop/src/routes/(main)/callback.template.tsindex fd51ff59e..bd15ba65f 100644--- a/apps/desktop/src/routes/(main)/callback.template.ts+++ b/apps/desktop/src/routes/(main)/callback.template.ts@@ -25,7 +25,7 @@ export default `</head><body><div style="padding: 30px 0; width: 100%; max-width: 400px; margin: 0 auto; ">- <svg xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: auto; margin-bottom: 10px;" viewBox="0 0 719 269"><path fill="#0A486B" d="M474.954 156.466c-3.122 16.278-10.217 29.23-21.286 38.856-10.927 9.484-25.118 14.226-42.572 14.226-14.333 0-26.892-3.397-37.677-10.192-10.643-6.936-18.873-16.349-24.692-28.24-5.818-11.89-8.727-25.267-8.727-40.13 0-14.863 2.838-28.31 8.514-40.342 5.819-12.032 14.12-21.445 24.905-28.24C384.204 55.468 396.763 52 411.096 52c16.603 0 30.368 4.53 41.295 13.589 10.927 9.059 18.164 21.304 21.712 36.733l-27.885 1.486c-2.129-8.776-6.244-15.641-12.346-20.596-6.102-5.096-13.765-7.644-22.989-7.644-9.65 0-17.739 2.407-24.266 7.22-6.386 4.812-11.14 11.465-14.262 19.959-3.122 8.351-4.683 17.764-4.683 28.239 0 10.475 1.561 19.818 4.683 28.028 3.122 8.21 7.876 14.792 14.262 19.746 6.527 4.813 14.616 7.219 24.266 7.219 9.65 0 17.526-2.76 23.628-8.28 6.243-5.662 10.359-13.236 12.346-22.72l28.097 1.487zM486.826 127.801c2.271-11.607 7.734-20.596 16.391-26.965 8.656-6.512 19.796-9.768 33.419-9.768 16.177 0 28.452 4.106 36.825 12.316 8.372 8.21 12.559 20.171 12.559 35.883v39.281c0 2.973.567 5.096 1.703 6.37 1.277 1.132 3.051 1.698 5.321 1.698h4.257v19.535l-6.598.212h-.852c-3.831.142-7.734-.142-11.707-.849-3.832-.708-7.237-2.336-10.217-4.884-2.981-2.548-4.683-6.441-5.109-11.678-2.838 5.804-7.45 10.546-13.836 14.226-6.386 3.68-14.191 5.521-23.415 5.521-11.636 0-21.357-2.902-29.162-8.706-7.663-5.945-11.494-13.73-11.494-23.356 0-7.078 1.631-12.811 4.895-17.199 3.406-4.388 8.089-7.856 14.049-10.404 6.102-2.548 14.049-4.742 23.841-6.582l31.716-6.37c-.142-8.635-2.058-15.004-5.747-19.109-3.69-4.247-9.366-6.37-17.029-6.37-5.96 0-10.927 1.628-14.9 4.883-3.832 3.114-6.457 7.715-7.876 13.802l-27.034-1.487zm25.331 47.987c0 4.105 1.703 7.502 5.108 10.191 3.548 2.548 8.586 3.822 15.114 3.822 5.25 0 9.933-1.274 14.048-3.822 4.258-2.547 7.522-6.369 9.792-11.465 2.413-5.238 3.619-11.537 3.619-18.898v-1.061l-21.712 3.822-3.832.637c-5.25.991-9.366 1.981-12.346 2.972-2.838.991-5.179 2.619-7.024 4.884-1.845 2.123-2.767 5.096-2.767 8.918zM611.079 93.616h24.905l.851 23.569-2.128-2.76c2.838-7.503 7.308-13.236 13.41-17.199 6.244-4.105 13.765-6.158 22.563-6.158 10.502 0 19.371 2.62 26.608 7.857 7.237 5.237 12.63 12.315 16.178 21.233 3.689 8.776 5.534 18.684 5.534 29.726 0 11.041-1.845 21.02-5.534 29.938-3.548 8.776-8.941 15.783-16.178 21.02-7.237 5.238-16.106 7.857-26.608 7.857-5.818 0-11.139-.92-15.964-2.761-4.683-1.84-8.728-4.529-12.133-8.068-3.264-3.539-5.818-7.927-7.663-13.165l2.554-2.123V238h-26.395V93.616zm24.266 56.268c0 6.794.994 13.022 2.98 18.684 2.129 5.521 5.322 9.98 9.579 13.377 4.257 3.397 9.437 5.096 15.539 5.096 9.224 0 16.178-3.539 20.861-10.616 4.824-7.078 7.237-15.925 7.237-26.541 0-10.475-2.413-19.322-7.237-26.542-4.683-7.219-11.637-10.828-20.861-10.828-6.102 0-11.282 1.769-15.539 5.308-4.257 3.397-7.45 7.927-9.579 13.589-1.986 5.521-2.98 11.678-2.98 18.473z"></path><path fill="url(#paint0_linear_0_1)" d="M218.623 0H50C22.386 0 0 22.386 0 50v168.623c0 27.614 22.386 50 50 50h168.623c27.614 0 50-22.386 50-50V50c0-27.614-22.386-50-50-50z"></path><path fill="url(#paint1_radial_0_1)" d="M134.646 240.418c58.415 0 105.77-47.355 105.77-105.77s-47.355-105.77-105.77-105.77-105.77 47.355-105.77 105.77 47.355 105.77 105.77 105.77z"></path><path fill="url(#paint2_linear_0_1)" d="M134.983 224.972c49.699 0 89.988-40.289 89.988-89.988 0-49.7-40.289-89.989-89.988-89.989-49.7 0-89.989 40.29-89.989 89.989 0 49.699 40.29 89.988 89.989 89.988z"></path><path fill="url(#paint3_radial_0_1)" d="M134.983 202.81c37.46 0 67.828-30.368 67.828-67.828 0-37.46-30.368-67.827-67.828-67.827-37.46 0-67.827 30.367-67.827 67.827 0 37.46 30.367 67.828 67.827 67.828z"></path><defs><linearGradient id="paint0_linear_0_1" x1="134.311" x2="134.311" y1="0" y2="268.623" gradientUnits="userSpaceOnUse"><stop stop-color="#A8DBF8"></stop><stop offset="1" stop-color="#BCCBFF"></stop></linearGradient><radialGradient id="paint1_radial_0_1" cx="0" cy="0" r="1" gradientTransform="rotate(107.38 31.314 98.475) scale(149.225)" gradientUnits="userSpaceOnUse"><stop offset="0.063" stop-color="#84D3FF"></stop><stop offset="0.411" stop-color="#17ABFE"></stop><stop offset="0.906" stop-color="#0770D1"></stop></radialGradient><linearGradient id="paint2_linear_0_1" x1="134.983" x2="134.983" y1="44.995" y2="224.972" gradientUnits="userSpaceOnUse"><stop stop-color="#BBE8FF"></stop><stop offset="1" stop-color="#018FEF"></stop></linearGradient><radialGradient id="paint3_radial_0_1" cx="0" cy="0" r="1" gradientTransform="rotate(98.584 14.543 129.964) scale(68.5955)" gradientUnits="userSpaceOnUse"><stop stop-color="#7EC3FF"></stop><stop offset="1" stop-color="#EAF5FF"></stop></radialGradient></defs></svg>+ <svg style="width: 100px; height: auto; margin-bottom: 10px;" viewBox="0 0 103 40" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect x="0.25" y="0.25" width="39.5" height="39.5" rx="7.75" fill="white"/> <rect x="0.25" y="0.25" width="39.5" height="39.5" rx="7.75" stroke="#E7EAF0" stroke-width="0.5"/> <path d="M20 36C28.8365 36 36 28.8365 36 20C36 11.1635 28.8365 4 20 4C11.1635 4 4 11.1635 4 20C4 28.8365 11.1635 36 20 36Z" fill="#4785FF"/> <path d="M20.0001 33C27.1797 33 33 27.1797 33 20.0001C33 12.8203 27.1797 7 20.0001 7C12.8203 7 7 12.8204 7 20.0001C7 27.1797 12.8204 33 20.0001 33Z" fill="#ADC9FF"/> <path d="M20.0001 30.0002C25.5229 30.0002 30.0002 25.5229 30.0002 20.0001C30.0002 14.4773 25.5229 10.0002 20.0001 10.0002C14.4773 10.0002 10.0002 14.4773 10.0002 20.0001C10.0002 25.5229 14.4773 30.0002 20.0001 30.0002Z" fill="white"/> <path d="M58.416 30.448C53.012 30.448 49.204 26.584 49.204 20.088C49.204 13.704 52.872 9.672 58.472 9.672C63.54 9.672 66.256 12.332 67.096 16.84L63.288 17.036C62.812 14.432 61.216 12.836 58.472 12.836C55.084 12.836 52.984 15.664 52.984 20.088C52.984 24.568 55.14 27.284 58.444 27.284C61.384 27.284 62.952 25.576 63.4 22.72L67.208 22.916C66.424 27.592 63.456 30.448 58.416 30.448ZM74.6451 30.336C71.5091 30.336 69.4371 28.852 69.4371 26.248C69.4371 23.672 71.0331 22.3 74.3091 21.656L79.2651 20.676C79.2651 18.576 78.2851 17.484 76.4091 17.484C74.6451 17.484 73.6931 18.296 73.3571 19.808L69.6891 19.64C70.2771 16.504 72.6851 14.712 76.4091 14.712C80.6651 14.712 82.8491 16.952 82.8491 20.928V26.36C82.8491 27.172 83.1291 27.396 83.6891 27.396H84.1651V30C83.9411 30.056 83.3531 30.112 82.8771 30.112C81.2531 30.112 80.0491 29.524 79.7411 27.676C79.0131 29.272 77.1091 30.336 74.6451 30.336ZM75.3731 27.732C77.7531 27.732 79.2651 26.22 79.2651 23.952V23.112L75.4011 23.896C73.8051 24.204 73.1611 24.876 73.1611 25.912C73.1611 27.088 73.9451 27.732 75.3731 27.732ZM86.8741 34.2V15.048H90.3181L90.3741 17.26C91.2421 15.608 92.8941 14.712 94.8541 14.712C99.1101 14.712 101.21 18.212 101.21 22.524C101.21 26.836 99.0821 30.336 94.8261 30.336C92.9221 30.336 91.2701 29.412 90.4581 27.956V34.2H86.8741ZM93.9861 27.424C96.1701 27.424 97.4861 25.604 97.4861 22.524C97.4861 19.444 96.1701 17.624 93.9861 17.624C91.8021 17.624 90.4581 19.276 90.4581 22.524C90.4581 25.772 91.7741 27.424 93.9861 27.424Z" fill="#12161F"/> </svg><h1 style="font-size: 21px; line-height: 26px;">You are now signed in. Please re-open the Cap desktop app to continue.</h1></div></body>