Skip to content

Commit 4f76075

Browse files
author
Mohammod Al Amin Ashik
committed
fix: Improve switch visibility with solid gray colors
- Replace bg-surface-secondary with bg-gray-300 (light) / bg-gray-600 (dark) - Add visible borders (gray-400/gray-500) to unchecked state - Ensures switches are always visible regardless of theme - Checked state remains with primary color and transparent border
1 parent 3cb8e98 commit 4f76075

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

apps/desktop/src-tauri/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,13 @@ pub fn run() {
526526
if let Some(main_window) = app.get_webview_window("main") {
527527
let app_handle = app.handle().clone();
528528
let settings_repo = app_state.settings_repository.clone();
529-
529+
530530
main_window.on_window_event(move |event| {
531531
if let tauri::WindowEvent::CloseRequested { api, .. } = event {
532532
// Check if close-to-tray is enabled
533533
let app_handle_clone = app_handle.clone();
534534
let settings_clone = settings_repo.clone();
535-
535+
536536
tauri::async_runtime::spawn(async move {
537537
match settings_clone.get("ui.close_to_tray").await {
538538
Ok(Some(value)) if value == "true" => {
@@ -556,7 +556,7 @@ pub fn run() {
556556
}
557557
}
558558
});
559-
559+
560560
// Always prevent default close to handle it asynchronously
561561
api.prevent_close();
562562
}

packages/ui/src/components/common/Switch.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ export function Switch({
3636
onClick={handleClick}
3737
data-testid={testId}
3838
className={cn(
39-
'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-[rgb(var(--primary))] focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
40-
checked ? 'bg-[rgb(var(--primary))]' : 'bg-surface-secondary',
39+
'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-[rgb(var(--primary))] focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
40+
checked
41+
? 'bg-[rgb(var(--primary))] border-transparent'
42+
: 'bg-gray-300 dark:bg-gray-600 border-gray-400 dark:border-gray-500',
4143
className
4244
)}
4345
>

0 commit comments

Comments
 (0)