@@ -19,6 +19,7 @@ import {
1919 useState ,
2020 Form ,
2121 Navigation ,
22+ useColorScheme ,
2223 type ScenePhase ,
2324} from "scripting"
2425
@@ -77,16 +78,32 @@ function EmptyState(props: {
7778 message : string
7879 systemImage : string
7980} ) {
81+ const colorScheme = useColorScheme ( )
82+ const cardFill = colorScheme === "dark" ? "secondarySystemBackground" : "systemBackground"
83+
8084 return (
81- < VStack
85+ < HStack
8286 frame = { { maxWidth : "infinity" , alignment : "center" as any } }
83- padding = { { top : 32 , bottom : 32 } }
84- spacing = { 10 }
87+ listRowInsets = { { top : 5 , bottom : 5 , leading : 12 , trailing : 12 } }
88+ listRowSeparator = "hidden"
89+ listRowBackground = { < EmptyView /> }
8590 >
86- < Image systemName = { props . systemImage } font = "largeTitle" foregroundStyle = "secondaryLabel" />
87- < Text font = "headline" > { props . title } </ Text >
88- < Text foregroundStyle = "secondaryLabel" multilineTextAlignment = "center" > { props . message } </ Text >
89- </ VStack >
91+ < VStack
92+ frame = { { maxWidth : "infinity" , alignment : "center" as any } }
93+ padding = { { top : 40 , bottom : 40 , leading : 16 , trailing : 16 } }
94+ spacing = { 12 }
95+ background = { { style : cardFill , shape : { type : "rect" , cornerRadius : 18 } } }
96+ shadow = { {
97+ color : colorScheme === "dark" ? "rgba(0,0,0,0.20)" : "rgba(0,0,0,0.07)" ,
98+ radius : 10 ,
99+ y : 4 ,
100+ } }
101+ >
102+ < Image systemName = { props . systemImage } font = "largeTitle" foregroundStyle = "secondaryLabel" />
103+ < Text font = "headline" > { props . title } </ Text >
104+ < Text foregroundStyle = "secondaryLabel" multilineTextAlignment = "center" > { props . message } </ Text >
105+ </ VStack >
106+ </ HStack >
90107 )
91108}
92109
@@ -383,6 +400,9 @@ export function AppRoot() {
383400 }
384401
385402 async function clearData ( scope : ClearScope ) {
403+ showToast ( "正在删除..." )
404+ // Yield to let toast render before blocking on async work
405+ await new Promise ( ( r ) => ( globalThis as any ) . setTimeout ?.( r , 50 ) )
386406 if ( scope === "favorites" ) {
387407 await clearFavoriteClips ( )
388408 showToast ( "已清空收藏数据" )
@@ -941,15 +961,20 @@ export function AppRoot() {
941961
942962 < Tab title = "设置" systemImage = "gearshape" value = { TAB_SETTINGS } >
943963 < NavigationStack >
944- < SettingsView
945- value = { settings }
946- onChanged = { updateSettings }
947- onClearFavorites = { ( ) => void requestClear ( "favorites" ) }
948- onClearClipboard = { ( range ) => void requestClear ( range ) }
949- addActionToken = { addCustomActionToken }
950- leadingToolbar = { toolbarLeading ( ) }
951- trailingToolbar = { settingsTrailingToolbar ( ) }
952- />
964+ < VStack
965+ frame = { { maxWidth : "infinity" , maxHeight : "infinity" , alignment : "top" as any } }
966+ toast = { toastOptions ( ) }
967+ >
968+ < SettingsView
969+ value = { settings }
970+ onChanged = { updateSettings }
971+ onClearFavorites = { ( ) => void requestClear ( "favorites" ) }
972+ onClearClipboard = { ( range ) => void requestClear ( range ) }
973+ addActionToken = { addCustomActionToken }
974+ leadingToolbar = { toolbarLeading ( ) }
975+ trailingToolbar = { settingsTrailingToolbar ( ) }
976+ />
977+ </ VStack >
953978 </ NavigationStack >
954979 </ Tab >
955980 </ TabView >
0 commit comments