@@ -343,3 +343,77 @@ async def _tauri_save(self):
343343 txt_content = self .ctrl .download_state ()
344344 Path (export_path ).write_text (txt_content )
345345 self ._pending_task = None
346+
347+
348+ class BackgroundColors (v3 .VTooltip ):
349+ def __init__ (
350+ self ,
351+ compact = "compact_drawer" ,
352+ title = "Background Colors" ,
353+ update_background = None ,
354+ ):
355+ super ().__init__ (
356+ text = title ,
357+ disabled = (f"!{ compact } " ,),
358+ )
359+ self ._pending_task = None
360+ with self :
361+ with v3 .Template (v_slot_activator = "{ props }" ):
362+ with v3 .VListItem (
363+ v_bind = "props" ,
364+ prepend_icon = "mdi-format-color-fill" ,
365+ title = (f"{ compact } ? null : '{ title } '" ,),
366+ ):
367+ with v3 .VMenu (
368+ activator = "parent" ,
369+ location = "end" ,
370+ offset = 10 ,
371+ ):
372+ with v3 .VList (density = "compact" ):
373+ v3 .VListItem (
374+ title = "Dark gradient background" ,
375+ click = (
376+ update_background ,
377+ "[[84 / 255, 89 / 255, 109 / 255, 0, 0, 42 / 255]]" ,
378+ ),
379+ )
380+ v3 .VListItem (
381+ title = "Soft Black" ,
382+ click = (update_background , "[[0.071,0.071,0.071]]" ),
383+ )
384+ v3 .VListItem (
385+ title = "Charcoal" ,
386+ click = (update_background , "[[0.118,0.118,0.118]]" ),
387+ )
388+ v3 .VListItem (
389+ title = "Dark Gray" ,
390+ click = (update_background , "[[0.169,0.169,0.169]]" ),
391+ )
392+ v3 .VListItem (
393+ title = "Graphite" ,
394+ click = (update_background , "[[0.200,0.200,0.200]]" ),
395+ )
396+ v3 .VListItem (
397+ title = "Perceptual Mid-Gray" ,
398+ click = (update_background , "[[0.467,0.467,0.467]]" ),
399+ )
400+ v3 .VListItem (
401+ title = "Medium Gray" ,
402+ click = (update_background , "[[0.502,0.502,0.502]]" ),
403+ )
404+ v3 .VListItem (
405+ title = "Light Gray" ,
406+ click = (update_background , "[[0.851,0.851,0.851]]" ),
407+ )
408+ v3 .VListItem (
409+ title = "Off-White" ,
410+ click = (update_background , "[[0.949,0.949,0.949]]" ),
411+ )
412+ v3 .VListItem (
413+ title = "White" ,
414+ click = (update_background , "[[1,1,1]]" ),
415+ )
416+ v3 .VListItem (
417+ title = "Deep Space Blue" ,
418+ click = (update_background , "[[0.043,0.063,0.125]]" ),
419+ )
0 commit comments