11use crate :: app:: {
2- Message , error:: AppError , finger:: Finger , fprint:: { enroll_fingerprint_process, verify_finger_process}
2+ Message ,
3+ error:: AppError ,
4+ finger:: Finger ,
5+ fprint:: { enroll_fingerprint_process, verify_finger_process} ,
36} ;
47use ashpd:: desktop:: settings:: { ColorScheme , Settings } ;
58use cosmic:: iced:: {
@@ -106,8 +109,9 @@ pub(crate) fn verify_subscription(data: VerifyData) -> Subscription<Message> {
106109 & data. device_path ,
107110 & data. finger . as_finger_id ( ) . unwrap_or_default ( ) ,
108111 & data. username ,
109- & mut output)
110- . await
112+ & mut output,
113+ )
114+ . await
111115 {
112116 Ok ( _) => { }
113117 Err ( e) => {
@@ -163,7 +167,7 @@ pub fn portal_theme_subscription(app_theme: crate::config::AppTheme) -> Subscrip
163167 }
164168}
165169
166- /// **Returns** a subscription to key events 0-9, r, v, c, Ctrl + d, Tab, Shift + Tab, F1, and Ctrl + ,
170+ /// **Returns** a subscription to key events 0-9, r, v, c, Ctrl + d/,/q and F1
167171pub fn key_subscription ( ) -> Subscription < Message > {
168172 cosmic:: iced:: event:: listen_raw ( |event, _status, _window| {
169173 let Event :: Keyboard ( keyboard:: Event :: KeyPressed { key, modifiers, .. } ) = event else {
@@ -175,13 +179,17 @@ pub fn key_subscription() -> Subscription<Message> {
175179 use cosmic:: iced:: keyboard:: key:: Named ;
176180
177181 match & key {
178- Key :: Named ( Named :: F1 ) if !modifiers. control ( ) && !modifiers. logo ( ) && !modifiers. alt ( ) => {
182+ Key :: Named ( Named :: F1 )
183+ if !modifiers. control ( ) && !modifiers. logo ( ) && !modifiers. alt ( ) =>
184+ {
179185 Some ( Message :: ToggleContextPage ( ContextPage :: About ) )
180186 }
181- Key :: Character ( c) if modifiers. control ( ) && c == "," => {
182- Some ( Message :: ToggleContextPage ( ContextPage :: Settings ) )
183- }
184- Key :: Character ( c) if modifiers. control ( ) && c == "d" => Some ( Message :: Delete ) ,
187+ Key :: Character ( c) if modifiers. control ( ) => match c. as_str ( ) {
188+ "," => Some ( Message :: ToggleContextPage ( ContextPage :: Settings ) ) ,
189+ "q" => Some ( Message :: CloseApplication ) ,
190+ "d" => Some ( Message :: Delete ) ,
191+ _ => None ,
192+ } ,
185193 Key :: Character ( c) if !modifiers. control ( ) && !modifiers. logo ( ) && !modifiers. alt ( ) => {
186194 match c. as_str ( ) {
187195 "r" => Some ( Message :: Register ) ,
0 commit comments